# Mathematical Methods in Physics/Introduction to 2nd order differential equations

 Resource type: this resource contains a lecture or lecture notes.
 Completion status: this resource is ~75% complete.

## Introduction

What are differential equations? Why are they so important in physics? The answer to these questions will become more apparent as the course goes on, but to provide motivation, for now we will say that a differential equation is an equation where derivatives of a function appear (we will provide a more formal definition in the following section), and from which we'd like to know what this function is. Finding a function such that the differential equation is satisfied is known as finding a solution to the differential equation.

Why should physical scientists study differential equations? The answer to this question is rather easy if the student has taken any more or less advanced physics course. It will become apparent to them that the basic laws of nature can be expressed in the language of differential equations, both ordinary as well as partial differential equations.

As canonical examples, we consider the equation of the harmonic oscillator (ordinary),

${\displaystyle {\frac {d^{2}x}{dt^{2}}}=-\omega ^{2}x}$

the wave equation (partial),

${\displaystyle {\frac {\partial ^{2}u}{\partial t^{2}}}=c^{2}\left({\frac {\partial ^{2}u}{\partial x^{2}}}+{\frac {\partial ^{2}u}{\partial y^{2}}}+{\frac {\partial ^{2}u}{\partial z^{2}}}\right)}$

the equation of an RLC circuit (ordinary),

${\displaystyle L{\frac {d^{2}I}{dt^{2}}}+R{\frac {dI}{dt}}+{\frac {I}{C}}={\frac {dV}{dt}}}$

and finally, Laguerre's equation (ordinary),

${\displaystyle x{\frac {d^{2}y}{dx^{2}}}+(1-x){\frac {dy}{dx}}+ny=0}$

an equation that shows up in quantum mechanics.

There are many alternative notations for the derivative; we may use primes (Lagrange's notation) (${\displaystyle y'}$, ${\displaystyle y''}$, etc.), numbers enclosed within parentheses (${\displaystyle y^{(1)}}$, ${\displaystyle y^{(5)}}$, etc.), Leibniz's notation (${\displaystyle {\frac {d^{3}y}{dx^{3}}}}$), or Newton's dot notation, when we discuss derivatives with respect to time (${\displaystyle {\frac {dx}{dt}}={\dot {x}},{\frac {d^{2}x}{dt^{2}}}={\ddot {x}}}$). In what follows, we will try to use consistent notation, but the reader should be aware that notation is mostly a matter of preference and one notation is as good as any other.

## Basic definitions

A differential equation is an equation that relates a function with its derivative. Given a function ${\displaystyle f}$, independent variable ${\displaystyle x}$ and dependent variable ${\displaystyle y}$, an (ordinary) differential equation's most general expression is

${\displaystyle f\left(x,y,y'',\ldots ,y^{(n)}\right)=0}$

A solution to this differential equation is a function ${\displaystyle y=g(x)}$ such that

${\displaystyle f\left(x,g(x),g''(x),\ldots ,g^{(n)}(x)\right)=0}$

We say that a differential equation is of order ${\displaystyle n}$ if the highest derivative that appears in the differential equation is the ${\displaystyle n}$-th derivative.

An autonomous differential equation is one where there is no explicit dependence on the independent variable ${\displaystyle x}$:

${\displaystyle f\left(y,y'',\ldots ,y^{(n)}\right)=0}$

A linear ordinary differential equation only involves the dependent variable and its derivatives in a linear fashion (multiplied by a non-zero function of ${\displaystyle x}$, which may or may not be constant). For example,

