owned this note
owned this note
Published
Linked with GitHub
# Lecture Notes on Second Order ODE
$$\newcommand{\R}{\mathbb{R}}$$
$$\newcommand{\Ci}{C^\infty(\R)}$$
### General Solution and IVP
A *second order homogeneous ODE* is an equation of the form:
$$ ay''(t)+by'(t)+cy(t)=0$$
where $y(t)$ is an unknown twice differentiable function from $\R$ to $\R$ and $a\neq 0, b, c$ are real constants. In this course, for simplicity we will further look for solutions which are infinitely differentiable.
We will be interested in answering two kinds of questions about such an equation:
1. What is the *general solution*, i.e., the set of all $y$ satisfying the equation?
2. The *initial value problem*, i.e., find a specific solution satisfying some initial conditions $y(0)=Y_0, y'(0)=Y_1$. As discussed in Lecture 23, the physical meaning of this problem is to predict the motion of a spring-mass system given its initial position and velocity.
The connection to linear algebra is very helpful in getting a grip on both of these problems (as well as a good way to exercise your knowledge of linear algebra from earlier in the course). The setup is to consider $C^\infty(\R)$, the real **vector space** of all infinitely differentiable $y:\R\rightarrow \R$ (check that this is a vector space! note that equality here means equality of functions), and to define the **linear transformation** $$T:\Ci\rightarrow\Ci$$ by
$$ T(y) = ay''+by'+cy.$$
This is sometimes called a **differential operator**; the word operator is just a fancy way of saying a linear transformation from a vector space to itself. Given this setup, the general solution is just
$$ \{y\in\Ci: T(y)=0\} = Ker(T),$$
so the goal is to find a basis for this subspace. This may seem daunting since we have no idea how big the subspace is (might even be infinite dimensional...gasp). Luckily, the following very important theorem tells us that it is only two dimensional.
**Theorem.** (Existence and Uniqueness) If $T$ is a second order differential operator as above, then the linear transformation
$$ S:Ker(T)\rightarrow \R^2$$
defined by
$$ S(y) = \begin{bmatrix} y(0)\\ y'(0)\end{bmatrix}$$
is an isomorphism.
The theorem also clarifies the relationship between finding a general solution and the IVP: it says that once you know Ker(T), the IVP has *a unique* solution for every initial condition $\begin{bmatrix} Y_0\\ Y_1\end{bmatrix}.$ We didn't prove this rigorously, but it makes sense given that the initial position and velocity of a spring mass system uniquely determine its future trajectory, according to classical mechanics.
### How to find the General Solution: Auxiliary Equation
The **key observation** which reveals how to find $Ker(T)$ is the following: differential operators behave very nicely on the exponential functions $e^{rt}$, and we have the following relationship
$$ T(e^{rt})=0 \iff ar^2e^{rt}+bre^{rt}+ce^{rt}=0\iff ar^2+br+c=0,$$
where in the final step we used $e^{rt}\neq 0$ to cancel it from both sides. The upshot is that the equation on the right (called the `Auxiliary Equation') is just a good old quadratic equation, which *always* has one or two solutions $r_1,r_2$, and each solution corresponds to an exponential solution of the differential equation. There are three possibilities:
**Case 1.** ($b^2-4ac>0$, two distinct roots $r_1,r_2\in\R$). In this case $y_1(t)=e^{r_1t}$ and $y_2(t)=e^{r_2t}$ both lie in $Ker(T)$. Since they are linearly independent, they must in fact be a basis of $Ker(T)$ and we have
$$ Ker(T) = span\{e^{r_1t},e^{r_2t}\}.$$
**Case 2.** ($b^2-4ac=0$, a single real root). In this case, the quadratic equation only has a single solution $r_1\in\R$, which yields a single exponential $y_1=e^{r_1t}\in Ker(T)$. But we know this space is two dimensional, so where did the other solution go?
It turns out the answer is hidden in the quadratic equation, albeit in a more subtle way. In the case of one root, the quadratic equation has a factorization as a square:
$$ar^2+br+c = a(r-r_1)^2$$
The clever idea is to use this *same factorization* on the differential operator $T$ (see the remark below for a detailed explanation), i.e.,
$$ T = a(d/dt-r_1I)^2 = aR^2$$
where $R = d/dt-r_1I$ is a linear transformation from $\Ci$ to $\Ci$. Now we are looking for functions $y\in\Ci$ satisfiyng $$T(y) = aR(R(y))=0.$$ The exponential function $y_1$ we found already satisfies this equation since $R(y_1) = r_1e^{r_1t}-r_1e^{r_1t}=0.$, so certainly $T(y) = aR(R(y_1)) = a(R(0)) = 0$. But there is also a *second $R$* being applied to $R(y)$, so if we can find a $y_2\in \Ci$ such that $R(y_2)=e^{r_1t}$, we will have
$$T(y_2) = aR(R(y_2)) = aR(e^{r_1t}) = 0.$$
But $R(y_2)=y_2'-r_1y_2=e^{r_1t}$ is just a first order differential equation which you learned how to solve in Math 1B; the solution is $y_2=te^{r_1t}$. This is the other solution we were looking for.
In conclusion, in this case we have
$$Ker(T) = span\{e^{r_1t},te^{r_1t}\}.$$
**Case 3.** ($b^2-4ac<0$, two complex roots). In this case the quadratic equation has two distinct complex roots, $\alpha+i\beta, \alpha-i\beta$, which are complex conjugates of each other. The reasoning in the key observation above still holds provided we use *complex exponentials*. A complex exponential is a complex-valued function of type $y(t)=e^{zt}$ where $z=\alpha+i\beta$ is a complex number and $t$ is real. The complex exponential is defined via the power series
$$ e^{z} = \sum_{k\ge 0} \frac{z^k}{k!}.$$
It has the important familiar properties
(1) $\frac{d}{dt} e^{zt} = ze^{zt}$
(2) $e^{(\alpha+i\beta)t} = e^{\alpha t}e^{i\beta t}$
(3) $e^{(\alpha+i\beta)t}=e^{\alpha t} (\cos(\beta t)+i\sin(\beta t))$.
Thus, we have $T(e^{(\alpha\pm i\beta)t})=0$ but we are not done since the functions $e^{(\alpha\pm i\beta)t}$ are not real functions (we are temporarily allowing $T$ to take *complex-valued* functions as inputs here, but it works the same way). The trick is to use linearity: any sum or difference of functions in $Ker(T)$ must also lie in $Ker(T)$. Thus we have
$$ 0 = T(e^{(\alpha + i\beta)t}+^{(\alpha - i\beta)t}) = T(2e^{\alpha t}\cos(\beta t)),$$
where we used property (3) in the last step. Dividing by two, we see that $y_1(t)=e^{\alpha t}\cos(\beta t)\in Ker(T)$, and this function is real. By the same argument, except subtracting the two solutions and dividing by $2i$, we find that $y_2 = e^{\alpha t}\sin(\beta t)\in Ker(T)$. We conclude that
$$Ker(T) = span\{e^{\alpha t}\cos(\beta t),e^{\alpha t}\sin(\beta t)\}.$$
**Remark.** The three cases above have very concrete physical interpretations in the case of the spring mass system discussed in class. Case $1$ corresponds to an "overdamped" system where there is no oscillation, only exponential growth or decay. Case $3$ is an "underdamped" system which oscillates. Case $2$ is the critical case between: any change in the mass, damping, or stiffness leads to one of the other cases. You can try different parameters in the spring simulator https://www.myphysicslab.com/springs/single-spring-en.html
**Remark.** (Operator Algebra) Sometimes it is helpful to write $T$ as
$$ T = a(d^2/dt^2) + b(d/dt)+cI$$
where $d/dt:\Ci\rightarrow\Ci$ is the differentiation operator and $I:\Ci\rightarrow\Ci$ is the identity operator. The advantage of this notation is that it allows you to talk about sums and products (compositions) of operators, just as we did with matrices. For example, in this notation you can write
$$ d^2/dt^2 - I = (d/dt)(d/dt) -(d/dt)I + I(d/dt) + I = (d/dt+I)(d/dt-I),$$
where the two terms in the middle cancelled since $(d/dt)I=I(d/dt)$.
### How to solve the IVP
This part is easy. First, you find the general solution $y(t) = c_1y_1(t)+c_2y_2(t)$, which falls into one of the three cases above. Then, you solve for $c_1,c_2$ by plugging in the initial data, which is a linear system. Specifically, you solve
$$ \begin{bmatrix} y_1(0) & y_2(0)\\ y_1'(0) & y_2'(0)\end{bmatrix} \begin{bmatrix} c_1\\ c_2\end{bmatrix} = \begin{bmatrix} Y_0\\ Y_1\end{bmatrix}.$$
This is guaranteed to be consistent because the columns of the above matrix are simply $S(y_1)$ and $S(y_2)$, $S$ is an isomorphism by the existence and uniqueness theorem, and $y_1,y_2$ are linearly indpendent in $Ker(T)$.