# Solving Nonhomogeneous ODE - Ay''+By'+Cy = Fcos(Gx+H)

Suppose you have this nomhomogeneous ODE:

$$Ay''+2By'+Cy= F\cos(Gx+H)$$

where $A, B, C, F, G ,H$ are real numbers.

The homogeneous part of it is trivial, but I can't figure out how to solve for the nonhomogeneous part.

I have the solution: $$Y_{NH}(x) = \frac{F(C-AG^2)}{(C-AG^2)^2+4B^2G^2}\cos(Gx+H)\nonumber \\ +\frac{2FBG}{(C-AG^2)^2+4B^2G^2}\sin(Gx+H)$$

But I cannot see how to reach this result, could anyone give a hand here? Thanks!

• You can use Laplace's transform to get to the result. I think it would be the most straightforward approach. – Jakobian Jul 8 '18 at 13:58

The method of undetermined coefficients tells you that you can find a particular solution in the form $$y_{NH}(x)=K\cos(Gx+H)+L\sin(Gx+H)$$ as long as $\pm iG$ is not a characteristic root of the left side, that is, not both of $B=0$ and $AG^2-C=0$ are true simultaneously.