I came across the following differential equation while practicing $ \displaystyle \phi'' + 4\phi' + 3\phi = x \cos {3x} .$
Now, I used VARIATION OF PARAMETERS to solve it. I found general solution the equation $ \displaystyle \phi'' + 4\phi' + 3\phi = 0 $ to be $\displaystyle C_1 e^{-3x} + C_2 e^{-x}.$
Now we need to find two functions $\lambda \ \text{and} \ \nu $ such that $\displaystyle \lambda'e^{-3x} + \nu'e^{-x} = 0 $ and $\displaystyle -3\lambda'e^{-3x} - \nu'e^{-x} = x \cos {3x} .$
Then the general solution would be : $\displaystyle \lambda e^{-3x} + \nu e^{-x} .$
On solving I got : $$\displaystyle \lambda = -\frac {1}{2} \int x \cdot \cos{3x} \cdot e^{3x} \mathrm {d}x \\ \nu = \frac {1}{2} \int x \cdot \cos{3x} \cdot e^{x} \mathrm {d}x $$
These integrals took me a long time to solve. I used the traditional DI method to solve for it.
Finally getting the answer as : $$ \displaystyle C_1 e^{-3x} + C_2 e^{-x} + \frac {x}{30} ( 2 \sin {3x} - \cos {3x} ) + \frac {47}{1800}\cos {3x} +\frac {19}{200}\sin {3x} . $$
I want my answer to get verified and am open to some good way to the integral quickly.
Thank you in advance.