# DE Tutorial - Part II: Nonhomogenous Second Order Equations and Their Applications

Status
Not open for further replies.

#### Chris L T521

MHF Hall of Fame
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:
1. Method of Undetermined Coefficients
2. The "Annihilator" Method (Similar to #1)
3. 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 the complimentary solution (solution to the homogeneous equation) and the particular 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...

Last edited by a moderator:

#### Chris L T521

MHF Hall of Fame
Technique #2 : The "Annihilator" Method:

An alternative to the first technique would be the Annihilator method. As it's name foretells, we annihilate the non-homogeneous term and make the equation homogeneous.

To use the Annihilator technique, you must rewrite the DE using Differential Operator Notation:

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

Note that we "factor" out a y (I use this term very loosely; you really can't factor out the y, but as you will see, it will work out to our advantage )

You can apply the annihilator to any of the following families of functions that $$\displaystyle f(x)$$ can be:

1. $$\displaystyle 1,x,x^2,x^3,\cdots ,x^{n-1}$$

2. $$\displaystyle e^{\alpha x}, xe^{\alpha x}, x^2e^{\alpha x},\cdots ,x^{n-1}e^{\alpha x}$$

3. $$\displaystyle e^{\alpha x}\cos(\beta x), xe^{\alpha x}\cos(\beta x), x^2e^{\alpha x}\cos(\beta x),\cdots,x^{n-1}e^{\alpha x}\cos(\beta x)$$

4. $$\displaystyle e^{\alpha x}\sin(\beta x), xe^{\alpha x}\sin(\beta x), x^2e^{\alpha x}\sin(\beta x),\cdots,x^{n-1}e^{\alpha x}\sin(\beta x)$$

The Annihilators
:

$$\displaystyle \color{red}\boxed{D^{n}}$$ will annihilate $$\displaystyle 1,x,x^2,x^3,\cdots ,x^{n-1}$$.

I will leave it for you to prove the other two:

$$\displaystyle \color{red}\boxed{\left(D-\alpha\right)^n}$$ will annihilate $$\displaystyle e^{\alpha x}, xe^{\alpha x}, x^2e^{\alpha x},\cdots ,x^{n-1}e^{\alpha x}$$.

$$\displaystyle \color{red}\boxed{\left(D^2-2\alpha D+(\alpha^2+\beta^2)\right)^n}$$ will annihilate $$\displaystyle e^{\alpha x}\cos(\beta x), xe^{\alpha x}\cos(\beta x), x^2e^{\alpha x}\cos(\beta x),\cdots,x^{n-1}e^{\alpha x}\cos(\beta x)$$ and
$$\displaystyle e^{\alpha x}\sin(\beta x), xe^{\alpha x}\sin(\beta x), x^2e^{\alpha x}\sin(\beta x),\cdots,x^{n-1}e^{\alpha x}\sin(\beta x)$$.

Example 17:

Solve $$\displaystyle y''-4y=\cosh (2x)$$.

Solving the homogeneous equation $$\displaystyle y'' -4y=0$$, we see that $$\displaystyle r^2-4=0 \implies r=\pm 2$$. Thus the complimentary solution is $$\displaystyle y_c=c_1e^{-2x}+c_2e^{2x}$$.

Now, to apply the annihilator to the DE, we need to rewrite it in differential form:

$$\displaystyle y''-4y=\cosh (2x) \implies \left(D^2-4\right)(y)=\cosh (2x)$$

noting that $$\displaystyle \cosh u =\frac{1}{2}\left( e^{u}+e^{-u}\right)$$, we have the DE:

$$\displaystyle \left(D^2-4\right)(y)=\frac{1}{2}\left(e^{2x}+e^{-2x}\right)$$

Let us determine the proper annihilator:

$$\displaystyle D-2 \ \text{annihilates} \ e^{2x} \ \text{and} \ D+2 \ \text{annihilates} \ e^{-2x}$$. This may pose a problem: we have two different annihilators! so which one do we apply to the DE? the answer is both. There is a theorem that states something like the following:

If there are two functions $$\displaystyle f(x) \ \text{and} \ g(x)$$ and their annihilators are $$\displaystyle L_1 \ \text{and} \ L_2$$ respectively,
then the product of the two annihilators $$\displaystyle \left(L_1L_2\right)$$ will annihilate $$\displaystyle f(x)+g(x)$$.

Thus, $$\displaystyle \left(D-2\right)\left(D+2\right)$$ will annihilate $$\displaystyle \frac{1}{2}\left(e^{2x}+e^{-2x}\right)$$.

Applying the newly found annihilator to both sides we get:

$$\displaystyle \left(D+2\right)\left(D-2\right)\left(D^2-4\right)(y)=0$$

Now rewrite the equation so we get the characteristic equation:

$$\displaystyle \left(r+2\right)\left(r-2\right)\left(r^2-4\right)=0$$

Solving for r, we get $$\displaystyle r=2$$ with multiplicity 2 and $$\displaystyle r=-2$$ with multiplicity 2.

Note that 2 of the r values were values used to determine the complimentary solution! Thus, the general solution will be:

$$\displaystyle y=\underbrace{c_1e^{-2x}+c_2e^{2x}}_{y_c}+\underbrace{c_3xe^{-2x}+c_4xe^{2x}}_{y_p}$$

Now find the coefficients $$\displaystyle c_3 \ \text{and} \ c_4$$ (which I will denote by A and B, respectively).

$$\displaystyle y_p=Axe^{-2x}+Bxe^{2x}$$
$$\displaystyle y_{p}^{/}=\left(A-2Ax\right)e^{-2x}+\left(2Bx+B\right)e^{2x}$$
$$\displaystyle y_{p}^{//}=\left(4Ax-4A\right)e^{-2x}+\left(4Bx+4B\right)e^{2x}$$

Substituting these values into the DE, we get:

$$\displaystyle \left(4Ax-4A\right)e^{-2x}+\left(4Bx+4B\right)e^{2x}-4\left[Axe^{-2x}+Bxe^{2x}\right]=\frac{1}{2}\left(e^{2x}+e^{-2x}\right)$$

$$\displaystyle \implies -4Ae^{-2x}+4Be^{2x}=\frac{1}{2}\left(e^{2x}+e^{-2x}\right)$$

Comparing the coefficients, we get:

\displaystyle \begin{aligned} -4A &= \frac{1}{2}\\ 4B &= \frac{1}{2} \end{aligned}

This gives us $$\displaystyle A=-\frac{1}{8}$$ and $$\displaystyle B=\frac{1}{8}$$

Therefore the general solution is:

$$\displaystyle \color{red}\boxed{y=c_1e^{-2x}+c_2e^{2x}-\frac{1}{8}\left(xe^{-2x}-xe^{2x}\right)}$$

Example 18:

Solve $$\displaystyle y''-6y'+13y=xe^{3x}\sin(2x)$$ (WARNING!! THIS IS A VERY TEDIOUS PROBLEM TO SOLVE!!! (Headbang) )

Here's the easy part (solve the homogeneous equation):

$$\displaystyle y''-6y+13=0 \implies r^2-6r+13=0\implies r=\frac{6\pm \sqrt{36-52}}{2}$$
$$\displaystyle \implies r=\frac{6\pm \sqrt{-16}}{2}\implies r=3\pm 2i$$

Thus the complimentary solution will be $$\displaystyle y_c=e^{3x}\left(c_1\cos(2x)+c_2\sin(2x)\right)$$

The next part isn't that bad (solving the non-homogeneous equation):

$$\displaystyle y''-6y+13=xe^{3x}\sin(2x) \implies \left(D^2-6D+13\right)(y)=xe^{3x}\sin(2x)$$

Now we can find the annihilator:

$$\displaystyle \left(D^2-2(3)D+(3^2+2^2)\right)^2 \implies \left(D^2-6D+13\right)^2$$ will annihilate $$\displaystyle xe^{3x}\sin(2x)$$.

Applying the annihilator to both sides, we get:

$$\displaystyle \left(D^2-6D+13\right)^3(y)=0$$

Converting it to the characteristic equation, we have:

$$\displaystyle \left(r^2-6r+13\right)^3=0 \implies r=3\pm 2i$$ with multiplicity three (note that one of these roots form the complementary solution)

Now here comes the nasty part: find $$\displaystyle y_p$$ (Headbang)

$$\displaystyle y_p=xe^{3x}\left(A\cos(2x)+B\sin(2x)\right)+x^2e^{3x}\left(C\cos(2x)+D\sin(2x)\right)$$
$$\displaystyle \implies y_p=\left(Ax+Cx^2\right)e^{3x}\cos(2x)+\left(Bx+Dx^2\right)e^{3x}\sin(2x)$$

I'll leave it for you to show that

\displaystyle \begin{aligned} y_{p}^{/}=&\left[\left(3A+2B+2C\right)x+\left(3C+2D\right)x^2+A\right]e^{3x}cos(2x)\\ &+\left[\left(3B-2A+2D\right)x+\left(3D-2C\right)x^2+B\right]e^{3x}\sin(2x) \end{aligned}

\displaystyle \begin{aligned} y_{p}^{//}=&\left[\left(5A+12B+12C+8D\right)x+\left(12D+5C\right)x^2+3A+2B\right]e^{3x}\cos(2x)\\ &+\left[\left(5B-12A-8C+12D\right)x+\left(5D-12C\right)x^2+3B-2A\right]e^{3x}\sin(2x) \end{aligned}

\displaystyle \begin{aligned} &\left(\left[\left(5A+12B+12C+8D\right)x+\left(12D+5C\right)x^2+3A+2B\right]e^{3x}\cos(2x)\right.\\ &+\left.\left[\left(5B-12A-8C+12D\right)x+\left(5D-12C\right)x^2+3B-2A\right]e^{3x}\sin(2x)\right)\\ &-6\left[\left[\left(3A+2B+2C\right)x+\left(3C+2D\right)x^2+A\right]e^{3x}cos(2x)\right. \end{aligned}
\displaystyle \begin{aligned} &+\left.\left[\left(3B-2A+2D\right)x+\left(3D-2C\right)x^2+B\right]e^{3x}\sin(2x)\right]\\ &+13\left[\left(Ax+Cx^2\right)e^{3x}\cos(2x)+\left(Bx+Dx^2\right)e^{3x}\sin(2x)\right]=xe^{3x}\sin(2x) \end{aligned}

...well, after a decent amount of cancellations, we get:

$$\displaystyle \left[2D-3A+8Dx\right]e^{3x}\cos(2x)+\left[-3B-2A-8Cx\right]e^{3x}\sin(2x)=xe^{3x}\sin(2x)$$

Comparing the coefficients, we get:

\displaystyle \begin{aligned} 2D-3A&=0 \\ 8D&=0 \\ -8C&=1 \\ -3B-2A&=0 \end{aligned}

Solving this system, we get $$\displaystyle A=0 \text{,} \ B=0 \text{,} \ C=-\frac{1}{8} \text{,} \ \text{and} \ D=0$$

Therefore, $$\displaystyle y_p=-\frac{1}{8}x^2e^{3x}\cos(2x)$$

Therefore, the general solution is:

$$\displaystyle \color{red}\boxed{y=e^{3x}\left(c_1\cos(2x)+c_2\sin(2x)\right)-\frac{1}{8}x^2e^{3x}\cos(2x)}$$

I will discuss Variation of Parameters tomorrow (hopefully)

Last edited by a moderator:

#### Chris L T521

MHF Hall of Fame
Technique #3: Variation of Parameters:

We have dealt with non-homogeneous equations where $$\displaystyle f(x)$$ had the form of $$\displaystyle x^n \text{,} \ x^ne^{\alpha x} \text{,} \ x^ne^{\alpha x}\sin(\beta x) \text{,} \ etc$$. However, what if $$\displaystyle f(x)$$ was $$\displaystyle \sec x$$? $$\displaystyle \sin^{-1}x$$? $$\displaystyle \ln x$$? We would now need a new technique to conquer these non-homogeneous equations. That technique is known as variation of parameters.

If we have a differential equation in the form $$\displaystyle \frac{d^2y}{dx^2}+P(x)\frac{dy}{dx}+Q(x)y=f(x)$$, we want $$\displaystyle y_p=u_1(x)y_1+u_2(x)y_2$$. But how do we find $$\displaystyle u_1(x)$$ and $$\displaystyle u_2(x)$$?? We will substitute $$\displaystyle y_p$$ into the differential equation. This will give us the following:

$$\displaystyle u_1^{//} y_1 + u_1^/ y_1^/ + u_1^/ y_1^/ + u_1 y_1^{//} + u_2^{//} y_2 + u_2^/ y_2^/$$ $$\displaystyle + u_2^/ y_2^/ + u_2 y_2^{//} + P(x)\left[ {u_1^/ y_1 + u_1 y_1^/ + u_2^/ y_2 + u_2 y_2^/ } \right]$$ $$\displaystyle + Q(x)\left[ {u_1 y_1 + u_2 y_2 } \right]$$
$$\displaystyle = u_1 \left[ {y_1^{//} + P(x)y_1^/ + Q(x)y_1 } \right] + u_2 \left[ {y_2^{//} + P(x)y_2^/ + Q(x)y_2 } \right]$$ $$\displaystyle + u_1^{//} y_1 + u_1^/ y_1^/ + u_2^{//} y_2 + u_2^/ y_2^/ + P(x)\left[ {u_1^/ y_1 + + u_2^/ y_2 } \right]$$ $$\displaystyle + u_1^/ y_1^/ + u_2^/y_2^/$$
$$\displaystyle = \frac{d} {{dx}}\left[ {u_1^/ y_1 + u_2^/ y_2 } \right] + P(x)\left[ {u_1^/ y_1 + + u_2^/ y_2 } \right] + u_1^/ y_1^/ + u_2^/ y_2^/$$
$$\displaystyle =f(x)$$

Since we seek $$\displaystyle u_1$$ and $$\displaystyle u_2$$, we need two equations. To get these equations, we need to impose 2 conditions onto $$\displaystyle u_1$$ and $$\displaystyle u_2$$ The first condition is that $$\displaystyle L\left[y_p\right]=f(x)$$. The second one we can apply is not given, thus, we need to come up with one.

Recall that $$\displaystyle y_p^/ = u_1^/ y_1 + u_1 y_1^/ + u_2^/ y_2 + u_2 y_2^/$$. Rearranging, we get $$\displaystyle y_p^/ = (u_1 y_1^/ + u_2 y_2^/ ) + (u_1^/ y_1 + u_2^/ y_2 )$$.

To avoid the appearance of the second derivatives $$\displaystyle u_1^{//}$$ and $$\displaystyle u_2^{//}$$, we impose the second condition that the second sum must equal zero:

$$\displaystyle u_1^/ y_1 + u_2^/ y_2 =0$$

With these assumptions, the DE becomes $$\displaystyle u_1^/ y_1^/ + u_2^/ y_2^/ = f(x)$$.

Now, we have a system of equations:

$$\displaystyle \left\{\begin{array}{l} u_1^/ y_1 + u_2^/ y_2 =0 \\ u_1^/ y_1^/ + u_2^/ y_2^/ = f(x)\\ \end{array} \right.$$

To solve this, we will use Cramer's Rule:

If Ax = b is a system of n linear equations in n unknowns such that $$\displaystyle \det (A) \ne 0$$, then the system has a unique solution. This solution is
$$\displaystyle x_1 = \frac{{\det (A_1 )}} {{\det (A)}}$$,...,$$\displaystyle x_2 = \frac{{\det (A_2 )}} {{\det (A)}}$$,...,$$\displaystyle x_n= \frac{{\det (A_n )}} {{\det (A)}}$$

where $$\displaystyle A_j$$ is the matrix obtained by replacing the terms in the $$\displaystyle j^{th}$$ column of A by the entries in matrix b.

To apply Cramer's Rule, we write the system in matrix form:

$$\displaystyle \left[ {\begin{array}{*{20}c} {y_1 } & {y_2 } \\ {y_1^/ } & {y_2^/ } \\ \end{array} } \right]\left[ {\begin{array}{*{20}c} {u_1^/ } \\ {u_2^/ } \\ \end{array} } \right] = \left[ {\begin{array}{*{20}c} 0 \\ {f(x)} \\ \end{array} } \right]$$

Thus, according to Cramer's rule,

$$\displaystyle u_1^/ = \frac{{\det \left[ {\begin{array}{*{20}c} 0 & {y_2 } \\ {f(x)} & {y_2^/ } \\ \end{array} } \right]}} {{\det \left[ {\begin{array}{*{20}c} {y_1 } & {y_2 } \\ {y_1^/ } & {y_2^/ } \\ \end{array} } \right]}}$$ and $$\displaystyle u_2^/ = \frac{{\det \left[ {\begin{array}{*{20}c} {y_1 } & 0 \\ {y_1^/ } & {f(x)} \\ \end{array} } \right]}} {{\det \left[ {\begin{array}{*{20}c} {y_1 } & {y_2 } \\ {y_1^/ } & {y_2^/ } \\ \end{array} } \right]}}$$

We represent the determinant matrices as $$\displaystyle W_1$$, $$\displaystyle W_2$$, and $$\displaystyle W$$. Particularly,

$$\displaystyle W_1^{} = \det \left[ {\begin{array}{*{20}c} 0 & {y_2 } \\ {f(x)} & {y_2^/ } \\ \end{array} } \right]$$, $$\displaystyle W_2^{} = \det \left[ {\begin{array}{*{20}c} {y_1 } & 0 \\ {y_1^/ } & {f(x)} \\ \end{array} } \right]$$, and $$\displaystyle W = \det \left[ {\begin{array}{*{20}c} {y_1 } & {y_2 } \\ {y_1^/ } & {y_2^/ } \\ \end{array} } \right]$$

We recongnize $$\displaystyle W$$ as the Wronskian of $$\displaystyle y_1$$ and $$\displaystyle y_2$$. Due to the linear independence of $$\displaystyle y_1$$ and $$\displaystyle y_2$$, $$\displaystyle W(y_1,y_2)\neq 0$$.

We can now find $$\displaystyle u_1$$ and $$\displaystyle u_2$$.

Example 19:

Solve $$\displaystyle y''+y=\tan x$$.

Solve the homogeneous equation:

$$\displaystyle y''+y=0 \implies r^2+1=0 \implies r=\pm i$$

Thus, $$\displaystyle y_c=c_1\cos(x)+c_2\sin(x)$$.

Now that we have $$\displaystyle y_1=\cos(x)$$ and $$\displaystyle y_2=\sin(x)$$ we can use variation of parameters.

$$\displaystyle W_1=\det \left[ {\begin{array}{*{20}c} 0 & {\sin x } \\ {\tan x} & {\cos x} \\ \end{array} } \right]=-\frac{\sin^2(x)}{cos(x)}=\frac{\cos^2(x)-1}{cos(x)}=\cos(x)-\sec(x)$$

$$\displaystyle W_2=\det \left[ {\begin{array}{*{20}c} {cos(x) } & 0 \\ {-sin(x) } & {\tan(x)} \\ \end{array} } \right]=\cos(x)\tan(x)=\sin(x)$$

$$\displaystyle W = \det \left[ {\begin{array}{*{20}c} {\cos(x)} & {\sin(x)} \\ {-\sin(x)} & {\cos(x)} \\ \end{array} } \right]=\cos^2(x)-\left(-\sin^2(x)\right)=cos^2(x)+sin^2(x)=1$$

Therefore $$\displaystyle u_1^/=\frac{W_1}{W}=\cos(x)-\sec(x)$$ and $$\displaystyle u_2^/=\frac{W_2}{W}=\sin(x)$$.

Now find $$\displaystyle u_1$$ and $$\displaystyle u_2$$.

$$\displaystyle u_1=\int \left(\cos(x)-\sec(x)\right)\,dx=\sin(x)-\ln\left|\sec(x)+\tan(x)\right|$$

$$\displaystyle u_2=\int \sin(x)\,dx=-\cos(x)$$

Therefore, our particular solution will be:

$$\displaystyle \color{red}\boxed{y=\left[\sin(x)-\ln\left|\sec(x)+\tan(x)\right|\right]\cos(x)-\frac{1}{2}\sin(2x)}$$

My next couple posts will be on applications of non-homogeneous differential equations (in particular, the spring mass systems)...

Last edited by a moderator:

#### Chris L T521

MHF Hall of Fame
It's been a while since I've last posted. I finally found the time right now to do this, since it has been on my mind for a while. I put this together a little quickly, but I will come back later and make changes [if necessary].

Applications of Homogeneous and Non Homogeneous Differential Equations (Spring Mass Systems)

A useful application to the real world would be spring mass systems. We prefer to use homogeneous or non-homogeneous differential equations to model the systems.

There are two types of systems. One models damped motion [due to a dashpot of some sort or due to friction], and the other models undamped motion [sometimes known as free motion].

Undamped Spring Mass Systems

Consider a spring of length $$\displaystyle l$$ hanging from the ceiling. The spring has a mass $$\displaystyle m$$ attached to its end. The system comes to rest at its equilibrium position.

When the system is place in motion, the spring varies in length about the equilibrium position. We will denote this distance from the equilibrium position as $$\displaystyle x$$.

When a free body analysis is done, we see two different forces:

$$\displaystyle F=ma$$ [Newton's 2nd Law] and $$\displaystyle F=-kx$$ [Hooke's Law].

Thus, we see that $$\displaystyle \sum F_y=0$$ when $$\displaystyle -kx-ma=0\implies ma+kx=0$$

Since $$\displaystyle a=\frac{d^2x}{dt^2}$$, our equation becomes the differential equation $$\displaystyle m\frac{d^2x}{dt^2}+kx=0\implies x''+\frac{k}{m}x=0$$.

Letting $$\displaystyle \frac{k}{m}=\omega^2$$, the DE becomes $$\displaystyle x''+\omega^2x=0$$.

However, we are dealing with systems that are being acted upon my external forces, so we make a modification to our DE. If an external force is applied, then the DE takes on the form $$\displaystyle x''+\omega^2x=F(t)$$, which is non-homogeneous. When no external force is applied, $$\displaystyle F(t)=0$$, which then makes the equation homogeneous.

Let's take a look at an example:

Example 20:

A mass weighing 2 pounds stretches a spring 6 inches. At $$\displaystyle t=0$$, the mass is released from a point
8 inches below the equilibrium position with an upward velocity of
$$\displaystyle \tfrac{4}{3}~ft/s$$. Determine the equation of free motion.

This can be seen as an initial value problem.

Since the weight of the mass is 2 pounds, we can determine the mass, because $$\displaystyle w=mg\implies m=\frac{w}{g}\implies m=\frac{2~lbs}{32~ft/s^2}\implies m=\frac{1}{16}~slug$$

Since the string is displaced by 6 inches = 1/2 a foot, we can determine k:

$$\displaystyle F=kx\implies 2~lbs=k\left(\tfrac{1}{2}~ft\right)\implies k=4~lbs/ft$$

At $$\displaystyle t=0$$, the mass is released 8 inches below the equilibrium position. This implies that the condition is $$\displaystyle x(0)=\tfrac{2}{3}~ft$$.

At $$\displaystyle t=0$$, the mass is released with an upward velocity of $$\displaystyle \tfrac{4}{3}~ft/s$$. This implies that the condition is $$\displaystyle x'(0)=-\tfrac{4}{3}~ft/s$$.

Keep in mind the signs of these conditions. If the mass starts off above the equilibrium position, the sign applied to the condition is negative, and if the mass starts off below the equilibrium poistion, the sign applied to the condition is positive. The same idea is applied to upward and downward velocities.

Let's start to set up our DE:

Since $$\displaystyle \frac{k}{m}=\omega^2$$, we see that $$\displaystyle \omega^2=64$$

So our IVP is:

$$\displaystyle x''+64x=0;~~x(0)=\tfrac{2}{3},~~x'(0)=-\tfrac{4}{3}$$

We see that the characteristic equation has the form

$$\displaystyle r^2+64=0$$

This implies that we have complex conjugate roots. Thus, we see that $$\displaystyle r=\pm8i\implies x(t)=A\cos(8t)+B\sin(8t)$$

Applying the condition $$\displaystyle x(0)=\tfrac{2}{3}$$, we see that $$\displaystyle A=\tfrac{2}{3}$$.

Before we apply the second condition, let's find $$\displaystyle x'(t)$$

$$\displaystyle x'(t)=-8A\sin(8t)+8B\cos(8t)$$

Applying the condition$$\displaystyle x'(0)=-\tfrac{4}{3}$$, we see that $$\displaystyle -\tfrac{4}{3}=8B\implies B=-\tfrac{1}{6}$$.

Thus, the equation of free motion is $$\displaystyle \color{red}\boxed{x(t)=\tfrac{2}{3}\cos(8t)-\tfrac{1}{6}\sin(8t)}$$

-------------------------------------------------------------------------

Damped Motion

Let's go back to the equation we came up with for undamped motion:

$$\displaystyle mx''+kx=F(t)$$

For damped motion, we need to introduce a damping term. The term is $$\displaystyle \beta x'$$.

When introduced into the system, we see from a free body diagram that $$\displaystyle ma=-kx-\beta x'$$

Thus, we see that $$\displaystyle ma+\beta x'+kx=0$$.

Since $$\displaystyle a=x''$$ the DE becomes $$\displaystyle mx''+\beta x'+kx=0\implies x''+\frac{\beta}{m}x'+\frac{k}{m}x=0$$.

Letting $$\displaystyle \frac{k}{m}=\omega^2$$ and $$\displaystyle \frac{\beta}{m}=2\lambda$$, the DE is then transformed into

$$\displaystyle x''+2\lambda x'+\omega^2 x=0$$

Given a particular external force, F(T), we can say the DE takes on the form

$$\displaystyle x''+2\lambda x'+\omega^2 x=F(t)$$

In the case that there is no external force, $$\displaystyle F(t)=0$$.

Three Cases for Damped Motion

Solving $$\displaystyle x''+2\lambda x'+\omega^2 x=0$$, we see that we have the auxiliary equation $$\displaystyle r^2+2\lambda r+\omega^2=0$$

Using the quadratic formula, we see that $$\displaystyle r=\frac{-2\lambda\pm\sqrt{4\lambda^2-4\omega^2}}{2}\implies r=\frac{-2\lambda\pm2\sqrt{\lambda^2-\omega^2}}{2}\implies r=-\lambda\pm\sqrt{\lambda^2-\omega^2}$$

We have three cases, depending on the value of $$\displaystyle r=-\lambda\pm\sqrt{\lambda^2-\omega^2}$$

Case 1 : Overdamped

We have overdamped motion when r consists of real and distinct roots.

Other factors for determining the overdamped case are when $$\displaystyle \beta>>k\implies \lambda^2>\omega^2$$

Thus, the general solution for overdamped motion has the form $$\displaystyle \color{red}\boxed{x(t)=c_1e^{(-\lambda+\sqrt{\lambda^2-\omega^2})t}+c_2e^{(-\lambda-\sqrt{\lambda^2-\omega^2})t}}$$

Case 2 : Critically damped

We have critically damped motion when r consists of real, repeated roots.

One major factor that reveals this is when $$\displaystyle \lambda^2=\omega^2$$.

Thus, the general solution for critically damped motion has the form $$\displaystyle \color{red}\boxed{x(t)=c_1e^{-\lambda t}+c_2te^{-\lambda t}}$$

Case 3 : Underdamped

We have underdamped motion when r consists of complex, conjugate roots.

Major factors that reveal this is when $$\displaystyle k>>\beta$$ and when $$\displaystyle \lambda^2<\omega^2$$.

This then implies that the solution to the characteristic equation has the form $$\displaystyle r=-\lambda\pm\sqrt{\omega^2-\lambda^2}i$$.

Thus, the general solution for underdamped motion has the form $$\displaystyle \color{red}\boxed{x(t)=e^{-\lambda t}\left[c_1\cos\left(\sqrt{\omega^2-\lambda^2}t\right)+c_2\sin\left(\sqrt{\omega^2-\lambda^2}t\right)\right]}$$

Let us take a look at another example.

Example 21:

A 4-foot spring measures 8 feet long after an 8-pound weight is attatched
to it. The medium through with the weight moves offers a resistance
numerically equal to $$\displaystyle \sqrt{2}$$ times the instantaneous velocity. Find the equation
of motion if the weight is released from the equilibrium postion with a downward
velocity of 5 ft/s. Find the time at which the weight attains its extreme
displacement from the equilibrium position.
Identify the system as overdamped, underdamped, or critically damped.

$$\displaystyle w=mg\implies m=\frac{w}{g}$$

Since $$\displaystyle w=8~lbs$$ and $$\displaystyle g=32~ft/s^2$$, $$\displaystyle m=\tfrac{1}{4}~slug$$

$$\displaystyle F=kx\implies k=\frac{F}{x}$$

Since $$\displaystyle F=w=8~lbs$$, and $$\displaystyle x=4~ft$$, $$\displaystyle k=2~lbs/ft$$

Since the medium through with the weight moves offers a resistance numerically equal to $$\displaystyle \sqrt{2}$$ times the instantaneous velocity, this implies that $$\displaystyle \beta=\sqrt{2}$$.

Now, let us determine the conditions:

Since the mass is being released from the equilibrium position, we see that $$\displaystyle x(0)=0$$

Since the mass will have a downward velocity of $$\displaystyle 5~ft/s$$, this implies that $$\displaystyle x'(0)=5$$

Since $$\displaystyle \frac{k}{m}=\omega^2$$ and $$\displaystyle \frac{\beta}{m}=2\lambda$$, we see that $$\displaystyle \omega^2=8$$ and $$\displaystyle 2\lambda=4\sqrt{2}$$

Now, we have the IVP:

$$\displaystyle x''+4\sqrt{2}x'+8x=0;~~x(0)=0,~~x'(0)=5$$

Solving, we see that the DE has the characteristic equation $$\displaystyle r^2+4\sqrt{2}r+8=0$$. It turns out to be a perfect square:

$$\displaystyle r^2+4\sqrt{2}r+8=0\implies\left(r+2\sqrt{2}\right)^2=0\implies r=-2\sqrt{2}$$ with multiplicity 2.

Thus, $$\displaystyle x(t)=c_1e^{-2\sqrt{2}t}+c_2te^{-2\sqrt{2}t}\implies x(t)=(c_1+c_2t)e^{-2\sqrt{2}t}$$

When $$\displaystyle x(0)=0$$, $$\displaystyle c_1=0$$.

Now we need to find $$\displaystyle x'(t)$$

$$\displaystyle x'(t)=-2\sqrt{2}(c_1+c_2t)e^{-2\sqrt{2}t}+c_2e^{-2\sqrt{2}t}$$

When, $$\displaystyle x'(0)=5$$, $$\displaystyle 5=-2\sqrt{2}c_1+c_2$$

But $$\displaystyle c_1=0$$, so $$\displaystyle c_2=5$$

Therefore, the equation of motion is $$\displaystyle \color{red}\boxed{x(t)=5te^{-2\sqrt{2}t}}$$.

Now, we need to find the time when the greatest displacement is achieved.

This is the case when $$\displaystyle x'(t)=0$$

Since $$\displaystyle x'(t)=5e^{-2\sqrt{2}t}-10\sqrt{2}te^{-2\sqrt{2}t}$$, the time when the greatest displacement is achieved when $$\displaystyle 0=5-10\sqrt{2}t\implies t=\frac{1}{2\sqrt{2}}\implies \color{red}\boxed{t=\frac{\sqrt{2}}{4}}$$.

Since we saw that the auxiliary equation had real repeated roots, we can tell that the equation of motion will be critically damped.

-------------------------------------------------------------------------

My next post may be on another application of second order DE's [Electronic Circuits], or I may dive into systems of DEs and matrix methods.

Last edited by a moderator:

#### Chris L T521

MHF Hall of Fame
Something told me now is the best time to start updating this tutorial, especially since I'm currently on vacation from school. This post will be on electrical circuits.

Electrical Circuits

First, let me start off with a diagram.

The type of circuit we will analyze will be a RLC circuit.

In a RLC circuit, there is a(n):

- resistor with resistance $$\displaystyle R$$ ohms ($$\displaystyle \Omega$$)
- inductor with inductance $$\displaystyle L$$ henries
- capacitor with capacitance $$\displaystyle C$$ farads.
- Source with voltage $$\displaystyle E$$ volts.

There is a nice relationship between current, $$\displaystyle I$$, and charge, $$\displaystyle Q$$. Current is the rate of change of the flow of charges. Thus, we can say $$\displaystyle I=\frac{\,dQ}{\,dt}$$.

According to the fundamental elementary principles of electricity, we see that the voltage drop across the three elements are as follows:

- Across a resistor, the voltage drop is resistance times current, or $$\displaystyle RI$$.

- Across an inductor, the voltage drop is the inductance times the rate of change in the current, or $$\displaystyle L\frac{\,dI}{\,dt}$$.

- Across a capacitor, the voltage drop is the charge divided by capacitance, or $$\displaystyle \frac{1}{C}Q$$.

Now, we can analyze the behavior of the circuit by using one of Kirchoff's Laws:

The (Algebraic) sum of the voltage drops across the elements in a simple loop of an electrical circuit is equal to the applied voltage.

Thus, we see that if $$\displaystyle E\left(t\right)$$ is the applied voltage from the source, we get the equation $$\displaystyle L\frac{\,dI}{\,dt}+RI+\frac{1}{C}Q=E\left(t\right)$$.

Using the relationship between current and charge, we can rewrite this as the second order non-homogeneous DE $$\displaystyle L\frac{\,d^2Q}{\,dt^2}+R\frac{\,dQ}{\,dt}+\frac{1}{C}Q=E\left(t\right)$$.

The solution to this differential equation, of course, is the amount of charge, $$\displaystyle Q$$, at any given time, $$\displaystyle t$$.

However, we usually want to solve for current. You can solve for current in one of two ways:

1) If you differentiate both sides of the differential equation, we get $$\displaystyle L\frac{\,d^3Q}{\,dt^3}+R\frac{\,d^2Q}{\,dt^2}+\frac{1}{C}\frac{\,dQ}{\,dt}=E^{\prime}\left(t\right)\implies L\frac{\,d^2I}{\,dt^2}+R\frac{\,dI}{\,dt}+\frac{1}{C}I=E^{\prime}\left(t\right)$$. Now the solution to the DE is current, $$\displaystyle I$$.

2) Once you solve $$\displaystyle L\frac{\,d^2Q}{\,dt^2}+R\frac{\,dQ}{\,dt}+\frac{1}{C}Q=E\left(t\right)$$, differentiate the solution to get current, $$\displaystyle I$$.

Now, what happens if we are not dealing with a RLC Circuit?!?! We make slight modifications.

- If we have a RL Circuit, we solve the differential equation $$\displaystyle L\frac{\,d^2Q}{\,dt^2}+R\frac{\,dQ}{\,dt}=E\left(t\right)$$

- If we have a RC Circuit, we solve the differential equation $$\displaystyle R\frac{\,dQ}{\,dt}+\frac{1}{C}Q=E\left(t\right)$$

- If we have a LC Circuit, we solve the differential equation $$\displaystyle L\frac{\,d^2Q}{\,dt^2}+\frac{1}{C}Q=E\left(t\right)$$

Let us go through a couple of examples:

Example 22

Suppose that in an RLC Circuit, we have a resistance of 60 $$\displaystyle \mathit{\Omega}$$, an inductance of 2 henries, and a capacitance of 0.0025 farads. Now, let the circuit have an emf of $$\displaystyle \mathit{E\left(t\right)=100e^{-10t}}$$ volts. Find the current in the circuit, given that the inital current in the circuit is zero, and the charge on the capacitor is one coloumb.

This is another initial value problem.

Here, we are to solve the DE $$\displaystyle 2\frac{\,d^2Q}{\,dt^2}+60\frac{\,dQ}{\,dt}+\frac{1}{0.0025}Q=100e^{-10t}$$, where $$\displaystyle I\left(0\right)=0,~Q\left(0\right)=1$$.

The DE can be rewritten as $$\displaystyle \frac{\,d^2Q}{\,dt^2}+30\frac{\,dQ}{\,dt}+200Q=50e^{-10t}$$

In solving the homogeneous equation, we get the characteristic equation $$\displaystyle r^2+30r+200=0\implies \left(r+20\right)\left(r+10\right)=0$$. We now see that this gives us $$\displaystyle r_1=-20$$ and $$\displaystyle r_2=-10$$.

Thus, our complimentary solution is $$\displaystyle Q_c=c_1e^{-20t}+c_2e^{-10t}$$

Now, to find the particular solution, I will apply the method of the annihilator (in a sense, the annihilator method leads to the method of undetermined coefficients).

Rewriting the DE in differential operator notation, we get $$\displaystyle \left(D^2+30D+200\right)\left(y\right)=50e^{-10t}$$

The term that annihilates $$\displaystyle 50e^{-10t}$$ is $$\displaystyle \left(D+10\right)$$

Thus, applying the annihilator to both sides of the DE, we can then convert the DE to the characteristic equation $$\displaystyle (r+10)\left(r^2+30r+200\right)=0$$

The particular solution is $$\displaystyle r_p=-10$$

Thus, it will take on the form $$\displaystyle Q_p=Ate^{-10t}$$

Now, substituting this into the original DE, we get $$\displaystyle 10Ae^{-10t}=50e^{-10t}$$ (Verify)

You now get that $$\displaystyle A=5$$

Thus, the general solution to the DE is $$\displaystyle Q\left(t\right)=c_1e^{-20t}+c_2e^{-10t}+5te^{-10t}$$

Let us now apply the initial conditions:

$$\displaystyle Q\left(0\right)=1\implies 1=c_1+c_2$$

To apply the second condition, find $$\displaystyle I\left(t\right)$$

$$\displaystyle I\left(t\right)=\frac{\,dQ}{\,dt}=-20c_1e^{-20t}-10c_2e^{-10t}-50te^{-10t}+5e^{-10t}$$

Thus, $$\displaystyle I\left(0\right)=0\implies 0=-20c_1-10c_2+5$$.

Solving these two equations for $$\displaystyle c_1$$ and $$\displaystyle c_2$$, we get $$\displaystyle c_1=-\tfrac{1}{2}$$ and $$\displaystyle c_2=-\tfrac{3}{2}$$ (Verify)

Thus, the current is $$\displaystyle I\left(t\right)=-\tfrac{1}{2}\left(-20\right)e^{-20t}-\left[\tfrac{3}{2}\left(-10\right)+5\right]e^{-10t}-50te^{-10t}=\color{red}\boxed{10e^{-20t}+10e^{-10t}-50te^{-10t}}$$

-------------------------------------------------------------------------

I will post another example when I find the time later today

Last edited by a moderator:
Status
Not open for further replies.