Welcome to our community

Be a part of something great, join today!

[SOLVED] 17.2.02 - Solve 2nd order ODE using method of undetermined coefficients.


Well-known member
Jan 31, 2012
$\textrm{Solve the equation by the method of undetermined coefficients.}\\$
$\textit{ answer}$
y{\left (x \right )}& = C_{1} + C_{2} e^{4 x} - \frac{1}{17} \sin{\left (x \right )} + \frac{4}{17} \cos{\left (x \right )}

ok not sure how to start this

looked at example but..
Last edited:


Staff member
Feb 24, 2012
Okay the first thing we do is consider the solution $y_h$ to the corresponding homogeneous equation, namely:

\(\displaystyle y''-4y'=0\)

The characteristic/auxiliary equation is:

\(\displaystyle r^2-4r=r(r-4)=0\implies r\in\{0,4\}\)

Hence, we find:

\(\displaystyle y_h(x)=c_1e^{0x}+c_2e^{4x}=c_1+c_2e^{4x}\)

Next we look at the RHS of the given ODE, and from this we determine the particular solution will take the form:

\(\displaystyle y_p(x)=A\sin(x)+B\cos(x)\)

We need the first and second derivatives, so we compute:

\(\displaystyle y_p'(x)=A\cos(x)-B\sin(x)\)

\(\displaystyle y_p''(x)=-A\sin(x)-B\cos(x)\)

Next, we substitute $y_p$ into the ODE:

\(\displaystyle \left(-A\sin(x)-B\cos(x)\right)-4\left(A\cos(x)-B\sin(x)\right)=\sin(x)\)

Arrange as:

\(\displaystyle (-A+4B)\sin(x)+(-B-4A)\cos(x)=1\cdot\sin(x)+0\cdot\cos(x)\)

Equating coefficients, we obtain the system:

\(\displaystyle -A+4B=1\)

\(\displaystyle B+4A=0\)

Solving this system, we find:

\(\displaystyle (A,B)=\left(-\frac{1}{17},\frac{4}{17}\right)\)

And so we have:

\(\displaystyle y_p(x)=-\frac{1}{17}\sin(x)+\frac{4}{17}\cos(x)\)

And finally, by the principle of superposition, we may state the solution:

\(\displaystyle y(x)=y_h(x)+y_p(x)=c_1+c_2e^{4x}-\frac{1}{17}\sin(x)+\frac{4}{17}\cos(x)\)


Well-known member
Jan 31, 2012
Well that took the mystery out of
the text book examples😎

Notice there is a lot views on these problems
so there is a lot of lateral benefits