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

#### karush

##### Well-known member
$\tiny{17.2.02}$
$\textrm{Solve the equation by the method of undetermined coefficients.}\\$
\begin{align*}\displaystyle
y''-4y'&=\sin{x}\\
y_p&=A\sin{x}\\
\end{align*}
$\textit{ answer}$
\begin{align*}\displaystyle
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 )}
\end{align*}

ok not sure how to start this

looked at example but..

Last edited:

#### MarkFL

##### Administrator
Staff member
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)$$

#### karush

##### Well-known member
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