---
title: "Second-Order Linear Differential Equations"
source: https://www.jemoka.com/posts/kbhsecond_order_linear_differential_equation/
---

Here&rsquo;s a general form:
\begin{equation} a\dv[2]{x}{t} + b \dv{x}{t} + cx = f(t) \end{equation}
see:
solving homogeneous constant coefficient higher-order differential equations and more generally, using matrix exponentiation, solving homogeneous higher-order differential equations solving homogeneous higher-order differential equations This problem because easier if the right side is \(0\).
\begin{equation} a\dv[2]{x}{t} + b \dv{x}{t} + cx = 0 \end{equation}
The general goal to solve in this case is to make this a system of First-Order Differential Equations.
To do this, we begin by making:
\begin{equation} y = \dv{x}{t} \end{equation}
Therefore, we can change the first equation:
\begin{equation} a \dv{y}{t} + by + cx = 0 \end{equation}
Solving both of these conditions, we form a system of linear equations:
\begin{align} &amp;\dv{x}{t}=y \\ &amp;\dv{y}{t} = \frac{-c}{a}x-\frac{b}{a}y \end{align}
We are now first-order, so we can put this into a matrix equation:
\begin{equation} \dv t \begin{pmatrix} x \\ y \end{pmatrix} = \begin{pmatrix} 0 &amp; 1 \\ -\frac{c}{a} &amp; \frac{-b}{a} \end{pmatrix} \begin{pmatrix} x \\ y \end{pmatrix} \end{equation}
Now! We have an equation:
\begin{equation} \dv{t}v = Av \end{equation}
The result above shows that the transformations \(\dv{t}\) and \(A\) are isomorphic. Therefore, we now attempt to characterize \(A\) to solve this expression.
Let&rsquo;s begin. We will first shove that \(v\) on top of the differential for aesthetics:
\begin{equation} \dv{v}{t} = Av \end{equation}
This expression is actually nicely seperable, so we shall endeavor to separate it:
\begin{equation} \dd{v} = Av\dd{t} \end{equation}
Of course, \(v\) is a function of \(t\). Therefore, the right side would be woefully complicated. Therefore, we shall do this handwavy thing where we go:
\begin{equation} \frac{1}{v}\dd{v} = A\dd{t} \end{equation}
Now, \(A\) is not a function in \(t\) &mdash; its just some constants! So, we can integrate this safely without much trouble:
\begin{equation} \int \frac{1}{v}\dd{v} =\int A\dd{t} \end{equation}
To get:
\begin{equation} \ln v = t A + C \end{equation}
Note the order as \(t\) is a constant. Finally, we will invert the natural log and get \(v\) back:
\begin{equation} v = e^{tA+C} \end{equation}
Excellent. We will now apply some log/exponent laws:
\begin{equation} v = e^{tA}e^{C} = e^{tA}C \end{equation}
this is so very handwavy. \(C\) is technically a vector here&hellip; long story and iffy understanding
Ok, how do we go about solving \(x\)?
Note now that \(v=(x\ y)\), so we will expand that:
\begin{equation} \begin{pmatrix} x \\ y \end{pmatrix} = e^{tA}\begin{pmatrix} x_0 \\ y_0 \end{pmatrix} \end{equation}
where, as we defined above \(y=\dv{x}{t}\) (each integral needing a different constant.)
Now. remember that \(A\) is diagonalizable; and so will \(tA\) (citation needed, but intuition is that scaling eigenvalues do nothing anyways). So, to make this exponentiation easier, we will diagonalize it.
We now have that
\begin{equation} e^{tA} = \mqty(v_1&amp; \dots&amp; v_{m})\mqty(\dmat{e^{t\lambda_{1}}, \dots, e^{t\lambda_{m}}})\mqty(v_1&amp; \dots&amp; v_{m})^{-1} \end{equation}
(how?)
Ok. Finally, we will take the binroller that is &ldquo;constancy&rdquo; and apply it to \(e^{tA}\). This took quite a bit of time for me to get, so feel free to take some time to get it too.
This all hinges upon the fact that \(C\) is a constant, so multiplying any constant to it still makes it \(C\).
So far, we have that:
\begin{equation} \begin{pmatrix} x \\ y \end{pmatrix} = e^{tA}\begin{pmatrix} x_0 \\ y_0 \end{pmatrix} = \qty(\mqty(v_1&amp; \dots&amp; v_{m})\mqty(\dmat{e^{t\lambda_{1}}, \dots, e^{t\lambda_{m}}})\mqty(v_1&amp; \dots&amp; v_{m})^{-1} )\begin{pmatrix} x_0 \\ y_0 \end{pmatrix} \end{equation}
Remember, now, that \(v_1\dots v_{}\) and its inverses are nothing but vectors filled with a lot of scalars. And any scalar \(\alpha\) times a constant still results in the (a new) constant: \(\alpha C =C\). So, we will steamroll \(\mqty(x_0&amp;y_0)\) over the right side eigenbases matrix (multiplying a constant vector to any&rsquo;ol matrix will just get a new set of constants back) to get:
\begin{align} \begin{pmatrix} x \\ y \end{pmatrix} &amp;= \qty(\mqty(v_1&amp; \dots&amp; v_{m})\mqty(\dmat{e^{t\lambda_{1}}, \dots, e^{t\lambda_{m}}})\mqty(v_1&amp; \dots&amp; v_{m})^{-1} )\begin{pmatrix} x_0 \\ y_0 \end{pmatrix} \\ &amp;= \mqty(v_1&amp; \dots&amp; v_{m})\mqty(\dmat{e^{t\lambda_{1}}, \dots, e^{t\lambda_{m}}}) \begin{pmatrix} C_1 \\ C_2 \end{pmatrix} \end{align}
Now, the middle thing has \(t\) in it! (the input!) So, we can&rsquo;t just steamroll now. We have to preserve the middle part.
\begin{align} \begin{pmatrix} x \\ y \end{pmatrix} &amp;= \mqty(v_1&amp; \dots&amp; v_{m})\mqty(\dmat{e^{t\lambda_{1}}, \dots, e^{t\lambda_{m}}}) \begin{pmatrix} C_1 \\ C_2 \end{pmatrix} \\ &amp;= \mqty(v_1&amp; \dots&amp; v_{m}) \begin{pmatrix} C_1 e^{t\lambda_{1}} \\ C_2 e^{t\lambda_{2}} \end{pmatrix} \end{align}
And finally, we keep steamrolling:
\begin{align} \begin{pmatrix} x \\ y \end{pmatrix} &amp;= \mqty(v_1&amp; \dots&amp; v_{m}) \begin{pmatrix} C_1 e^{t\lambda_{1}} \\ C_2 e^{t\lambda_{2}} \end{pmatrix}\\ &amp;= \mqty({C_{1_{x}} e^{t\lambda_{1}} + C_{2_{x}} e^{t\lambda_{2}}} \\ {C_{1_{y}} e^{t\lambda_{1}} + C_{2_{y}} e^{t\lambda_{2}}}) \end{align}
There is absolutely no difference in nature between \(C_{j_{x}}\) and \(C_{j_{y}}\) except for the fact that they are different constants (which we got by multiplying \(v_1 \dots v_{m}\)) to it.
Ok so:
\begin{equation} \begin{cases} x = C_{1_{x}} e^{t\lambda_{1}} + C_{2_{x}} e^{t\lambda_{2}}\\ y = C_{1_{y}} e^{t\lambda_{1}} + C_{2_{y}} e^{t\lambda_{2}}\\ \end{cases} \end{equation}
constructing the characteristic equation, as desired.
solving homogeneous constant coefficient higher-order differential equations in the homogeneous case, we have some:
\begin{equation} y&rsquo;&rsquo; + ay&rsquo; + by = 0 \end{equation}
and it arises that there&rsquo;s a pair of solutions \(y_1(t)\) and \(y_2(t)\) whose linear combinations span the entire space of solutions. in fact, it arises as a solution to some functional quadratic equation \(\lambda^{2} + a\lambda + b = 0\).
The specific coefficients \(c_1\) and \(c_2\) of the linear combination arises out of the initial conditons, which is the same measurement given at the initial time and its derivative: \(y(t_0)\) and \(y&rsquo;(t_0)\). It comes out of Linear Algebra why there is exactly two initial values.
Specifically, it arises out of solutions of the shape:
\begin{equation} y(t) = c_1 e^{\lambda_{1}t} + c_2e^{\lambda_{2}t} \end{equation}
where \(\lambda_{1}\) and \(\lambda_{2}\) are solutions to the characteristic polynomial above. For why exactly this is, see method of undetermined coefficients.
finding independent solutions of second-order constant-coefficient linear ODEs Given some:
\begin{equation} y&rsquo;&rsquo; + ay&rsquo; + by = 0 \end{equation}
we desire to find two independent solutions. After which, by superposition principle, we know that any linear combinations will yield a solution.
Aside, consider:
\begin{equation} y&rsquo;&rsquo; = y \end{equation}
we see that both \(y=e^{t}\) and \(y=e^{-t}\) are solutions. We can see that this is independent by setting up:
\begin{equation} c_1 e^{t} + c_2 e^{-t} = 0 \end{equation}
which, multiplying through by \(e^{t}\) and dividing, we obtain:
\begin{equation} e^{2t} = -\frac{c_2}{c_1} \end{equation}
Now, the right side is constant, and the left is not. So the only way this can be true is if the right side is identically zero.
Linear Shifts Consider the case where you are given initial conditions:
\begin{equation} \begin{cases} y&rsquo;&rsquo; - y = 0 \\ y(5) = -2 \\ y&rsquo;(5) = 5 \end{cases} \end{equation}
instead of bothering to solve this, we define:
\begin{equation} Y(t) = y(t+5) \end{equation}
and it still hold that:
\begin{equation} Y&rsquo;&rsquo; - Y = 0 \end{equation}
because the derivatives don&rsquo;t actually change.
Then, after solving, we can just translate it back:
\begin{equation} y(t) = Y(t-5) \end{equation}
Solution, more generally Consider:
\begin{equation} y&rsquo;&rsquo; + ay&rsquo; + by = 0 \end{equation}
let us guess that \(y = e^{\lambda t}\)
recall that, in that case:
\begin{equation} \begin{cases} y&rsquo; = \lambda e^{\lambda t} \\ y&rsquo;&rsquo; = \lambda^{2} e^{\lambda t} \end{cases} \end{equation}
plugging this back in:
\begin{equation} \lambda^{2} e^{\lambda t} + a \lambda e^{\lambda t} + b e^{\lambda t} = 0 \end{equation}
which is:
\begin{equation} (\lambda^{2} + a\lambda +b ) e^{\lambda t} = 0 \end{equation}
because the right side is never zero, we need the left side \((\lambda^{2} + a\lambda +b )\) is zero.
Note that there exists three separate cases:
\(a^{2}-4b &gt; 0\), two exact solutions: \(e^{\lambda_{1}t}\) and \(e^{\lambda_{2} t}\), these two are independent functions as long as \(\lambda_{1} \neq \lambda_{2}\) \(a^{2}-4b &lt; 0\), which will yield imaginary solutions, recall Euler&rsquo;s Equation, you can split \(e^{ikx}\) into a superposition of \(\cos (x) + i\sin (x)\), each of which individually is a solution. You can break this up into the case of some real \(e^{-at}\) multiplied by sinusoldial functions.&mdash; whereby \(e^{at} (\cos(bt) \pm i\sin(bt))\), we can break into two functions \(y_1 = e^{at}\cos (bt), y_2= e^{at}i \sin (bt)\). for \(a^{2}-4b = 0\), we yield some solution \(e^{-\frac{a}{2} t}\), and the solution is \(t e^{-\frac{a}{2}t}\). because this is the limit of the first solution \(\lim_{\lambda_{2} \to \lambda_{1}}\frac{e^{\lambda_{2}t} - e^{\lambda_{1}t}}{\lambda_{2} - \lambda_{2}}\) All 2nd order solution is a linear combination
In fact, all solutions carry the form of the two solutions:
\begin{equation} c_1 y_1(t) + c_2 y_2(t) = y(t) \end{equation}
This is because, consider the initial form \(y_1(t_0)\), and \(y_2(t_0)\):
\begin{equation} \begin{cases} y_1(t_0) c_1 + y_2(t_0) c_2 = y(t_0) \\ y_1&rsquo;(t_0) c_1 + y_2&rsquo;(t_0) c_2 = y&rsquo;(t_0) \\ \end{cases} \end{equation}
This is the same as the matrix equation:
\begin{equation} \mqty(y_1(t_0) &amp; y_2(t_0) \\ y_1&rsquo;(t_0) &amp; y_2&rsquo;(t_0)) \mqty(c_1 \\ c_2) = \mqty(y(t_0) \\ y&rsquo;(t_0)) \end{equation}
So, this map is surjective.
Uniqueness and Existance of second order The uniqueness is also guaranteed with one and exactly one solution exist for every initial condition of an IVP. Unlike first order ODE, solutions can cross: because the uniq and exi. is only guaranteed for the same point AND slope (i.e. the initial condition).
So solutions can cross, they just can&rsquo;t be tangent.
method of undetermined coefficients Ok. This mechanism hinges upon the fact that linear combinations of differential equation solutions are solutions themselves. You can show this to yourself by illustrating diffeq solutions as subspaces of F^S, which are linear objects.
Therefore, for a non-homogeneous second-order linear equation, we attempt to find two sets of solutions&mdash;
namely, the general solution to the homogeneous case (using method above):
\begin{equation} a\dv[2]{x}{t} + b \dv{x}{t} + cx = 0 \end{equation}
as well attempting to fit particular solutions to the general case:
\begin{equation} a\dv[2]{x}{t} + b \dv{x}{t} + cx = f(t) \end{equation}
the linear combination of both solutions would construct the final solution space.
We already know how to do step 1&mdash;solve homogeneous higher-order differential equations&mdash;so we won&rsquo;t harp on it here. However, how do we find particular solutions to the general equations?
Well, we guess! Here&rsquo;s a general table to help illustrate how:
\(f(t)\) \(x(t)\) \(ae^{bt}\) \(Ae^{bt}\) \(a \cos (ct) + b\sin (ct)\) \(A\cos(ct) + B\sin (ct)\) \(kt^{n}\) \(A_{n}t^{n} + A_{n-1}x^{n-1} \dots + A_{0}\) you can show these to yourself by taking derivatives. \(a,b,c, k,A,B\) are distinct constants.
Now, once you make an educated guess for what \(x(t)\) is, perhaps aided by the homogeneous solution, you would take the number of derivatives needed to plug it back to the original expression. Then, equate the left expression and right \(f(t)\) and match coefficients of equal-degree terms to solve for the final constants \(A\), \(B\), etc.
After you finally got the specific solution for \(A\) and \(B\) , we add the degree of freedom back by adding the homogenous solution in.
Look for &ldquo;Example 1 (again)&rdquo; on this page (silly, I know, but worth it) to see end-to-end such a solution.
