avatarDifferential equations 🔥

May 12th, 2020

(PDF Version)


When I got first introduced to differential equations, I had a love-hate relationship with it. Mainly due to some back-of-the-book problems we were given and never-ending projects we were assigned to. After some time, differential equations is a way to truly understand physics and the foundations of gravity, fields, and everything. This articles is merely an intro on manually solving common forms of differential equations. Hope you enjoy

Quick notes

First-order, linear

Those equations have the form \begin{align*} y' + p(t) y = q(t) \end{align*} Find \begin{align*} \mu(t) = e^{\int p(t) dt} \end{align*} Then \begin{align*} \frac{d}{dt}(\mu(t)y) & = q(t) \mu(t) \\ \implies y & = \frac{\int q(t) \mu(t) dt}{\mu(t)} \end{align*}

First-order, separable

Those equations have the form:

\begin{align*} \frac{dy}{dx} = f(x)g(y) \end{align*}

Find the solution by solving

\begin{align*} \int \frac{dy}{g(y)} = \int f(x) dx \end{align*}

Solve for exact (explicit) values of \(y\)

Exact equations

They have the form

\begin{align*} M(x,y) + N(x,y) \frac{dy}{dx} = 0 \end{align*}

\(\implies\) Find such \(F(x,y)=C\), where

\begin{align*} F_x = M, \quad F_y = N \end{align*}

\begin{align*} \frac{M_y-N_x}{N} \text{ only depends on } x \text{ or } \frac{N_x-M_y}{M} \text{ only depends on } y \end{align*}


\begin{align*} \mu(x) = e^{\int \frac{M_y-N_x}{N} dx} \quad\text{or}\quad \mu(y) = e^{\int \frac{N_x-M_y}{M} dy} \end{align*}

multiply both by \(M\) and \(N\), so the condition \(M_y = N_y\) is satisfied. Go to \((\xi)\) and proceed with finding \(F(x,y)\)

Second-order, linear, constant-coefficient equations

They have the form

\begin{align*} y” + p y' + q y = f(t) \end{align*}

Make a characteristic polynomial, let \(y = e^{rt}\):


Find roots, solution (general) will be

\begin{align*} y = c_1 e^{r_1 t} + c_2 e^{r_2 t} \end{align*}

Solving for particular solution \(y_p(t)\)

Undetermined coefficients (superpositioned) for \(f(t)\)

Whatever is in \(f(t)\), start adding up the corresponding coefficients into \(y_p(t)\)

should not be linearly dependent with the general solution. If it is, multiply by \(t\) until it is linearly independent.

Variation of parameters

Seek \(y_p(t) = v_1(t)y_1(t)+v_2(t)y_2(t)\), where

\begin{align*} \begin{cases}v_1'y_1+v_2'y_2=0\\v_1'y_1'+v_2'y_2'=f(t)\end{cases} \end{align*}

So the final solution is \(y(t)=c_1 y_1(t) + c_2 y_2(t) + y_p(t)\)

Second-order, linear, variable-coefficient equations

Equations have the form

In general case, guess the first homogeneous solution (try \(y_1=e^t\)) and use reduction of order to find the second homogeneous solution, so that \begin{align*} & y_2(t) = v(t)y_1(t) \\ & \implies y_2” + p(t)y_2' + q(t)y_2 = 0 \\ & \implies (v(t)y_1(t))”+p(t)(v(t)y_1(t))'+q(t)(v(t)y_1(t)) = 0 \\ \end{align*}

Also applicable with form \((1)\)

You will probably have another differential equation emerge from above. It should have lower order than our current equation, so just refer to one of the techniques above to find \(v(t)\) and then you can find \(y_2(t)=v(t)y_1(t)\)

Use variation of parameters to find a particular solution. It’s that system with \(v\)

What you if you have a Cauchy-Euler equation?

