# $y''(t)+5y'(t)+6y(t)=\cos(t)$

$$y''(t)+5y'(t)+6y(t)=\cos(t)$$

I want to solve this ODE for the initial conditions $$y(0)=y'(0)=1.1$$

For the homogenous solution $$y_h$$ I looked at the roots of the characteristic polynomial $$\lambda^2+5\lambda+6$$ which are $$\lambda_1=-3, \lambda_2=-2$$.

So $$y_h=c_1e^{-3t}+c_2e^{-2t}$$

Then for the particular solution $$y_p$$ I solved

$$\begin{pmatrix}e^{-3t}&&e^{-2t}\\-3e^{-3t}&&-2e^{-2t}\end{pmatrix}\begin{pmatrix}c_1'(t)\\c_2'(t)\end{pmatrix}=\begin{pmatrix}0\\\cos(t)\end{pmatrix}$$

Then $$e^{-3t}c_1(t)=-\frac{3}{10}\cos(t)-\frac{1}{10}\sin(t)$$ and

$$e^{-2t}c_2(t)=\frac{4}{10}\cos(t)+\frac{2}{10}\sin(t)$$

So I end up with $$y(t)=c_1e^{-3t}+c_2e^{-2t}+\frac{1}{10}\cos(t)+\frac{1}{10}\sin(t)$$.

But in the task it says I should use the ansatz $$y_p(t)=d\cos(t+\delta)$$. How can I use this ansatz to determine $$y_p$$? I don't really get see how this can be done.

• Did you try substituting the proposed ansatz into the differential equation? – Minus One-Twelfth May 12 at 8:22

Expand $$\cos(t+\delta)$$ in terms of $$\sin$$ and $$\cos$$, substitute in the differential equation, and equate coefficients of $$\sin(t)$$ and $$\cos(t)$$. You should get the values of $$d$$ and $$\delta$$.
As you calculated, we have - $$5d(\cos(t)\cos\delta-\sin(t)\sin\delta-\sin(t)\cos\delta-\cos(t)\sin(\delta)) = \cos(t)$$ Now, collecting coefficients of $$\sin$$ and $$\cos$$, we get - $$\cos(t)[5d(\cos\delta-\sin\delta)- 1] - 5d\sin(t)[\sin\delta+\cos\delta] = 0$$ As $$\sin$$ and $$\cos$$ are independent, their coefficients must simultaneously equal $$0$$. So, we have - $$\sin\delta+\cos\delta = 0$$ and $$5d(\cos\delta-\sin\delta) = 1$$ This gives us - $$\tan(\delta) = -1$$ and $$10d\cos(\delta) = 1$$ or $$d = \frac{1}{10\cos\delta}$$ Thus, on simplifying, we get the solution - $$y_p = \frac{\cos(t-\frac{\pi}{4})}{5\sqrt2}$$
• Using $\cos(t+\delta)=\cos(t)\cos(\delta)-\sin(t)\sin(\delta)$ and substituting it in the differential equation I end up with $5\cos(t)\cos(\delta)-5\sin(t)\sin(\delta)-5\sin(t)\cos(\delta)-5\cos(t)\sin(\delta)$ What now? $d=1/5$ and then solving $1/5\times(...)=\cos(t)$? – user673257 May 12 at 8:48
• At $\sin \delta + \cos \delta=0 \rightarrow \tan \delta = -1$ you divide by $\cos \delta$. Could $\cos \delta$ be equal to zero? – user673257 May 12 at 10:02
• It cannot. For if $\cos\delta = 0$, then $\sin\delta = \pm 1$, as $\sin^2x + \cos^2x = 1$. – Ishan Deo May 12 at 10:41