# Guessing a solution to a differential equation

"A first order differential equation is given by $$x'(t)+5x(t)=e^{-t}cos(2t), t \in \mathbb{R}$$

Show that the differential equation has a solution on the form $$x(t)=ae^{-t}cos(2t)+be^{-t}, t \in \mathbb{R}$$

and determine the complete solution to the differential equation

Could someone explain the correct way to proceed? I don't seem to understand how this "Guessing a solution" works and how it can lead to the complete solution

• Why do you try to guess the solution? It is just a first order linear equation and there is an algorithm for it. Dec 2 '17 at 13:41
• Its a requirement - Sorry for not mentioning that Dec 2 '17 at 13:43
• Also according to the given equation there must be $e^{4t}$ exponential term in the solution. Dec 2 '17 at 13:51
• You don't have to guess, the guess has been made for you. You're just asked to show it's a good guess. Probably, how to make the guess in the first place will be a future topic in your studies.
– dbx
Dec 2 '17 at 14:02
• your solution is not correct Dec 2 '17 at 14:30

HINT: $$y_h=Ce^{-5t}$$ and for the particular solution make the ansatz $$y_P=Ae^{-t}(B\cos(2t)+C\sin(2t))$$
There is a general formula to solve this equation and can be found in any textbook. In your case, just consider the homogeneous equation $$x'_0(t)+5x_0(t)=0.$$ The solution is $x_0(t)=Ce^{-5t}$, where $C$ is an arbitrary constant. Now, for your equation just choose the solution $$x(t)=x_0(t)y(t)=e^{-5t}y(t)$$ where, in place of the constant $C$, now I have an unknown function to be computed. This can be done by substituting it in the full equation, that is $$x'(t)+5x(t)=y'(t)e^{-5t}=e^{-t}\cos(2t)$$ and you are left with the evaluation of the known integral $$y(t)=b+\int dt'e^{4t'}\cos(2t')$$ yielding the general solution.