logo    

Below are the solutions to the Module 3 Homework Assignment for Second-Order Differential Equations. Prior to these solutions, let’s recall a few important things that I’ll have to refer back to periodically.

An n-th Order Linear ODE

An n-th order Linear Differential Equation will always have the form of

\[ b_n(x)y^{(n)}+b_{n-1}(x)y^{(n-1)} + \cdots + b_2(x)y^{''}+b_1(x)y^{'} + b_0(x)y=g(x) \]

This is for 1st order, 2nd order, 3rd order, and so on. In this case, \(g(x)\) and the coefficients \(b_j(x)\) where \(j=0,1,2,\ldots, n\) depend solely on \(x\). In other words, they do not depend whatsoever on \(y\) or and derivative of \(y\).

Homogeneous vs Non-Homogeneous

If g(x)0 then the above equation is Homogeneous. If it's not, then it's Non-Homogeneous.

 

General Solutions

Once you derive your characteristic equation, then you have three possible cases for your General Solution

Case 1: \(\lambda_1\) and \(\lambda_2\) are Real & Distinct

Two linearly independent solutions are \(e^{\lambda_1x}\) and \(e^{\lambda_2x}\) and the general solution is given by

\[ y=c_1 e^{\lambda_1x} +c_2e^{\lambda_2x} \]

Special Case

In the special case that λ2=λ1, the solution above can be written as y=k1coshλ1x+k2sinhλ2x

 

Case 2: When \(\lambda_1\) & \(\lambda_2\) are Complex

Since \(a_1\) and \(a_0\) are assumed to be real in your characteristic equation, the roots of the characteristic equation must appear in conjugate pairs. Therefore, the other root is \(\lambda_2=a-bi\) . Two linearly independent solutions are \(e^{(a+bi)x}\) and \(e^{(a-bi)x}\) and the general complex solution would be

\[y=d_1e^{(a+bi)x} + d_2e^{(a-bi)x} \]

which, is equivalent to a different form that some of us are used to seeing

\[ y=c_1e^{ax} \cos bx + c_2e^{ax} \sin bx \]

Case 3: When \(\lambda_1=\lambda_2\)

Two linearly independent solutions are \(e^{\lambda_1x}\) and \(xe^{\lambda_1x}\) and the general solution is given by

\[ y=c_1e^{\lambda_1x}+c_2xe^{\lambda_1x} \]

Warning

These cases are not valid if the DE is not linear or does not have constant coefficients.

 

Problem 1

Solve \[\ddot{x}-0.01x=0\]

Solution

The characteristic equation is

\[ \lambda^2-0.01=0 \]

This equation can be factored into

\[ (\lambda-0.1)(\lambda+0.1)=0 \]

By using Algebra, the roots for this equation are \(\lambda_1=0.1\) and \(\lambda_2=-0.1\). Note, they are real numbers and distinct. Therefore, the general solution to this equation would be

\[ y=c_1e^{0.1t}+c_2e^{-0.1t} \]

or, if you want to use the special case version, we have:

\[ y=c_1 \cosh 0.1t + c_2 \sinh 0.1t \]

Problem 2

Solve

\[ y''+4y'+5y=0 \]

Solution

The characteristic equation is

\[ \lambda^2+4\lambda+5=0 \]

Once we break out the good ’ole quadratic formula,

\[ \lambda = \frac{-b\pm \sqrt{b^2-4ac}}{2a} \]

We have

\[ \lambda = \frac{-4\pm \sqrt{4^2-4(1)(5)}}{2(1)} \]

which gives us the following roots \(-2 +i\) and \(-2-i\) or simply \(-2 \pm i\)

Remember from algebra, complex solutions are written in the form \(a\pm bi\) ? In this case, \(a=-2\) and \(b=1\) . Therefore, the general solution, because we have a complex pair of roots, is

\[ y=k_1e^{-2x}\cos x + k_2e^{-2x}\sin x \]

Problem 3

Solve

\[ y^{''}-3y'+4y=0 \]

Solution

First, find the characteristic equation, which is

\[ \lambda^2-3\lambda +4=0 \]

Using the quadratic formula to solve this quadratic equation, we get the following roots:

\[ \lambda = \frac{-(-3)\pm \sqrt{(-3)^2-4(1)(4)}}{2(1)} = \frac{3}{2}\pm \frac{\sqrt{7}}{2}i \]

Since \(a=\frac{3}{2}\) and \(b=\frac{\sqrt{7}}{2}\) and by using Case 2 above, we’ll have our general solution as:

\[ y=c_1e^{\frac{3}{2}x} \cos \frac{\sqrt{7}}{2} x + c_2e^{\frac{3}{2}x}\sin \frac{\sqrt{7}}{2}x \]

Problem 4

Solve

\[ \ddot{y}-6\dot{y}+25y=0 \]

Solution

First, the characteristic equation of this would be

\[ \lambda^2-6\lambda + 25 = 0 \]

Using the Quadratic Formula, yields our roots, which are

\[ \lambda = \frac{-(-6)\pm \sqrt{(-6)^2-4(1)(25)}}{2(1)} = 3\pm 4i \]

Since we have complex roots, our \(a=3\) and \(b=4\), giving our general solution

\[ y=c_1e^{3t} \cos 4t + c_2e^{3t}\sin 4t \]

Problem 5

Solve

\[ \frac{d^2I}{dt^2}+20\frac{dI}{dt}+200I = 0 \]

Solution

First, find the characteristic equation. Even though it’s written in derivative form, we can still build our characteristic equation. Thus, we’ll have

\[ \lambda^2+20\lambda + 200=0 \]

Yet again, using the Quadratic formula to solve for \(\lambda\), we’ll get our roots, which are

\[ \lambda = \frac{-20\pm \sqrt{20^2-4(1)(200)}}{2(1)} = -10\pm 10i \]

Since we have a complex roots, our \(a = -10\) and \(b=10\). Therefore, our general solution would be

\[ I=c_1e^{-10t} \cos 10t + c_2e^{-10t}\sin 10t \]

Problem 6

Solve

\[ y^{(4)}-9y^{''}+20y=0 \]

Firstly, the characteristic equation would be

\[ \lambda^4-9\lambda + 20=0 \]

Using long division, synthetic division, or factoring (whichever you prefer), we get our roots to be

\[ x=\pm \sqrt{5} \text{ and } x = \pm 2 \]

Therefore, we have our general solution to be either one of the two below:

\[ \begin{eqnarray*} y&=&c_1e^{2x}+c_2e^{-2x}+c_3e^{\sqrt{5}x}+c_4e^{-\sqrt{5}x}\\ &&\\ y&=& k_1\cosh 2x + k_2 \sinh{2x}+k_3\cosh \sqrt{5}x + k_4\sinh \sqrt{5}x \end{eqnarray*} \]

Problem 7

Solve

\[ \frac{d^4x}{dt^4}-4\frac{d^3x}{dt^3}+7\frac{d^2x}{dt^2}-4\frac{dx}{dt}+6x=0 \]

Solution

The characteristic equation would be

\[ \lambda^4-4\lambda^3+7\lambda^2-4\lambda+6=0 \]

Using Synthetic Division to work this problem down into quadratic form, then using the quadratic formula, we obtain the roots

\[ \lambda_1=2+\sqrt{2}i, \hspace{3mm} \lambda_2=2-\sqrt{2}i, \hspace{3mm} \lambda_3=i, \hspace{3mm} \lambda_4=-i \]

Therefore, since we have complex roots, we have our general solution to be

\[ x=d_1e^{(2+\sqrt{2}i)t}+d_2e^{(2-\sqrt{2}i)t}+d_3e^{it}+d_4e^{-it} \]

General Cases - Method of Undetermined Coefficients

The method of Undetermined Coefficients is applicable only if \(\phi(x)\) and all of its derivatives can be written in terms of the same finite set of linearly independent functions, which we denote by \({y_1(x), y_2(x), \ldots , y_n(x)}\) . The same method is initiated by assuming a particular soultion of the form

\[ y_p(x)=A_1y_1(x)+A_2y_2(x)+\cdots+A_ny_n(x) \]

where \(A_1, A_2, \ldots, A_n\) denote arbitrary multiplicative constants. These arbitrary constants are then evaluated by substituting the proposed solution into the given differential equaion and equating the coefficients of like-terms. Now, this invokes 3 cases we must consider.

Case 1: \(\phi(x)=p_n(x)\), an \(n\)th-degree polynomial in \(x\)

Assume a solution of the form

\[ y_p=A_nx^n + A_{n-1}x^{n-1}+\ldots + A_1x^1+A_0x^0 \]

where \(A_j (j=0,1,2,3,\ldots, n)\) is a constant to be determined.

Case 2: \(\phi(x) = ke^{\alpha x}\) where \(k\) and \(\alpha\) are known constants.

Assume a solution of the form

\[ y_p=Ae^{\alpha x} \]

where \(A\) is a constant to be determined.

Case 3: \(\phi(x)=k_1\sin \beta x + k_2 \cos \beta x\) where \(k_1, k_2,\beta\) are known constants.

Assume a solution of the form

\[ y_p=A\sin \beta x + B \cos \beta x \]

where \(A\) and \(B\) are constants to be determined. Note, this case in its entirety is assumed even when \(k_1\) or \(k_2\) is zero, because the derivatives of sine or cosine involved both sine and cosine.

Problem 8

Solve (or Find the General Solution)

\[ \ddot{y}-6\dot{y}+25y=2\sin \frac{t}{2}-\cos \frac{t}{2} \]

Solution

Using Problem 4 we have the general solution of the left-hand side, which is \(y=c_1e^{3t} \cos 4t + c_2e^{3t}\sin 4t\) . Here, \(\phi(t)\) has the form displayed in from above with the independent variable \(t\) replacing \(x\), \(k_1=2\), \(k_2=-1\), and \(\beta = \frac{1}{2}\). Using [Case 3]: with \(t\) replacing \(x\), we assume that

\[ y_p=A\sin\frac{1}{2}t+B\cos \frac{1}{2}t \]

Taking the 1st and 2nd derivative of \(y_p\), we get

\[ \dot{y_p}=\frac{A}{2}\cos\frac{t}{2}-\frac{B}{2}\sin\frac{t}{2} \]

\[ \ddot{y_p}= -\frac{A}{4}\sin\frac{t}{2}-\frac{B}{4}\cos\frac{t}{2} \]

and now, substituting those results into the differential equation, originally, we get a wonderful looking equation like this:

\[ -\frac{A}{4}\sin\frac{t}{2}-\frac{B}{4}\cos\frac{t}{2} -6\left(\frac{A}{2}\cos\frac{t}{2}-\frac{B}{2}\sin\frac{t}{2}\right) + 25\left(A\sin\frac{t}{2}+B\cos \frac{t}{2}\right) = 2\sin \frac{t}{2}-\cos \frac{t}{2} \]

Simplifying it, we get:

\[ -\frac{A}{4}\sin\frac{t}{2}-\frac{B}{4}\cos\frac{t}{2} -3A\cos\frac{t}{2}+3B\sin\frac{t}{2} + 25A\sin\frac{t}{2}+25B\cos \frac{t}{2}= 2\sin \frac{t}{2}-\cos \frac{t}{2} \]

The fun part is the algebra. So, let’s arrange it in terms of \(\sin\) and \(\cos\). Once you do that and combine your fractions, you’ll get

\[ \left[\frac{99}{4}A+3B\right]\sin\frac{t}{2}+\left[-3A+\frac{99}{4}B\right]\cos \frac{t}{2} = 2\sin \frac{t}{2}-\cos \frac{t}{2} \]

Referring back to Case 3, since we have it in that form, we can now equate our coefficients because \(k_1=2\) and \(k_2=-1\). Thus, we’ll have

\[ \frac{99}{4}A+3B = 2 \hspace{.5cm} \text{ and } \hspace{.5cm} -3A+\frac{99}{4}B = -1 \]

Solving a system of two equations, either by graphing, substitution, elimination, or using the Python code below (Letting \(x\) = A and \(y\) = B):

from sympy import symbols, Eq, solve
x, y = symbols('x y')
equation1_a = Eq(99/4*x +3*y,2)
equation1_b = Eq (-3*x + 99/4 * y, -1)
solution1 = solve((equation1_a, equation1_b), (x, y))
print(f"Solution for the system 99/4*A + 3B = 2, -3A+99/4*B=-1: {solution1}")

Solution for the system 99/4*A + 3B = 2, -3A+99/4*B=-1: {x: 0.0844645550527904, y: -0.0301659125188537}

\[ A = 0.0844645550527904 \hspace{0.5cm} \text{ and } \hspace{0.5cm} B = -0.0301659125188537 \]

To make these exact answers, I simply plugged this into my TI-30XIIS scientific calculator

A: \(0.0844645550527904\) F \(\triangleleft\) \(\triangleright\) D to give us the exact answer, which is \[\frac{56}{663}\]

 

B: \(-0.0301659125188537\) F \(\triangleleft\) \(\triangleright\) D to give us the exact answer, which is \[-\frac{20}{663}\]

Therefore, the particular solution, \(y_p\) is now

\[ y_p = \frac{56}{663}\sin\frac{t}{2}-\frac{20}{663}\cos \frac{t}{2} \]

Finally, the general solution is:

\[ y=c_1e^{3t} \cos 4t + c_2e^{3t}\sin 4t + \frac{56}{663}\sin\frac{t}{2}-\frac{20}{663}\cos \frac{t}{2} \]

Problem 9

Find the General Solution to the given equation

\[ y^{'''}+y^{'} = \sec x \]

Solution

At first glance, this is a third-order equation in the form

\[ y_h = c_1+c_2\cos x + c_3\sin x \]

that means that our particular solution (because of the special cases when \(n=3\) ) would be written as

\[ y_p=v_1+v_2\cos x + v_3\sin x \]

In this notation, \(y_1 = 1\), \(y_2 = \cos x\) , \(y_3=\sin x\) , and \(\phi(x) = \sec x\) so we’ll have the following equations:

\[ \begin{eqnarray*} v_1'(1)+v_2'(\cos x) + v_3'(\sin x) &=&0\\ & &\\ v_1'(0) + v_2'(-\sin x) + v_3'(\cos x) &=& 0\\ & &\\ v_1'(0)+v_2'(-\cos x)+v_3'(-\sin x)&=&\sec x \end{eqnarray*} \]

Here, we have a system of 3 equations with 3 unknowns. Solving it for \(v_1'\), \(v_2'\) and \(v_3'\) , we get

\(v_1' = \sec x\), \(v_2' = -1\), and \(v_3' = -\tan x\) . Therefore,

\[ \begin{eqnarray*} v_1 = \int v_1'\hspace{1mm} dx &=& \int \sec x \hspace{1mm} dx = \ln |\sec x + \tan x|\\ & & \\ v_2 = \int v_2' \hspace{1mm} dx &=& \int -1 \hspace{1mm} dx = -x\\ & & \\ v_3 = \int v_3' \hspace{1mm}dx &=& \int -\tan x \hspace{1mm}dx = -\int \frac{\sin x}{\cos x}\hspace{1mm}dx = \ln |\cos x| \end{eqnarray*} \] Now, if we substitute these values into our particular solution, we get the following:

\[ y_p = \ln |\sec x + \tan x| - x \cos x + (\sin x)\ln |\cos x| \]

And finally, our general solution is:

\[ y = y_h + y_p = c_1+c_2\cos x + c_3\sin x + \ln |\sec x + \tan x| - x \cos x + (\sin x)\ln |\cos x| \]

Problem 10

Find the General Solution to the following equation

\[ y^{'''}-3y^{''}+2y^{'}=\frac{e^x}{1+e^{-x}} \]

Solution

Once again, we see that it’s a third order DE. Therefore, we’ll start off with the form

\[ y_h=c_1+c_2e^x+c_3e^{2x} \]

because we have Euler’s constants in our original problem. So we’ll use [Case 2] as reference. Therefore, our particular solution would be

\[ y_p=v_1+v_2e^x+v_3e^{2x} \]

Then, our \(y_1=1\), \(y_2=e^x\), \(y_3=e^{2x}\) and \(\phi(x)= \frac{e^x}{1+e^{-x}}\) becomes (taking the 1st, 2nd, and 3rd derivatives)

\[ \begin{eqnarray*} v_1'(1) + v_2'(e^x)+v_3'(e^{2x})&=&0\\ & &\\ v_1'(0)+v_2'(e^x)+v_3'(2e^{2x})&=&0\\ & & \\ v_1'(0)+v_2'(e^x)+v_3'(4e^{2x})&=&\frac{e^x}{1+e^{-x}} \end{eqnarray*} \]

Yet again, we have a system of 3 equations and 3 unknowns. You can solve this in Python, however, you will get some crazy numbers. It’s best to solve this by hand and keep your answers exact. It’s rough, but I do have faith in you! Once you solve the system (I used Cramer’s Rule), we get

\[ v_1' = \frac{1}{2}\left(\frac{e^x}{1+e^{-x}}\right) \]

\[ v_2'= \frac{-1}{1+e^{-x}} \]

\[ v_3'=\frac{1}{2}\left(\frac{e^{-x}}{{1+e^{-x}}}\right) \]

Now, we use substitutions \(u=e^x+1\) and \(w=1+e^{-x}\) then we find that

\[ \begin{eqnarray*} v_1 &=& \frac{1}{2}\int \frac{e^x}{1+e^{-x}} \hspace{1mm} dx = \frac{1}{2} \int \frac{e^x}{e^x+1}e^x \hspace{1mm} dx \\ & &\\ &=& \frac{1}{2}\int \frac{u-1}{u} \hspace{1mm}du = \frac{1}{2}u-\frac{1}{2} \ln |u|\\ & & \\ &=& \frac{1}{2}(e^x+1)-\frac{1}{2}\ln (e^x+1)\\ \end{eqnarray*} \]

\[ \begin{eqnarray*} v_2 &=& \int \frac{-1}{1+e^{-x}} \hspace{1mm} dx = -\int \frac{e^x}{e^x+1} \hspace{1mm} dx\\ & &\\ &=& -\int \frac{du}{u}-\ln|u|\\ & &\\ &=& -\ln (e^x+1) \end{eqnarray*} \]

\[ v_3 = \frac{1}{2}\int \frac{e^{-x}}{1+e^{-x}} \hspace{1mm} dx = -\frac{1}{2}\int \frac{dw}{w} = -\frac{1}{2}\ln|w| = -\frac{1}{2}\ln(1+e^{-x}) \]

Substituting these values back into our particular equation, we get:

\[ y_p = \left[\frac{1}{2}(e^x+1)-\frac{1}{2}\ln (e^x+1)\right] + \left[-\ln (e^x+1)\right]e^x + \left[-\frac{1}{2}\ln(1+e^{-x})\right]e^{2x} \]

Therefore, the general solution is written as:

\[ y = y_h + y_p = c_1+c_2e^x+c_3e^{2x} + \left[\frac{1}{2}(e^x+1)-\frac{1}{2}\ln (e^x+1)\right] + \left[-\ln (e^x+1)\right]e^x + \left[-\frac{1}{2}\ln(1+e^{-x})\right]e^{2x} \]

If you want, you can simplify it even further but in this case, you’re just overkilling it. QED! Awesome job!