[Math] Undetermined coefficients for the equation $y”+9y=\sin 3x$

ordinary differential equations

In solving the differential equation $y''+9y=\sin 3x$, first of all find the general integral of the corresponding homogeneous equation. One easily finds the general solution
$$
y=c_1\cos 3x+c_2\sin 3x.
$$

Now, look for a particular solution $\psi$ of the equation. If I try with the form
$$
\psi=a\cos 3x+b\sin 3x
$$

with $a, b$ constants, this doesn't work beacuse the coefficient 9 in the equation screws it up. I understand that a better choice would be

$$
\psi=(A+Bx)\cos 3x+(C+Dx)\sin 3x
$$

which allows to find that a particular solution is $\psi=-1/6x\cos3x$. My question is, why? How can I guess from the form of the equation that this should be the correct form of the particular solution?

Also, I should add that I am following Coddington's book on ODEs, but he does not exaplain the method of undetermined coefficients but only the more general variation of the constants method. Do you have some nice reference about the undetermined coefficients method?

Best Answer

Now, look for a particular solution $\psi$ of the equation. If I try with the form $$ \psi=a\cos 3x+b\sin 3x $$

This would be the standard choice for a right-hand side of the form $\sin 3x$ but you can know in advance that this won't work since this suggestion is already a solution of the homogeneous equation; hence substitution into the differential equation will yield $0$ and not $\sin 3x$.

The trick, which can be proven to work, is to suggest a solution of the form: $$ \psi=x^m\left( a\cos 3x+b\sin 3x \right) $$ where you take $m$ sufficiently large so that it is no longer a solution to the homogeneous equation. In your case $m=1$ will do, you so suggest: $$\psi= ax\cos 3x+bx\sin 3x$$ This method is explained in most texts and proven in some.

An online reference: Paul's Online Math Notes: Differential equations - Undetermined Coefficients.


Example

The solution of the homogeneous differential equation associated with $y''-4y'+4y=e^{2x}$ is $$y_h = c_1e^{2x}+c_2xe^{2x}$$ Based on the right-hand side $e^{2x}$, the standard suggestion for a particular solution would be of the form $y_p = ae^{2x}$ but that won't work since it's already a part of the homogeneous solution. Even with an extra factor $x$, $y_p = axe^{2x}$, you get the same problem. You need a solution of the form: $$y_p = a x^2 e^{2x}$$ And some calculations will lead to $a = 1/2$.

Related Question