${\displaystyle \cos(y')+\sin x+y=0}$
${\displaystyle e^{y}+y'^{2}+3x=0}$

are examples of nonlinear differential equations, whereas

${\displaystyle 3y''+2y-y=\cos x}$
${\displaystyle y^{(4)}-5y''+y=x^{2}}$
${\displaystyle x^{2}y''-3xy'+y=\sin x}$

are linear differential equations.

We say that a linear differential equation is homogeneous if any potential term(s) involving solely the independent variable ${\displaystyle x}$ are identically vanishing. Thus,

${\displaystyle 3y''+y'-5y=0}$

is homogeneous, whereas

${\displaystyle y'''-5y''+y'+2y=x^{2}+\cos x}$

is inhomogeneous or nonhomogeneous, due to the ${\displaystyle x^{2}+\cos x}$ term that depends solely on ${\displaystyle x}$.

It is customary, but by no means necessary, to move all the nonhomogeneous terms to the right-hand side of the differential equation; this practice is done to clearly distinguish these inhomogeneous terms as well as make some solutions method easier to implement.

## Linear ordinary differential equations

We focus now on linear ordinary differential equations, as these appear pervasively in the physical sciences, in particular those of second-order.

A linear ordinary differential equation is an equation of the form

${\displaystyle a_{n}(x)y^{(n)}+a_{n-1}(x)y^{(n-1)}+\ldots +a_{1}(x)y'+a_{0}(x)y=f(x)}$

As we have seen before, if ${\displaystyle f(x)\neq 0}$ the equation is nonhomogeneous or inhomogeneous, and if all the coefficients, that is, all the ${\displaystyle a_{i}(x)}$ factors are constant and not functions of ${\displaystyle x}$, we say that the equation is of constant coefficients.

### Linear dependence of functions

#### Vectors

From linear algebra, we intuitively know what it means for two vectors to be linearly independent. The vectors ${\displaystyle \mathbf {u} =-3\mathbf {i} +5\mathbf {j} }$ and ${\displaystyle \mathbf {v} =-6\mathbf {i} +10\mathbf {j} }$ are linearly dependent because ${\displaystyle \mathbf {u} }$ can be expressed as a linear combination of ${\displaystyle \mathbf {v} }$, or vice versa: ${\displaystyle \mathbf {v} =2\mathbf {u} }$ or equivalently, ${\displaystyle \mathbf {u} ={\frac {1}{2}}\mathbf {v} }$.

More formally, given the set of vectors ${\displaystyle S=\{\mathbf {v} _{1},\mathbf {v} _{2},\dots ,\mathbf {v} _{n}\}}$, we say that these vectors are linearly dependent if the equation

${\displaystyle a_{1}\mathbf {v} _{1}+a_{2}\mathbf {v} _{2}+\cdots +a_{k}\mathbf {v} _{k}=\mathbf {0} ,}$

has a nontrivial (nonzero) solution in the scalar coefficients ${\displaystyle a_{i}}$ (${\displaystyle a_{1}}$, ${\displaystyle a_{2}}$, etc.), that is to say, that at least one of the coefficients doesn't vanish, and where ${\displaystyle k\leq n}$. If, for example, ${\displaystyle a_{1}\neq 0}$, then

${\displaystyle \mathbf {v} _{1}=-{\frac {a_{2}}{a_{1}}}\mathbf {v} _{2}-\cdots -{\frac {a_{k}}{a_{1}}}\mathbf {v} _{k},}$

and we can see that ${\displaystyle \mathbf {v} _{1}}$ is a linear combination of the rest of the vectors.

This means that the vectors of the set ${\displaystyle S=\{\mathbf {v} _{1},\mathbf {v} _{2},\dots ,\mathbf {v} _{n}\}}$ are linearly independent if the equation

${\displaystyle a_{1}\mathbf {v} _{1}+a_{2}\mathbf {v} _{2}+\cdots +a_{n}\mathbf {v} _{n}=\mathbf {0} ,}$

can only be satisfied if the scalar coefficients ${\displaystyle a_{i}}$ are all ${\displaystyle 0}$.

#### Functions

We can now extend our definition of linear independence to functions.

We say that the functions ${\displaystyle g_{1}(x)}$, ${\displaystyle g_{2}(x),\ldots ,g_{n}(x)}$ are linearly independent in an interval ${\displaystyle I}$ if the equation

${\displaystyle a_{1}g_{1}(x)+a_{2}g_{2}(x)+\cdots +a_{n}g_{n}(x)=0}$

can only be satisfied if all the coefficients ${\displaystyle a_{i}}$ are vanishing, for all ${\displaystyle x}$ in the interval ${\displaystyle I}$. If the equation can be satisfied without all the coefficients being ${\displaystyle 0}$, as before, we say that the functions are linearly dependent.

We now define the Wronskian of the ${\displaystyle n-1}$ times differentiable functions ${\displaystyle g_{1}(x)}$, ${\displaystyle g_{2}(x),\ldots ,g_{n}(x)}$:

${\displaystyle W(x)={\begin{vmatrix}g_{1}(x)&g_{2}(x)&\cdots &g_{n}(x)\\g'_{1}(x)&g'_{2}(x)&\cdots &g'_{n}(x)\\g''_{1}(x)&g''_{2}(x)&\cdots &g''_{n}(x)\\\vdots &\vdots &\ddots &\vdots \\g_{1}^{(n-1)}(x)&g_{2}^{(n-1)}(x)&\cdots &g_{n}^{(n-1)}(x)\\\end{vmatrix}}}$

This functional determinant is important to study the linear independence of a given set of functions. We will make this more explicit in the next section.

### Theorems for linear differential equations

#### Principle of superposition

If ${\displaystyle y_{1}}$ and ${\displaystyle y_{2}}$ are two solutions of a linear homogeneous ordinary differential equation, then so is ${\displaystyle ay_{1}+by_{2}}$, where ${\displaystyle a}$ and ${\displaystyle b}$ are any two real numbers.

#### A theorem for complex solutions

If ${\displaystyle y(x)=u(x)+iv(x)}$ is the complex solution to a linear homogeneous differential equation with continuous coefficients, then ${\displaystyle u(x)}$ and ${\displaystyle v(x)}$ are also solutions to the differential equation.

#### Number of general solutions for linear homogeneous differential equation

The maximum number of linearly independent solutions to a linear homogeneous differential equation is equal to its order.

#### Linear independence and the Wronskian

We now make use of the Wronskian determinant (defined earlier) to give a sufficient, but not necessary, condition of linear independence of the ${\displaystyle n-1}$ times differentiable functions ${\displaystyle g_{1}(x)}$, ${\displaystyle g_{2}(x),\ldots ,g_{n}(x)}$.

If the Wronskian of the ${\displaystyle n-1}$ times differentiable functions ${\displaystyle g_{1}(x)}$, ${\displaystyle g_{2}(x),\ldots ,g_{n}(x)}$ does not vanish over an open interval ${\displaystyle I}$, then the functions are linearly independent. That is,
${\displaystyle W\neq 0\Rightarrow {\text{linearly independent functions}}}$

It is important to note that this is a sufficient but not necessary condition. It is not true that if the Wronskian does vanish, then the functions are linearly dependent.

For example, the functions ${\displaystyle x}$, ${\displaystyle x^{2}}$ and ${\displaystyle x^{3}}$ are linearly independent in any closed interval of the reals, as their Wronskian doesn't vanish identically (for all ${\displaystyle x}$) in any such closed interval.

However, if we consider the functions ${\displaystyle |x^{3}|}$ and ${\displaystyle x^{3}}$ on the interval ${\displaystyle I=(-1,1)}$, we can see that ${\displaystyle W=0}$ for all ${\displaystyle x}$ in the interval ${\displaystyle I}$. But these functions are not linearly dependent on the whole interval ${\displaystyle I}$.

If we solve for the ${\displaystyle n}$-th derivative in a linear differential equation, we have

${\displaystyle y^{(n)}=-p_{1}(x)y^{(n-1)}(x)-\ldots -p_{n-1}(x)y'(x)-p_{n}(x)y(x)}$

The following equality then holds:

${\displaystyle W(x)=W(x_{0})e^{\displaystyle -\int _{x_{0}}^{x}p_{1}(t)dt}}$

where ${\displaystyle x_{0}}$ is any point belonging to any closed interval ${\displaystyle [a,b]}$ where the coefficients of the differential equation are continuous.

### Second-order ordinary linear differential equations

We now turn to arguably the most important topic of this part of the course.

A second-order ordinary linear differential equation is an equation of the form

${\displaystyle a_{2}(x)y''(x)+a_{1}(x)y'(x)+a_{0}(x)y(x)=f(x)}$

Why are these equations so important in the physical sciences? There are at least three reasons.

First of all, in many occasions, Newton's second law, when applied to a specific system, yields such an equation. Canonical examples of this include the damped and driven oscillator:

${\displaystyle {\frac {d^{2}x}{dt^{2}}}+2\zeta \omega _{0}{\frac {dx}{dt}}+\omega _{0}^{2}x={\frac {F(t)}{m}},}$

and a particle under uniform gravitational acceleration,

${\displaystyle {\frac {d^{2}x}{dt^{2}}}=-g.}$

Secondly, when applying certain methods of solution to linear partial differential equations, we obtain as intermediate steps these sorts of second-order linear ordinary differential equations. An example is the aforementioned Laguerre equation. Another example is the Cauchy-Euler equation,

${\displaystyle a_{n}x^{n}y^{(n)}(x)+a_{n-1}x^{n-1}y^{(n-1)}(x)+\cdots +a_{0}y(x)=0}$

where all the ${\displaystyle a_{i}}$ terms are constants.

Lastly, the importance of linear equations lies in the fact that, most of the time, a nonlinear equation can be approximated by a linear one in the vicinity of a specific point (called the equilibrium point). For example, the equation that governs the dynamics of a pendulum can be written as

${\displaystyle {\frac {d^{2}\theta }{dt^{2}}}+{\frac {g}{\ell }}\sin \theta =0}$

If ${\displaystyle \theta =0}$ is taken as the equilibrium point, we expand ${\displaystyle \sin \theta }$ using its Taylor series

${\displaystyle \sin \theta =\theta -{\frac {\theta ^{3}}{3!}}+\cdots }$

and if all terms except the first one are considered negligible (${\displaystyle \theta \ll 1}$), then the equation of the pendulum is now

${\displaystyle {\frac {d^{2}\theta }{dt^{2}}}+{\frac {g}{\ell }}\theta =0}$

and the equation is now linear. It should be noted that, thus, the solution obtained from this linear equation will only be valid under the hypothesis the linearization was done in the first place, namely ${\displaystyle \theta \ll 1}$.