# Solve second order ODE with undetermined coefficients method

Consider the differential equation

$$y''+5y'=-sin(x)-1$$ Find the general solution.

Here's my work: I found the solution to the homogeneous equation to be: $y_h(x)=C_1e^{-5x}+C_2$

And for the particular solution, I guessed

$y_p(x)=Acos(x)+Bsin(x)+C$

$y_p'(x)=-Asin(x)+Bcos(x)$

$y_p''(x)=-Asin(x)-Bcos(x)$

After I plugged everything back into the differential equation, I got

$(5B-A)cos(x)-(B+5A)sin(x)=-sin(x)-1$

What should I do with the constant $-1$?

Instead of your try, you should do $y_p(x)=A\cos x+B\sin x+Cx$, so that when you take the first derivative, you still get a constant to handle the constant factor $-1$ in the RHS.
• I'd also add that it happens because $y = C$ is a fundamental solution. – Kaster Oct 18 '13 at 0:05