Differential equations contain derivatives and therefore describe rates of change.
They appear frequently in engineering, physics, biology, and economics.
Solving a differential equation involves integration.
The order of a differential equation is the highest derivative present.
The degree is the power of the highest derivative, provided the equation is polynomial in derivatives.
Examples
\[
\begin{aligned}
\frac{dy}{dx} &= 5x + 6
\quad\text{has order 1 and is 1st degree} \\[10pt]
\frac{d^{2}y}{dx^{2}} - \frac{dy}{dx} + 9 &= 0
\quad\text{has order 2 and is 1st degree} \\[10pt]
\frac{d^{3}y}{dx^{3}} &= 78xe^{8}
\quad\text{has order 3 and is 1st degree} \\[14pt]
\left(\frac{dy}{dx}\right)^{2} &= 5x + 6
\quad\text{has order 1 and is 2nd degree} \\[10pt]
\left(\frac{d^{2}y}{dx^{2}}\right)^{7} - \left(\frac{dy}{dx}\right)^{20} + 9 &= 0
\quad\text{has order 2 and is 7th degree} \\[10pt]
\left(\frac{d^{3}y}{dx^{3}}\right)^{2} &= 78xe^{8}
\quad\text{has order 3 and is 2nd degree}
\end{aligned}
\]
First Order Differential Equations
The general solution of differential equations of the form \( \frac{dy}{dx} = f(x) \)
can be found using direct integration.
\[
\frac{dy}{dx} = f(x)
\]
\[
y = \int f(x)\,dx + C
\]
Example
\[
\frac{dy}{dx} = 3x^2
\]
\[
\begin{aligned}
y &= \int 3x^2\,dx \\
\\
&= x^3 + C
\end{aligned}
\]
\[
\begin{aligned}
\text{The general solution is } &\quad y = x^{3} + C \\[8pt]
\text{A particular solution is } &\quad y = x^{3} + 8
\end{aligned}
\]
Example
Find the particular solution of the
differential equation
\[
\frac{dy}{dx} = 4x - 2
\]
Given \(y=5\) when \(x=3\).
\[
\begin{aligned}
\frac{dy}{dx} &= 4x - 2 \\[6pt]
\Rightarrow\ dy &= (4x - 2)\,dx \\[6pt]
\Rightarrow \int dy &= \int (4x - 2)\,dx \\[6pt]
\Rightarrow y &= 2x^{2} - 2x + C \\[10pt]
y &= 2x^{2} - 2x + C \;\text{is the general solution}
\end{aligned}
\]
\[
\begin{aligned}
\text{When } y &= 5,\ x = 3 \\[6pt]
5 &= 2\cdot 3^{2} - 2\cdot 3 + C \\[6pt]
5 &= 18 - 6 + C \\[6pt]
5 - 12 &= C \\[6pt]
C &= -7 \\[10pt]
\text{The particular solution for the given initial conditions is }
&\quad y = 2x^{2} - 2x - 7
\end{aligned}
\]
Example
A straight line with gradient \(2\) passes through \((1,3)\).
Find the equation of the line.
\[
\begin{aligned}
\frac{dy}{dx} &= 2 \\
y &= 2x + C \\
3 &= 2(1) + C \\
C &= 1
\end{aligned}
\]
\[
y = 2x + 1
\]
A variables separable differential equation is one in which all terms involving \(y\) can be placed on one side, and all terms involving \(x\) on the other.
\[
\begin{aligned}
\frac{dy}{dx} &= f(y) \\[8pt]
\Rightarrow\ \frac{dy}{f(y)} &= dx \\[12pt]
\Rightarrow\ \int \frac{dy}{f(y)} &= \int dx
\end{aligned}
\]
\[
\begin{aligned}
\frac{dy}{dx} &= f(x)\,g(y) \\[10pt]
\Rightarrow\ \frac{dy}{g(y)} &= f(x)\,dx \\[14pt]
\Rightarrow\ \int \frac{dy}{g(y)} &= \int f(x)\,dx
\end{aligned}
\]
Example
Find the general solution of the differential equation \( y\frac{dy}{dx} = x \)
\[
\begin{aligned}
y\,\frac{dy}{dx} &= x \\[8pt]
\Rightarrow\ y\,dy &= x\,dx \\[12pt]
\Rightarrow\ \int y\,dy &= \int x\,dx \\[12pt]
\frac{y^{2}}{2} &= \frac{x^{2}}{2} + c \qquad\text{let } C = 2c \\[10pt]
y^{2} &= x^{2} + C
\end{aligned}
\]
Example
Find the general solution of the differential equation \( x\frac{dy}{dx} = y \)
\[
\begin{aligned}
x\,\frac{dy}{dx} &= y \\[8pt]
\Rightarrow\ x\,dy &= y\,dx \\[10pt]
\Rightarrow\ \frac{dy}{y} &= \frac{dx}{x} \\[14pt]
\Rightarrow\ \int \frac{dy}{y} = \int \frac{dx}{x} \\[14pt]
\ln|y| &= \ln|x| + c \\[10pt]
\ln|y| &= \ln|x| + \ln k \quad\text{where } c=\ln k \\[10pt]
y &= kx
\end{aligned}
\]
Example
Find the particular solution of the differential equation
\[
x \frac{dy}{dx} = y( y +1)
\]
Given \(y=2\) when \(x=1\).
\[
\begin{aligned}
x\,\frac{dy}{dx} &= y(y+1) \\[8pt]
\Rightarrow\ x\,dy &= y(y+1)\,dx \\[10pt]
\Rightarrow\ \frac{dy}{y(y+1)} &= \frac{dx}{x} \\[14pt]
\Rightarrow\ \int \frac{dy}{y(y+1)} = \int \frac{dx}{x}
\end{aligned}
\]
Partial fractions are required to break the left hand side of the equation into a form which can be integrated.
\[
\begin{aligned}
1 &\equiv A(y+1) + By \\[10pt]
\text{let } y=0:\quad &A = 1 \\[6pt]
\text{let } y=-1:\quad &B = -1 \\[14pt]
\int \frac{dy}{y(y+1)}
&= \int \left( \frac{1}{y} - \frac{1}{y+1} \right) dy
\end{aligned}
\]
\[
\begin{aligned}
\int \frac{dy}{y(y+1)} &= \int \frac{dx}{x} \\[14pt]
\int \frac{1}{y}\,dy \;-\; \int \frac{1}{y+1}\,dy
&= \int \frac{dx}{x} \\[14pt]
\text{so}\quad
\ln|y| - \ln|y+1| &= \ln|x| + C
\end{aligned}
\]
which integrates to general solution
\[
\begin{aligned}
\ln|y| - \ln|y+1|
&= \ln|x| + c
\qquad\text{let } c = \ln k \\[10pt]
\ln|y| - \ln|y+1|
&= \ln|x| + \ln k \\[10pt]
\ln\!\left|\frac{y}{\,y+1\,}\right|
&= \ln|kx| \\[10pt]
\left|\frac{y}{y+1}\right|
&= |kx|
\end{aligned}
\]
substitute values for particular solution
\[
\begin{aligned}
\text{when } y=2,\ x=1 \\[10pt]
\frac{2}{2+1} &= k \\[6pt]
\frac{2}{3} &= k \\[16pt]
\left|\frac{y}{\,y+1\,}\right|
&= \left|\frac{2}{3}x\right|
\end{aligned}
\]
Linear Differential Equations
These are first degree differential equations.
\[
\begin{aligned}
a_n(x)\,\frac{d^{n}y}{dx^{n}}
&\;+\;
a_{\,n-1}(x)\,\frac{d^{\,n-1}y}{dx^{\,n-1}}
\;+\;\dots+\;
a_{1}(x)\,\frac{dy}{dx}
\;+\;
a_{0}(x)\,y
\;=\;
f(x)
\end{aligned}
\]
describes a general linear differential equation of order n,
where an(x), an-1(x),etc and f(x) are given functions
of x or constants.
Louis Arbogast introduced the differential operator
D = d/dx , which simplifies the general equation to
\[
\begin{aligned}
a_n(x)\,D^{n}y
&\;+\;
a_{\,n-1}(x)\,D^{\,n-1}y
\;+\;\dots+\;
a_{1}(x)\,Dy
\;+\;
a_{0}(x)\,y
\;=\;
f(x)
\end{aligned}
\]
Or
\[
\sum_{i=0}^{n} a_i(x)\,D^{\,i}y \;=\; f(x)
\]
If \( f(x) = 0 \) , the equation is called homogeneous.
If \( f(x) \ne 0 \) , the equation is non-homogeneous
First Order Linear Differential Equations
To solve equations of the form:
\[
a(x)\,\frac{dy}{dx} \;+\; b(x)\,y \;=\; g(x)
\]
1) Express in standard form.
\[
\frac{dy}{dx} + P(x)y = Q(x)
\]
where P and Q are functions of x or constants
2) Multiply both sides by the integrating factor:
\[
\text{IF} = e^{\int P(x)\,dx}
\]
3) Write:
\[
\frac{d}{dx}\big(y\cdot \text{IF}\big) = Q(x)\cdot \text{IF}
\]
4) Integrate the right-hand side. (Use integration by parts if necessary)
5) Divide both sides by the integrating factor. This gives the general solution.
6) Apply initial conditions to find particular solutions..
Example
Find a general solution of the equation
\[
x^{2}\,\frac{dy}{dx} \;+\; 4xy \;=\; x^{3} - 1
\]
\[
\begin{aligned}
x^{2}\,\frac{dy}{dx} + 4xy &= x^{3} - 1 \\[12pt]
\frac{dy}{dx} + \frac{4xy}{x^{2}}
&= \frac{x^{3}-1}{x^{2}} \\[12pt]
\frac{dy}{dx} + \frac{4y}{x}
&= x - \frac{1}{x^{2}}
\end{aligned}
\]
\[
\text{Compare to:}
\]
\[
\frac{dy}{dx} + P(x)\,y = Q(x)
\]
\[
P(x) = \frac{4}{x}
\]
\[
\begin{aligned}
\int P(x)\,dx
&= \int \frac{4}{x}\,dx \\[10pt]
&= 4\ln|x| \\[10pt]
&= \ln|x|^{4}
\end{aligned}
\]
So
\[
\text{Integrating factor is:}
\]
\[
e^{\int P(x)\,dx}
\]
\[
e^{\int \frac{4}{x}\,dx}
= e^{4\ln|x|}
= e^{\ln|x|^{4}}
= x^{4}
\]
\[
\frac{d}{dx}\!\left(yx^{4}\right)
= x^{4}\!\left(x - \frac{1}{x^{2}}\right)
\]
\[
yx^{4}
= \int \left(x^{5} - x^{2}\right)\,dx
\]
\[
yx^{4}
= \frac{x^{6}}{6} - \frac{x^{3}}{3} + c
\]
\[
y
= \frac{x^{6}}{6x^{4}}
- \frac{x^{3}}{3x^{4}}
+ \frac{c}{x^{4}}
\]
\[
y
= \frac{x^{2}}{6}
- \frac{1}{3x}
+ \frac{c}{x^{4}}
\quad\text{is a general solution.}
\]
Example
Find a general solution of the equation
\[
\frac{dy}{dx} + \frac{3y}{x+2} = x+ 2
\]
where \(x \ne 2 \) and hence find the particular solution
given \(y=1\) when \(x=-1\).
\[
\frac{dy}{dx} + \frac{3y}{x+2} = x+2
\]
\[
P(x) = \frac{3}{x+2}
\]
\[
\int P(x)\,dx
= \int \frac{3}{x+2}\,dx
= 3\ln|x+2|
= \ln|x+2|^{3}
\]
\[
\text{Integrating Factor is:}\quad
e^{\int P(x)\,dx}
= e^{\,3\ln|x+2|}
= (x+2)^{3}
\]
\[
\therefore\
\frac{d}{dx}\!\left(y(x+2)^{3}\right)
= (x+2)^{3}(x+2)
\]
\[
y(x+2)^{3}
= \int (x+2)^{4}\,dx
\]
\[
y(x+2)^{3}
= \frac{(x+2)^{5}}{5} + c
\]
\[
y
= \frac{(x+2)^{5}}{5(x+2)^{3}}
+ \frac{c}{(x+2)^{3}}
\]
\[
y
= \frac{(x+2)^{2}}{5}
+ \frac{c}{(x+2)^{3}}
\quad\text{is a general solution.}
\]
\[
\text{When } x=-1,\; y=1
\]
\[
1
= \frac{(-1+2)^{2}}{5}
+ \frac{c}{(-1+2)^{3}}
\]
\[
1
= \frac{1}{5} + c
\]
\[
\Rightarrow\; c = \frac{4}{5}
\]
\[
\text{The particular solution is}
\]
\[
y
= \frac{(x+2)^{2}}{5}
+ \frac{4}{5(x+2)^{3}}
\]
Second Order Linear Differential Equations
To solve equations of the form
\[
a(x)\,\frac{d^{2}y}{dx^{2}}
\;+\;
b(x)\,\frac{dy}{dx}
\;+\;
c(x)\,y
= 0
\]
\[
a y'' + b y' + cy = 0
\]
1) Write down the auxiliary equation: \(am^2 + bm + c = 0\)
2) Examine the discriminant of
the auxiliary equation .
3)
For real and distinct roots \(m_1,\, m_2\), the general solution is :
\[
y = Ae^{m_1 x} + Be^{m_2 x}
\]
4)For real and equal roots , the general solution is
:
\[
y = (A + Bx)e^{mx}
\]
5)For complex conjugate roots
\(
m_1 = p + iq,\qquad m_2 = p - iq,
\)
the general solution is :
\[
y = e^{px}(A\cos qx + B\sin qx)
\]
6) Apply initial conditions.
Example
Find the general solution of the equation
\[
\frac{d^{2}y}{dx^{2}} + \frac{dy}{dx} - 12y = 0
\]
and the particular solution for which
y = 7 when x=0 and dy/dx = 7
\[
\frac{d^{2}y}{dx^{2}} + \frac{dy}{dx} - 12y = 0
\]
\[
\text{has auxiliary equation}
\]
\[
m^{2} + m - 12 = 0
\]
\[
\text{whose discriminant is}
\]
\[
1 - \left(4 \times 1 \times (-12)\right) = 49
\]
\[
\therefore\ \text{real and distinct roots exist}
\]
\[
m^{2} + m - 12 = 0
\]
\[
\Rightarrow (m+4)(m-3) = 0
\]
\[
\Rightarrow m = -4 \quad \text{or} \quad m = 3
\]
\[
\text{The general solution is}
\]
\[
y = A e^{-4x} + B e^{3x}
\]
\[
y = A e^{-4x} + B e^{3x}
\]
\[
\therefore\
\frac{dy}{dx}
= -4A e^{-4x} + 3B e^{3x}
\]
\[
\text{When } x = 0,\; \frac{dy}{dx} = 7
\]
\[
\Rightarrow\
7 = -4A e^{0} + 3B e^{0}
\]
\[
\Rightarrow\
7 = -4A + 3B
\]
\[
\text{When } x = 0,\; y = 7
\]
\[
\Rightarrow\
7 = A e^{0} + B e^{0}
\]
\[
\Rightarrow\
7 = A + B
\]
\[
\text{Solving simultaneously}
\]
\[
\qquad 7 = A + B
\]
\[
\qquad 7 = -4A + 3B
\]
\[
\Rightarrow\
7 = -4A + 3(7 - A)
\]
\[
\Rightarrow\
7 = -7A + 21
\]
\[
\Rightarrow\
A = 2
\]
\[
\Rightarrow\
B = 5
\]
\[
\text{the particular solution is}
\]
\[
y = 2e^{-4x} + 5e^{3x}
\]
Example
Find the general solution of the equation
\[
\frac{d^{2}y}{dx^{2}} -10 \frac{dy}{dx}+ 25y = 0
\]
and the particular solution for which
y = 0 and dy/dx = 3 when x=0
\[
\frac{d^{2}y}{dx^{2}} - 10\frac{dy}{dx} + 25y = 0
\]
\[
\text{has auxiliary equation}
\]
\[
m^{2} - 10m + 25 = 0
\]
\[
\text{whose discriminant is}
\]
\[
100 - \left(4 \times 1 \times 25\right) = 0
\]
\[
\therefore\ \text{real and equal roots exist}
\]
\[
m^{2} - 10m + 25 = 0
\]
\[
\Rightarrow (m - 5)(m - 5) = 0
\]
\[
\Rightarrow m = 5
\]
\[
\text{The general solution is}
\]
\[
y = A e^{5x} + Bx e^{5x}
\]
\[
y = A e^{5x} + Bx e^{5x}
\]
\[
\therefore\
\frac{dy}{dx}
= 5A e^{5x} + B e^{5x} + 5Bx e^{5x}
\]
\[
\text{When } x = 0,\; \frac{dy}{dx} = 3
\]
\[
\Rightarrow\
3 = 5A e^{0} + B e^{0}
\]
\[
\Rightarrow\
3 = 5A + B
\]
\[
\text{When } x = 0,\; y = 0
\]
\[
\Rightarrow\
0 = A e^{0}
\]
\[
\Rightarrow\
0 = A
\]
\[
\text{Solving simultaneously}
\]
\[
\qquad 0 = A
\]
\[
\qquad 3 = 5A + B
\]
\[
\Rightarrow\
3 = B
\]
\[
y = A e^{5x} + Bx e^{5x}
\]
\[
\text{Substituting } A = 0 \text{ and } B = 3
\]
\[
\text{the particular solution is}
\]
\[
y = 3x e^{5x}
\]
Example
Find the general solution of the equation
\[
\frac{d^{2}y}{dx^{2}} - 6 \frac{dy}{dx}+ 13y = 0
\]
\[
\frac{d^{2}y}{dx^{2}} - 6\frac{dy}{dx} + 13y = 0
\]
\[
\text{has auxiliary equation}
\]
\[
m^{2} - 6m + 13 = 0
\]
\[
\text{whose discriminant is}
\]
\[
36 - \left(4 \times 1 \times 13\right) = -16
\]
\[
\therefore\ \text{complex conjugate roots exist}
\]
\[
m^{2} - 6m + 13 = 0
\]
\[
\Rightarrow\
m = \frac{6 \pm 4i}{2} = 3 \pm 2i
\]
\[
\text{The general solution is}
\]
\[
y = e^{3x}\left(A\cos 2x + B\sin 2x\right)
\]
Second Order Non‑homogeneous Differential Equations
The solution to equations of the form
\[
a(x)\,\frac{d^{2}y}{dx^{2}}
\;+\;
b(x)\,\frac{dy}{dx}
\;+\;
c(x)\,y
\;=\;
Q(x)
\]
\[
a y'' + b y' + cy = Q(x)
\]
has two parts, the complementary function (CF)
and the particular integral (PI).
\[
Q(x) = \text{CF} + \text{PI}
\]
so
\[
y = \text{CF} + \text{PI}
\]
The CF is the general solution as described above
for solving homogeneous equations .
The Particular Integral is found by substituting
a form similar to Q(x) into the left hand side equation,
and equating co-efficients.
- If \(Q(x)\) is linear, try \(Cx + D\)
- If \(Q(x)\) is quadratic, try \(Cx^2 + Dx + E\)
- If \(Q(x)\) is sinusoidal, try \(C\sin x + D\cos x\)
- If \(Q(x)\) is a constant, try \(C\)
- If \(Q(x) = e^{kx}\), try \(Ce^{kx}\)
The PI cannot have the same form as any of the terms in the CF, so care has to be taken
to ensure that this is not the case.
In such a situation, an extra x term is usually
introduced to the PI.
If it does, multiply the trial function by \(x\).
A particular solution is found by substituting
initial conditions into the general solution.
Do not just use the CF!!!
Example
Find the general solution of the equation
\[ \frac{d^{2}y}{dx^{2}} - 3 \frac{dy}{dx}+ 2y = x + 1 \]
\[
\frac{d^{2}y}{dx^{2}} - 3\frac{dy}{dx} + 2y = x + 1
\]
\[
\text{has auxiliary equation}
\]
\[
m^{2} - 3m + 2 = 0
\]
\[
\text{whose discriminant is}
\]
\[
9 - (4 \times 1 \times 2) = 1
\]
\[
\therefore\ \text{real and distinct roots exist}
\]
\[
m^{2} - 3m + 2 = 0
\]
\[
\Rightarrow m = 2 \;\text{or}\; 1
\]
\[
\text{The complementary function is}
\]
\[
y = A e^{2x} + B e^{x}
\]
\[
\text{For the PI, try } y = Cx + D
\]
\[
\therefore\
\frac{dy}{dx} = C
\qquad\text{and}\qquad
\frac{d^{2}y}{dx^{2}} = 0
\]
\[
\frac{d^{2}y}{dx^{2}}
- 3\frac{dy}{dx}
+ 2y
= x + 1
\]
\[
0 - 3C + 2(Cx + D) = x + 1
\]
\[
\Rightarrow\
2Cx + 2D - 3C = x + 1
\]
\[
\text{Equating coefficients,}
\]
\[
\quad 2C = 1
\qquad\text{and}\qquad
2D - 3C = 1
\]
\[
\Rightarrow\
C = \tfrac12
\qquad\text{and}\qquad
D = \tfrac54
\]
\[
\text{The PI is }
y = \frac{x}{2} + \frac{5}{4}
\]
\[
\text{The General Solution is}
\]
\[
y = A e^{2x} + B e^{x} + \frac{x}{2} + \frac{5}{4}
\]
Example
Find the general solution of the equation
\[ \frac{d^{2}y}{dx^{2}} - 3 \frac{dy}{dx}+ 2y = x + 1 \]
and the particular solution for which
y = 0 and dy/dx = 5 when x=0
\[
\frac{d^{2}y}{dx^{2}}
- 10\frac{dy}{dx}
+ 25y
= e^{5x}
\]
\[
\text{has auxiliary equation}
\]
\[
m^{2} - 10m + 25 = 0
\]
\[
\text{whose discriminant is}
\]
\[
100 - (4 \times 1 \times 25) = 0
\]
\[
\therefore\ \text{real and equal roots exist}
\]
\[
m^{2} - 10m + 25 = 0
\]
\[
\Rightarrow (m - 5)(m - 5) = 0
\]
\[
\Rightarrow m = 5
\]
\[
\text{The complementary function is}
\]
\[
y = A e^{5x} + Bx e^{5x}
\]
\[
\text{For the PI, try } y = C e^{5x}
\]
\[
\text{This is already a term in the CF}
\]
\[
\text{try } y = Cx e^{5x}
\]
\[
\text{This is already a term in the CF}
\]
\[
\text{try } y = Cx^{2} e^{5x}
\]
\[
y = Cx^{2} e^{5x}
\]
\[
\frac{dy}{dx}
= 2Cx e^{5x} + 5C x^{2} e^{5x}
\]
\[
\frac{d^{2}y}{dx^{2}}
= 2C e^{5x}
+ 10Cx e^{5x}
+ 10Cx e^{5x}
+ 25C x^{2} e^{5x}
\]
\[
\frac{d^{2}y}{dx^{2}}
- 10\frac{dy}{dx}
+ 25y
= e^{5x}
\]
\[
2C e^{5x}
+ 20Cx e^{5x}
+ 25C x^{2} e^{5x}
- 10\bigl(2Cx e^{5x} + 5C x^{2} e^{5x}\bigr)
+ 25\bigl(C x^{2} e^{5x}\bigr)
= e^{5x}
\]
\[
2C e^{5x} = e^{5x}
\]
\[
\text{Equating coefficients,}
\]
\[
\quad 2C = 1
\]
\[
\Rightarrow\ C = \tfrac12
\]
\[
\text{PI is }
y = \tfrac12 x^{2} e^{5x}
\]
\[
\text{The General Solution is}
\]
\[
y = A e^{5x} + Bx e^{5x} + \frac{x^{2} e^{5x}}{2}
\]
\[
y = A e^{5x} + Bx e^{5x} + \frac{x^{2} e^{5x}}{2}
\]
\[
\frac{dy}{dx}
= 5A e^{5x}
+ B e^{5x}
+ 5Bx e^{5x}
+ x e^{5x}
+ \frac{5}{2} x e^{5x}
\]
\[
\text{When } x = 0,\ \frac{dy}{dx} = 5
\]
\[
5 = 5A + B
\]
\[
\text{When } x = 0,\ y = 0
\]
\[
0 = A
\]
\[
\text{Solving simultaneously}
\]
\[
A = 0
\]
\[
5 = 5A + B \quad\Rightarrow\quad B = 5
\]
\[
\text{The particular solution is}
\]
\[
y = 5x e^{5x} + \frac{x^{2} e^{5x}}{2}
\]
Phew!!