# Second Order Differential Equations

As discussed in the introduction to differential equations, a vibrational system can be represented with a second-order differential equation of the form $my''+cy'+ky=f(t)$ where $m$ is the mass of the body, $c$ is the damper constant, $k$ is the spring constant, and $f(t)$ is some external force. In general, a second-order differential equation looks like $p(x)y''+q(x)y'+r(x)y=g(x).$

In this course, we're going to stick to simpler cases, where the following two assumptions hold:

- The equation is homogeneous: $g(x)=0.$ In the case of the vibration application, this means there's no external force on the object; it is simply deflected and left to vibrate.
- The coefficients are constants: $p,$ $q,$ and $r$ are constant.

# General Solution

### Theorem

For a differential equation of the form $py''+qy'+ry=0,$ solutions are given by $y=c_1y_1+c_2y_2,$ where $y_1$ and $y_2$ are two linearly independent solutions of the differential equation. When we solve these equations, we'll get two solutions, and then write the full solution this way. To get a particular solution, we'll need two given conditions, so that we can find $c_1$ and $c_2.$

### Definition: Linear Independence

Two functions are **linearly independent** if neither is a constant multiple of the other.

For example, $3 \sin x$ and $−4 \sin x$ are not linearly independent, but $2x$ and $4x^2$ are linearly independent. This will be significant in one case below.

### Finding the Solution

Start with the differential equation: $py''+qy'+ry=0$ Follow me for a moment on a seeming leap: we are looking for this unknown function $y,$ and all that we know is that if we add it, its derivative, and its second derivative together, they all cancel each other out; they must therefore look like the original function. The only function we know of whose derivatives look like it is the exponential function. So let's assume that the solution looks like $y=e^{mx}.$ Following that logic, $\begin{aligned} y &= e^{mx}\ y' &= me^{mx}\ y'' &= m^2e^{mx} \end{aligned}$

so when we substitute these into the differential equation, we get the following:

$\begin{aligned} pm^2e^{mx}+qme^{mx}+re^{mx} &= 0\ e^{mx}(pm^2+qm+r) &= 0 \end{aligned}$

Since $e^{mx}$ is never equal to $0,$ it follows that $pm^2+qm+r=0.$

If we solve this equation, called the **characteristic equation**, to find $m,$ we'll have the solutions.

# Solution Possibilities

There are three possibilities for the forms of the solutions, based on the values of $m,$ which are in turn based on the form of the characteristic equation. If we use the quadratic formula to find $m,$ we find that $m=\dfrac{−q \pm \sqrt{q^2−4pr}}{2p}$

The three possibilities depend on the value of $q^2−4pr,$ the discriminant of the quadratic equation.

## Case 1: Two Distinct Real Roots $(q^2-4pr > 0)$

If the discriminant is positive, we'll get two real answers for $m$ that are different. In that case, the two solutions look like

$y_1=e^{m_1x} \textrm{ and } y_2=e^{m_2x},$

which makes the full solution $\ans{y = c_1e^{m_1x} + c_2e^{m_2x}}$

## Case 2: One Real Root $(q^2-4pr = 0)$

If the discriminant is zero, everything after the plus/minus is zero, so there will only be one real answer for $m.$ This is the case where it is important to account for linear independence. Here, the two solutions look like

$y_1=e^{mx} \textrm{ and } y_2=xe^{mx},$

which makes the full solution $\ans{y = c_1e^{mx} + c_2xe^{mx}}$

## Case 3: A Conjugate Pair of Complex Roots $(q^2-4pr < 0)$

If the discriminant is negative, we'll get a complex conjugate pair of solutions, of the form $m = a \pm bi.$ In that case, the two solutions look like

$y_1=e^{ax}\cos(bx) \textrm{ and } y_2=e^{ax}\sin(bx),$

which makes the full solution $\ans{y = c_1e^{ax}\cos(bx) + c_2e^{ax}\sin(bx)}$

Solve the following differential equation. $y''−6y'+9y=0$

### Solution

The characteristic equation is $m^2−6m+9=0.$

Notice that we simply replace $y''$ with $m^2,$ $y′$ with $m,$ and $y$ with $1$ to get the characteristic equation. We can solve for $m$ using the quadratic formula, but this one also can be factored nicely:

$m^2−6m+9=(m−3)(m−3)=0,$

which means that $m=3.$ This is the second case; there is only one value for $m.$ Therefore, the solution is $\ans{y=c_1e^{3x}+c_2xe^{3x}}$

Solve the following differential equation. $y''+6y'+5y=0 \hspace{0.5in} y(0)=2,\ y'(0)=1$

### Solution

The characteristic equation is $m^2+6m+5=0.$

Again, we can solve for $m$ by factoring: $m^2+6m+5=(m+5)(m+1)=0,$

which means that $m=−5,−1.$ This is the first case; there are two distinct real values for $m.$ Therefore, the general solution is $y=c_1e^{−5x}+c_2e^{−x}.$

To find the particular solution, we need to use the given initial conditions: $\begin{aligned} y(x) = c_1e^{−5x}+c_2e^{−x} &\longrightarrow 2=c_1+c_2\ y'(x)=−5c_1e^{−5x}−c_2e^{−x} &\longrightarrow 1=−5c_1−c_2 \end{aligned}$

When you solve this system of two equations, you'll find that $c_1=−3/4$ and $c_2=11/4,$ so the particular solution is $\ans{y=−\dfrac{3}{4}e^{−5x}+\dfrac{11}{4}e^{−x}}$

Solve the following differential equation. $y''+2y'−15y=0$

$y=c_1e^{−5x}+c_2e^{3x}$

Solve the following differential equation. $y''+y'+2y=0$

### Solution

The characteristic equation is $m^2+m+2=0.$

This one doesn't factor nicely, so we have to find $m$ using the quadratic formula: $m=\dfrac{−1 \pm \sqrt{1−4(1)(2)}}{2}=\dfrac{−1 \pm \sqrt{7}}{2}i$

Matching this to the form $m=a±bi,$ we find that $a=−1/2$ and $b=\sqrt{7}/2.$ Therefore, the solution (according to Case 3) looks like $\ans{y=c_1e^{−1/2x}\cos\left(\dfrac{\sqrt{7}}{2}x\right)+c_2e^{−1/2x}\sin\left(\dfrac{\sqrt{7}}{2}x\right)}$