They have the form \(at^2y”+bty'+cy=0\)

then \(y=t^r \implies ar^2+(b-a)r+c=0\)

Generally, solution has the form \(y=c_1t^{r_1}+c_2t^{r_2}\)

Higher-order, linear equations

\begin{align*} a_n(t)y^{(n)}+a_{n-1}(t)y^{(n-1)}+\ldots+a_1(t)y'+a_0(t)y=g(t) \end{align*} All second-order methods above extend to \(n^{th}\) order.

Laplace transform

Laplace is a holy grail of solving differential equations with initial values defined. Laplace is the same kind of Bible to engineers like Taylor Series is. \begin{align*} \mathcal{L}\{f\}(s) = \int_0^{\infty} e^{-st} f(t) dt \end{align*} assuming \(f\) is piecewise continuous and of exponential order.

Table of common Laplace transformations
\(f(t)\) \(\mathcal{L}\{f\}(s)\)
\(1\) \(\frac{1}{s}\)
\(e^{at}\) \(\frac{1}{s-a}\)
\(\sin(bt)\) \(\frac{b}{s^2+b^2}\)
\(\cos(bt)\) \(\frac{s}{s^2+b^2}\)
\(u(t-a)\) \(\frac{e^{-as}}{s}\)
\(\delta(t-a)\) \(e^{-as}\)

Where \(u(t)\) is the Heaviside step function and \(\delta(t)\) is the Dirac delta function.

Some Laplace transform properties:

If \(f\) is a T-periodic function, \begin{align*} \mathcal{L}\{f(t)\}(s) = \frac{\int_0^T e^{-sT} f(t) dt}{1-e^{-sT}} \end{align*} where \(\int_0^T e^{-sT} f(t) dt = \mathcal{L}\{f_T(t)\}(s)\), the sum of integrals of different parts of the piecewise function.


Heaviside/unit step function:

If IVP is not at 0, define some new function like \(w(t)=y(t+\alpha)\), and solve for \(w\). Finally, you can offset to find \(y\)

Step (block) function: \begin{align*} \Pi_{a,b}(t) = u(t-a)-u(t-b) \end{align*} so \begin{align*} \mathcal{L}\{\Pi_{a,b}(t)\}(s)=\frac{e^{-sa}-e^{-sb}}{s} \end{align*}

Constant-coefficient, homogeneous systems of ODE

\begin{align*} \vec{x}' = A \vec{x}, \quad \text{where } A\in\mathbb{R}^{n\times n},\quad x\in\mathbb{R}^n \end{align*}

If \(A\) has n linearly independent eigenvectors \(\vec{u_i}\) associated to n eigenvalues \(\lambda_i\), then a general solution of the system is given by \(\vec{x}(t) = c_1 e^{\lambda_1 t}\vec{u_1}+c_2e^{\lambda_2t}\vec{u_2} + \ldots + c_ne^{\lambda_nt}\vec{u_n}\)

\(e^{At} = \sum_{k=0}^{\infty} \frac{A^k t^k}{k!}\), where \(A^0=I\), an identity matrix.

\begin{align*} p(\lambda)=det(A-\lambda I) \end{align*}

\begin{align*} p(\lambda) = c(\lambda-\lambda_1)^{m_1} \cdot \ldots \cdot (\lambda-\lambda_k)^{m_k},\quad c=\pm 1 \end{align*}

\begin{align*} (A-\lambda_i I)^{m_j} \vec{u} = \vec{0} \end{align*}

\begin{align*} e^{At}\vec{u_j}^i & =e^{\lambda_jt}e^{(A-\lambda_jI)t}\vec{u_j}^i \\ & =e^{\lambda_jt}(\vec{u_j}^i+t(A-\lambda_jI)\vec{u_j}^i+\cdots+\frac{t^{m_j-1}}{(m_j-1)!}(A-\lambda_jI)^{m_j-1}\vec{u_j}^i) \end{align*}

Linear systems of ODE

\begin{align*} \vec{x}' = A(t)\vec{x} + \vec{f}(t), \quad \text{where } A\in\mathbb{R}^{n\times n}, x\in\mathbb{R}^n, \quad f\in\mathbb{R}^n \end{align*}

If \(X(t)\) is a matrix whose columns are made up of n linearly independent homogeneous solutions (\(X(t)\) is the fundamental matrix), then a general solution may be written as \(\vec{x}(t_0)=\vec{x_0}\)

\begin{align*} \vec{x}(t) = X(t)X^{-1}(t_0)\vec{x_0}+X(t)\int_{t_0}^{t}X^{-1}(s)f(s)ds \end{align*}

If \(A(t)\) is constant-coefficient, then we recover Duhamel’s formula:

\begin{align*} \vec{x}(t) = e^{A(t-t_0)}x_0 + \int_{t_0}^{t}e^{A(t-s)}f(s)ds \end{align*}


There are many applications of differential equations in classical mechanics, fields, etc. Below you will find just a snippet of some very common Physics 1/2 scenarios

Falling object

\begin{align*} m\frac{dv}{dt}=mg-bv \end{align*}

where \(b\) is the air resistance

Fluid mix, define \(R_{in}\) and \(R_{out}\)

\begin{align*} \frac{dx}{dt}=R_{in}-R_{out} \end{align*}

Mass-Spring System


This is as much as I can recover from my initial experience with differential equations. This article is not as much to teach you how to solve them but provide a quick lookup cheatsheet if needed or glance at different forms that we can actually solve! There are infinitely many differential equations that we cannot find an exact solution for! ◼︎