# Linear Second order ODE equal to a constant

The question is to solve the ODE $$3y''+4y'+7y=-\pi.$$

I have assumed the homogenous case and found the general solution to the homogenous equation to be $$y_H = e^{-2x/3} \left( A \cos\left(2x\sqrt{17}\right) +B \sin\left(2x\sqrt{17}\right)\right).$$ Alternatively, when finding the particular solution I just guessed $y_p=-pi/7$ to be a solution as it fits. I feel as though the particular solution is incorrect because it was conducted purely by estimation. Is this the correct solution?

• Those should be $\dfrac{\sqrt{17}~ x}{3}$ for the two trig terms (the $2$ terms should also not be there) - so looks like a slight algebra mistake. For $y_p$ choose $y_p = a$, a constant term, substitute into the DE and will find it to be $a = -\dfrac{\pi}{7}$. – Moo Mar 20 '16 at 13:46

The method of Undetermined Coeff. suggests that "When no term of $Q(x)$ in $$a_ny^{(n)}+\cdots+a_0y=Q(x)$$ is the same as a term of $y_c$ (and you see this case happened here) so, take a general form for $y_p$ such that it contains a linear combination of the terms in $Q(x)$ and all its linearly independt derivatives."
So, take $y_p(x)=A+Bx$ and put it in the ODE to find the right constants $A$ and $B$.
I am not sure what you mean by "guessed" or "estimation". However, you should know that, with an equation like this, linear with constant coefficients, A constant will satisfy the entire equation. Rather than "guessing" $-\pi/7$ as a solution, try y= A, some undetermined constant, as a solution: Then y''= y'= 0 so the equation $3(0)+ 4(9)+ 7A= -\pi$. That satisfies the equation if and only if $A= -\pi/7$. If that was what you did, I would certainly not call it "guessing"! I would call it "knowing general properties of solutions to linear differential equations with constant coefficients".
You should have learned, when you learned this method, "undetermined coefficients", that it really only works when the right hand side is one of the types of functions that are solutions to linear differential equations with constant coefficients. Those are "polynomials", "exponentials", "sines and cosines" and combinations of those. Here, the right hand side, $\pi$, is a constant so a type or "polynomial". Another method, "variation of parameters", works for any type of right hand side but is much more complicated and may lead to integrals you cannot do.