The DE Tutorial is currently being split up into different threads to make editing these posts easier.

Second Order NON-Homogeneous Differential Equations

Ah...the dreadful second order non-homogeneous differential equation has the form:

$\displaystyle a\frac{{d^2 y}}{{dx^2 }} + b\frac{{dy}}{{dx}} + cy = f\left( x\right)$

I will go through three techniques on how to solve these nasties:

- Method of Undetermined Coefficients
- The "Annihilator" Method (Similar to #1)
- Variation of Parameters
Technique 1 : Method of Undetermined Coefficients:

In the case we have a differential equation like $\displaystyle a\frac{{d^2 y}}{{dx^2 }} + b\frac{{dy}}{{dx}} + cy = f\left( x\right)$, we can guess what the particular solution to a DE may be, depending on what $\displaystyle f(x)$ is. For example, let us say that $\displaystyle f(x)=3x+7$. We would assume that a particular solution to the DE would be $\displaystyle y_p=Ax+B$. To find the Undetermined Coefficients, plug $\displaystyle y_p$ back into the original DE.

If $\displaystyle f(x)=5e^{-3x}$, we assume that the particular solution to the DE would have the form of $\displaystyle y_p=Ae^{-3x}$. We too would substitute $\displaystyle Ae^{-3x}$ into the DE to find the unknown coefficient value.

If $\displaystyle f(x)=3\cos(x)$, we assume that the particular solution to the DE would have the form of $\displaystyle y_p=A\cos(x)+B\sin(x)$. Again, to find the unknown coefficients, substitute $\displaystyle y_p$ into the original DE.

Sometimes, the guess of $\displaystyle y_p$ isn't that obvious. Try to think outside the box when solving these problems!

Note that the solution to the non-homogeneous DE is a linear combination of thecomplimentary solution(solution to the homogeneous equation) and theparticular solution(solution to the non-homogeneous equation)

Example 16:

Solve $\displaystyle y'' - 3y' + 2y = 3e^{ - x} - 10\cos \left( {3x} \right)$; $\displaystyle y(0)=1$; $\displaystyle y'(0)=2$.

Solve the homogeneous equation $\displaystyle y'' - 3y' + 2y = 0$ first.

$\displaystyle y''-3y'+2y=0 \implies r^2-3r+2=0 \implies r=2 \ \text{or} \ r=1$.

Thus, $\displaystyle y_c=c_1e^{x}+c_2e^{2x}$.

Now solve the non-homogeneous equation.

$\displaystyle y''-3y'+2y=3e^{ - x} - 10\cos \left( {3x} \right)$.

Using the method of Undetermined Coefficients, we guess and assume that the particular solution will have the form:

$\displaystyle y_p=Ae^{-x}+B\cos(3x)+C\sin(3x)$

$\displaystyle \therefore y_{p}^{/}=-Ae^{-x}-3B\sin(3x)+3C\cos(3x)$

$\displaystyle \therefore y_{p}^{//}=Ae^{-x}-9B\cos(3x)-9C\sin(3x)$.

Substituting these values into the original DE, we get:

$\displaystyle (Ae^{-x}-9B\cos(3x)-9C\sin(3x))-3(-Ae^{-x}-3B\sin(3x)+3C\cos(3x))+2(Ae^{-x}+$

$\displaystyle B\cos(3x)+C\sin(3x))=3e^{ - x} - 10\cos \left( {3x} \right)$

$\displaystyle \implies 6Ae^{-x}+(-7B-9C)\cos(3x)+(9B-7C)\sin(3x)=3e^{-x}-10\cos(3x)$

Now compare the coefficients (like in Partial Fractions)

$\displaystyle \begin{aligned}6A&=3\\7B-9C&=-10\\9B-7C&=0\end{aligned}$

Solving for the constants, we get $\displaystyle A=\frac{1}{2}$, $\displaystyle B=\frac{7}{13}$ and $\displaystyle C=\frac{9}{13}$ (verify).

Thus, $\displaystyle y_p=\frac{1}{2}e^{-x}+\frac{1}{13}\left(7\cos(3x)+9\sin(3x)\right)$.

Therefore, the solution is

$\displaystyle y=c_1e^{x}+c_2e^{2x}+\frac{1}{2}e^{-x}+\frac{1}{13}\left(7\cos(3x)+9\sin(3x)\right)$.

Find $\displaystyle y^{/}$ so we can apply the initial conditions:

$\displaystyle y^{/}=c_1e^{x}+2c_2e^{2x}-\frac{1}{2}e^{-x}+\frac{1}{13}\left(21\cos(3x)+27\sin(3x)\right)$.

Apply the initial conditions.

$\displaystyle y(0)=1=c_1+c_2+\frac{1}{2}+\frac{7}{13}$

$\displaystyle y^{/}(0)=2=c_1+2c_2-\frac{1}{2}+\frac{21}{13}$.

Solving for $\displaystyle c_1 \ \text{and} \ c_2$, get $\displaystyle c_1=-\frac{1}{2} \ \text{and} \ c_2=\frac{6}{13}$ (verify)

Therefore, the solution to the initial value problem is:

$\displaystyle \color{red}\boxed{y=-\frac{1}{2}e^{x}+\frac{6}{13}e^{2x}+\frac{1}{2}e^{-x}+\frac{1}{13}\left(7\cos(3x)+9\sin(3x)\right)}$.

I will discuss the next two sometime later...