A differential equation (DE) is an equation involving derivatives of an unknown function. A first order DE involves only the first derivative. A DE is ordinary (ODE) if all derivatives are with respect to a single variable.
The order of a DE is the highest derivative that appears. The general solution of an n n n -th order DE contains n n n arbitrary constants. A particular solution is obtained by imposing Initial or boundary conditions.
A first order ODE is separable if it can be written in the form:
d y d x = f ( x ) ⋅ g ( y ) \frac{dy}{dx} = f(x) \cdot g(y) d x d y = f ( x ) ⋅ g ( y ) Equivalently:
d y g ( y ) = f ( x ) d x \frac{dy}{g(y)} = f(x)\,dx g ( y ) d y = f ( x ) d x Integrate both sides:
∫ 1 g ( y ) d y = ∫ f ( x ) d x \int \frac{1}{g(y)}\,dy = \int f(x)\,dx ∫ g ( y ) 1 d y = ∫ f ( x ) d x Example. Solve d y d x = x y \dfrac{dy}{dx} = \dfrac{x}{y} d x d y = y x with y ( 0 ) = 2 y(0) = 2 y ( 0 ) = 2 .
Separate: y d y = x d x y\,dy = x\,dx y d y = x d x .
∫ y d y = ∫ x d x ⟹ y 2 2 = x 2 2 + C \int y\,dy = \int x\,dx \implies \frac{y^2}{2} = \frac{x^2}{2} + C ∫ y d y = ∫ x d x ⟹ 2 y 2 = 2 x 2 + C Apply y ( 0 ) = 2 y(0) = 2 y ( 0 ) = 2 : 4 2 = 0 + C ⟹ C = 2 \dfrac{4}{2} = 0 + C \implies C = 2 2 4 = 0 + C ⟹ C = 2 .
y 2 = x 2 + 4 ⟹ y = x 2 + 4 y^2 = x^2 + 4 \implies y = \sqrt{x^2 + 4} y 2 = x 2 + 4 ⟹ y = x 2 + 4 (We take the positive root since y ( 0 ) = 2 > 0 y(0) = 2 \gt 0 y ( 0 ) = 2 > 0 .)
Example. Solve d y d x = x y \dfrac{dy}{dx} = xy d x d y = x y .
d y y = x d x ⟹ ln ∣ y ∣ = x 2 2 + C ⟹ y = A e x 2 / 2 \frac{dy}{y} = x\,dx \implies \ln|y| = \frac{x^2}{2} + C \implies y = Ae^{x^2/2} y d y = x d x ⟹ ln ∣ y ∣ = 2 x 2 + C ⟹ y = A e x 2 /2 Where A = ± e C A = \pm e^C A = ± e C .
Example. Solve d y d x = y + 1 x \dfrac{dy}{dx} = \dfrac{y + 1}{x} d x d y = x y + 1 , x > 0 x \gt 0 x > 0 .
d y y + 1 = d x x ⟹ ln ∣ y + 1 ∣ = ln x + C ⟹ ∣ y + 1 ∣ = e C ⋅ x \frac{dy}{y + 1} = \frac{dx}{x} \implies \ln|y + 1| = \ln x + C \implies |y + 1| = e^C \cdot x y + 1 d y = x d x ⟹ ln ∣ y + 1∣ = ln x + C ⟹ ∣ y + 1∣ = e C ⋅ x y + 1 = A x ⟹ y = A x − 1 y + 1 = Ax \implies y = Ax - 1 y + 1 = A x ⟹ y = A x − 1 A first order linear ODE has the form:
d y d x + P ( x ) y = Q ( x ) \frac{dy}{dx} + P(x)\,y = Q(x) d x d y + P ( x ) y = Q ( x ) Multiply through by the integrating factor :
μ ( x ) = exp ( ∫ P ( x ) d x ) \mu(x) = \exp\!\left(\int P(x)\,dx\right) μ ( x ) = exp ( ∫ P ( x ) d x ) This transforms the equation into:
d d x [ μ ( x ) ⋅ y ] = μ ( x ) ⋅ Q ( x ) \frac{d}{dx}\bigl[\mu(x) \cdot y\bigr] = \mu(x) \cdot Q(x) d x d [ μ ( x ) ⋅ y ] = μ ( x ) ⋅ Q ( x ) Integrate both sides:
y = 1 μ ( x ) ∫ μ ( x ) ⋅ Q ( x ) d x y = \frac{1}{\mu(x)} \int \mu(x) \cdot Q(x)\,dx y = μ ( x ) 1 ∫ μ ( x ) ⋅ Q ( x ) d x Derivation. By the product rule:
d d x ( μ y ) = μ d y d x + y d μ d x \frac{d}{dx}(\mu y) = \mu\frac{dy}{dx} + y\frac{d\mu}{dx} d x d ( μ y ) = μ d x d y + y d x d μ We need d μ d x = μ P ( x ) \dfrac{d\mu}{dx} = \mu P(x) d x d μ = μ P ( x ) Which gives 1 μ d μ d x = P ( x ) \dfrac{1}{\mu}\dfrac{d\mu}{dx} = P(x) μ 1 d x d μ = P ( x ) Hence μ = exp ( ∫ P ( x ) d x ) \mu = \exp\!\left(\displaystyle\int P(x)\,dx\right) μ = exp ( ∫ P ( x ) d x ) .
Example. Solve d y d x + y x = x 2 \dfrac{dy}{dx} + \dfrac{y}{x} = x^2 d x d y + x y = x 2 , x > 0 x \gt 0 x > 0 .
Here P ( x ) = 1 x P(x) = \dfrac{1}{x} P ( x ) = x 1 So:
μ ( x ) = exp ( ∫ 1 x d x ) = e ln x = x \mu(x) = \exp\!\left(\int \frac{1}{x}\,dx\right) = e^{\ln x} = x μ ( x ) = exp ( ∫ x 1 d x ) = e l n x = x Multiply through: x d y d x + y = x 3 x\dfrac{dy}{dx} + y = x^3 x d x d y + y = x 3 I.e. d d x ( x y ) = x 3 \dfrac{d}{dx}(xy) = x^3 d x d ( x y ) = x 3 .
x y = ∫ x 3 d x = x 4 4 + C ⟹ y = x 3 4 + C x xy = \int x^3\,dx = \frac{x^4}{4} + C \implies y = \frac{x^3}{4} + \frac{C}{x} x y = ∫ x 3 d x = 4 x 4 + C ⟹ y = 4 x 3 + x C Example. Solve d y d x + 2 y = e − x \dfrac{dy}{dx} + 2y = e^{-x} d x d y + 2 y = e − x .
μ ( x ) = e 2 x \mu(x) = e^{2x} μ ( x ) = e 2 x .
d d x ( e 2 x y ) = e 2 x ⋅ e − x = e x \frac{d}{dx}\bigl(e^{2x} y\bigr) = e^{2x} \cdot e^{-x} = e^x d x d ( e 2 x y ) = e 2 x ⋅ e − x = e x e 2 x y = e x + C ⟹ y = e − x + C e − 2 x e^{2x} y = e^x + C \implies y = e^{-x} + Ce^{-2x} e 2 x y = e x + C ⟹ y = e − x + C e − 2 x Example. Solve d y d x − 3 y = 6 \dfrac{dy}{dx} - 3y = 6 d x d y − 3 y = 6 Given y ( 0 ) = 1 y(0) = 1 y ( 0 ) = 1 .
μ ( x ) = e − 3 x \mu(x) = e^{-3x} μ ( x ) = e − 3 x .
d d x ( e − 3 x y ) = 6 e − 3 x \frac{d}{dx}\bigl(e^{-3x} y\bigr) = 6e^{-3x} d x d ( e − 3 x y ) = 6 e − 3 x e − 3 x y = − 2 e − 3 x + C ⟹ y = − 2 + C e 3 x e^{-3x} y = -2e^{-3x} + C \implies y = -2 + Ce^{3x} e − 3 x y = − 2 e − 3 x + C ⟹ y = − 2 + C e 3 x Using y ( 0 ) = 1 y(0) = 1 y ( 0 ) = 1 : 1 = − 2 + C ⟹ C = 3 1 = -2 + C \implies C = 3 1 = − 2 + C ⟹ C = 3 . Hence y = 3 e 3 x − 2 y = 3e^{3x} - 2 y = 3 e 3 x − 2 .
a d 2 y d x 2 + b d y d x + c y = 0 a\frac{d^2y}{dx^2} + b\frac{dy}{dx} + cy = 0 a d x 2 d 2 y + b d x d y + cy = 0 Where a , b , c a, b, c a , b , c are constants and a ≠ 0 a \ne 0 a = 0 .
Substitute y = e λ x y = e^{\lambda x} y = e λ x :
a λ 2 + b λ + c = 0 a\lambda^2 + b\lambda + c = 0 a λ 2 + bλ + c = 0 This quadratic in λ \lambda λ is the auxiliary (or characteristic ) equation.
Case 1: Two distinct real roots λ 1 ≠ λ 2 \lambda_1 \ne \lambda_2 λ 1 = λ 2 .
y = A e λ 1 x + B e λ 2 x y = Ae^{\lambda_1 x} + Be^{\lambda_2 x} y = A e λ 1 x + B e λ 2 x Case 2: Repeated real root λ \lambda λ .
y = ( A + B x ) e λ x y = (A + Bx)e^{\lambda x} y = ( A + B x ) e λ x Case 3: Complex conjugate roots λ = α ± i β \lambda = \alpha \pm i\beta λ = α ± i β .
y = e α x ( A cos β x + B sin β x ) y = e^{\alpha x}\bigl(A\cos\beta x + B\sin\beta x\bigr) y = e α x ( A cos β x + B sin β x ) Example. Solve y " ′ − 5 y ′ + 6 y = 0 y"' - 5y' + 6y = 0 y " ′ − 5 y ′ + 6 y = 0 .
Characteristic equation: λ 2 − 5 λ + 6 = 0 ⟹ ( λ − 2 ) ( λ − 3 ) = 0 \lambda^2 - 5\lambda + 6 = 0 \implies (\lambda - 2)(\lambda - 3) = 0 λ 2 − 5 λ + 6 = 0 ⟹ ( λ − 2 ) ( λ − 3 ) = 0 .
Roots: λ 1 = 2 \lambda_1 = 2 λ 1 = 2 , λ 2 = 3 \lambda_2 = 3 λ 2 = 3 (distinct real).
y = A e 2 x + B e 3 x y = Ae^{2x} + Be^{3x} y = A e 2 x + B e 3 x Example. Solve y ′ ′ + 4 y ′ + 4 y = 0 y'' + 4y' + 4y = 0 y ′′ + 4 y ′ + 4 y = 0 .
Characteristic equation: λ 2 + 4 λ + 4 = 0 ⟹ ( λ + 2 ) 2 = 0 \lambda^2 + 4\lambda + 4 = 0 \implies (\lambda + 2)^2 = 0 λ 2 + 4 λ + 4 = 0 ⟹ ( λ + 2 ) 2 = 0 .
Repeated root: λ = − 2 \lambda = -2 λ = − 2 .
y = ( A + B x ) e − 2 x y = (A + Bx)e^{-2x} y = ( A + B x ) e − 2 x Example. Solve y ′ ′ + 2 y ′ + 5 y = 0 y'' + 2y' + 5y = 0 y ′′ + 2 y ′ + 5 y = 0 .
Characteristic equation: λ 2 + 2 λ + 5 = 0 \lambda^2 + 2\lambda + 5 = 0 λ 2 + 2 λ + 5 = 0 .
λ = − 2 ± 4 − 20 2 = − 1 ± 2 i \lambda = \frac{-2 \pm \sqrt{4 - 20}}{2} = -1 \pm 2i λ = 2 − 2 ± 4 − 20 = − 1 ± 2 i Here α = − 1 \alpha = -1 α = − 1 , β = 2 \beta = 2 β = 2 .
y = e − x ( A cos 2 x + B sin 2 x ) y = e^{-x}(A\cos 2x + B\sin 2x) y = e − x ( A cos 2 x + B sin 2 x ) Example. Solve y ′ ′ − y = 0 y'' - y = 0 y ′′ − y = 0 with y ( 0 ) = 0 y(0) = 0 y ( 0 ) = 0 and y ′ ( 0 ) = 1 y'(0) = 1 y ′ ( 0 ) = 1 .
Characteristic equation: λ 2 − 1 = 0 ⟹ λ = ± 1 \lambda^2 - 1 = 0 \implies \lambda = \pm 1 λ 2 − 1 = 0 ⟹ λ = ± 1 .
y = A e x + B e − x , y ′ = A e x − B e − x y = Ae^x + Be^{-x}, \qquad y' = Ae^x - Be^{-x} y = A e x + B e − x , y ′ = A e x − B e − x y ( 0 ) = A + B = 0 ⟹ B = − A y(0) = A + B = 0 \implies B = -A y ( 0 ) = A + B = 0 ⟹ B = − A . y ′ ( 0 ) = A − B = 1 ⟹ 2 A = 1 ⟹ A = 1 2 y'(0) = A - B = 1 \implies 2A = 1 \implies A = \dfrac{1}{2} y ′ ( 0 ) = A − B = 1 ⟹ 2 A = 1 ⟹ A = 2 1 .
y = 1 2 e x − 1 2 e − x = sinh x y = \frac{1}{2}e^x - \frac{1}{2}e^{-x} = \sinh x y = 2 1 e x − 2 1 e − x = sinh x The DE d N d t = k N \dfrac{dN}{dt} = kN d t d N = k N has the general solution N = N 0 e k t N = N_0 e^{kt} N = N 0 e k t .
Growth: k > 0 k \gt 0 k > 0 (e.g. Population, compound interest).Decay: k < 0 k \lt 0 k < 0 (e.g. Radioactive decay, cooling).Half-life. For radioactive decay, N = N 0 e − λ t N = N_0 e^{-\lambda t} N = N 0 e − λ t where λ > 0 \lambda \gt 0 λ > 0 is the decay Constant. The half-life t 1 / 2 t_{1/2} t 1/2 satisfies:
N 0 e − λ t 1 / 2 = N 0 2 ⟹ t 1 / 2 = ln 2 λ N_0 e^{-\lambda t_{1/2}} = \frac{N_0}{2} \implies t_{1/2} = \frac{\ln 2}{\lambda} N 0 e − λ t 1/2 = 2 N 0 ⟹ t 1/2 = λ ln 2 Example. A substance has a half-life of 5 5 5 years. How long until only 10 % 10\% 10% remains?
λ = ln 2 5 \lambda = \frac{\ln 2}{5} λ = 5 ln 2 0.1 N 0 = N 0 e − λ t ⟹ − λ t = ln 0.1 ⟹ t = ln 10 ln 2 ⋅ 5 ≈ 16.6 y e a r s 0.1N_0 = N_0 e^{-\lambda t} \implies -\lambda t = \ln 0.1 \implies t = \frac{\ln 10}{\ln 2} \cdot 5 \approx 16.6\,\mathrm{years} 0.1 N 0 = N 0 e − λ t ⟹ − λ t = ln 0.1 ⟹ t = ln 2 ln 10 ⋅ 5 ≈ 16.6 years d T d t = − k ( T − T e n v ) \frac{dT}{dt} = -k(T - T_{\mathrm{env}}) d t d T = − k ( T − T env ) Where T T T is the temperature of the object, T e n v T_{\mathrm{env}} T env is the ambient temperature, and k > 0 k \gt 0 k > 0 .
Solution: T ( t ) = T e n v + ( T 0 − T e n v ) e − k t T(t) = T_{\mathrm{env}} + (T_0 - T_{\mathrm{env}})e^{-kt} T ( t ) = T env + ( T 0 − T env ) e − k t .
Example. A body at 90 ∘ C 90\,^{\circ}\mathrm{C} 90 ∘ C is placed in a room at 20 ∘ C 20\,^{\circ}\mathrm{C} 20 ∘ C . After 10 10 10 minutes, its temperature is 60 ∘ C 60\,^{\circ}\mathrm{C} 60 ∘ C . Find its temperature after 30 30 30 minutes.
60 = 20 + 70 e − 10 k ⟹ e − 10 k = 40 70 = 4 7 60 = 20 + 70e^{-10k} \implies e^{-10k} = \frac{40}{70} = \frac{4}{7} 60 = 20 + 70 e − 10 k ⟹ e − 10 k = 70 40 = 7 4 T ( 30 ) = 20 + 70 ( 4 7 ) 3 = 20 + 70 ⋅ 64 343 = 20 + 4480 343 ≈ 33.1 ∘ C T(30) = 20 + 70\left(\frac{4}{7}\right)^3 = 20 + 70 \cdot \frac{64}{343} = 20 + \frac{4480}{343} \approx 33.1\,^{\circ}\mathrm{C} T ( 30 ) = 20 + 70 ( 7 4 ) 3 = 20 + 70 ⋅ 343 64 = 20 + 343 4480 ≈ 33.1 ∘ C The equation of SHM is:
d 2 x d t 2 = − ω 2 x \frac{d^2x}{dt^2} = -\omega^2 x d t 2 d 2 x = − ω 2 x Characteristic equation: λ 2 + ω 2 = 0 ⟹ λ = ± i ω \lambda^2 + \omega^2 = 0 \implies \lambda = \pm i\omega λ 2 + ω 2 = 0 ⟹ λ = ± iω .
x ( t ) = A cos ω t + B sin ω t x(t) = A\cos\omega t + B\sin\omega t x ( t ) = A cos ω t + B sin ω t This can also be written as x ( t ) = R cos ( ω t + ϕ ) x(t) = R\cos(\omega t + \phi) x ( t ) = R cos ( ω t + ϕ ) where R = A 2 + B 2 R = \sqrt{A^2 + B^2} R = A 2 + B 2 and ϕ = arctan ( − B A ) \phi = \arctan\!\left(-\dfrac{B}{A}\right) ϕ = arctan ( − A B ) .
Key quantities:
Quantity Formula Amplitude R = A 2 + B 2 R = \sqrt{A^2 + B^2} R = A 2 + B 2 Period T = 2 π ω T = \dfrac{2\pi}{\omega} T = ω 2 π Frequency f = 1 T = ω 2 π f = \dfrac{1}{T} = \dfrac{\omega}{2\pi} f = T 1 = 2 π ω Angular frequency ω = 2 π f \omega = 2\pi f ω = 2 π f Maximum velocity v max = R ω v_{\max} = R\omega v m a x = R ω Maximum acceleration a max = R ω 2 a_{\max} = R\omega^2 a m a x = R ω 2
Example. A particle moves with SHM. At t = 0 t = 0 t = 0 , x = 3 x = 3 x = 3 and v = 4 v = 4 v = 4 . The angular frequency is ω = 2 \omega = 2 ω = 2 . Find x ( t ) x(t) x ( t ) .
x = A cos 2 t + B sin 2 t , v = − 2 A sin 2 t + 2 B cos 2 t x = A\cos 2t + B\sin 2t, \qquad v = -2A\sin 2t + 2B\cos 2t x = A cos 2 t + B sin 2 t , v = − 2 A sin 2 t + 2 B cos 2 t x ( 0 ) = A = 3 x(0) = A = 3 x ( 0 ) = A = 3 , v ( 0 ) = 2 B = 4 ⟹ B = 2 v(0) = 2B = 4 \implies B = 2 v ( 0 ) = 2 B = 4 ⟹ B = 2 .
x ( t ) = 3 cos 2 t + 2 sin 2 t x(t) = 3\cos 2t + 2\sin 2t x ( t ) = 3 cos 2 t + 2 sin 2 t Amplitude: R = 9 + 4 = 13 R = \sqrt{9 + 4} = \sqrt{13} R = 9 + 4 = 13 .
With damping proportional to velocity:
d 2 x d t 2 + 2 γ d x d t + ω 0 2 x = 0 \frac{d^2x}{dt^2} + 2\gamma\frac{dx}{dt} + \omega_0^2\, x = 0 d t 2 d 2 x + 2 γ d t d x + ω 0 2 x = 0 Where γ \gamma γ is the damping coefficient and ω 0 \omega_0 ω 0 is the natural frequency.
Characteristic equation: λ 2 + 2 γ λ + ω 0 2 = 0 \lambda^2 + 2\gamma\lambda + \omega_0^2 = 0 λ 2 + 2 γ λ + ω 0 2 = 0 .
λ = − γ ± γ 2 − ω 0 2 \lambda = -\gamma \pm \sqrt{\gamma^2 - \omega_0^2} λ = − γ ± γ 2 − ω 0 2 Condition Type of damping Solution γ 2 > ω 0 2 \gamma^2 \gt \omega_0^2 γ 2 > ω 0 2 Overdamped Two distinct real roots: exponentials γ 2 = ω 0 2 \gamma^2 = \omega_0^2 γ 2 = ω 0 2 Critically damped Repeated root: ( A + B t ) e − γ t (A + Bt)e^{-\gamma t} ( A + B t ) e − γ t γ 2 < ω 0 2 \gamma^2 \lt \omega_0^2 γ 2 < ω 0 2 Underdamped λ = − γ ± i ω d \lambda = -\gamma \pm i\omega_d λ = − γ ± i ω d : decaying oscillation
Where ω d = ω 0 2 − γ 2 \omega_d = \sqrt{\omega_0^2 - \gamma^2} ω d = ω 0 2 − γ 2 is the damped frequency .
Example. A particle of mass m m m falls under gravity with air resistance proportional to velocity. Find the velocity as a function of time.
Taking downward as positive, with drag force − k v -kv − k v :
m d v d t = m g − k v m\frac{dv}{dt} = mg - kv m d t d v = m g − k v d v d t + k m v = g \frac{dv}{dt} + \frac{k}{m}v = g d t d v + m k v = g Integrating factor: μ = e k t / m \mu = e^{kt/m} μ = e k t / m .
d d t ( v e k t / m ) = g e k t / m \frac{d}{dt}\!\left(ve^{kt/m}\right) = ge^{kt/m} d t d ( v e k t / m ) = g e k t / m v = m g k + C e − k t / m v = \frac{mg}{k} + Ce^{-kt/m} v = k m g + C e − k t / m If v ( 0 ) = 0 v(0) = 0 v ( 0 ) = 0 : C = − m g k C = -\dfrac{mg}{k} C = − k m g Giving v = m g k ( 1 − e − k t / m ) v = \dfrac{mg}{k}\!\left(1 - e^{-kt/m}\right) v = k m g ( 1 − e − k t / m ) .
The terminal velocity is v T = m g k v_T = \dfrac{mg}{k} v T = k m g (as t → ∞ t \to \infty t → ∞ ).
For the initial value problem d y d x = f ( x , y ) \dfrac{dy}{dx} = f(x, y) d x d y = f ( x , y ) with y ( x 0 ) = y 0 y(x_0) = y_0 y ( x 0 ) = y 0 Euler’s method Generates approximate values using:
y n + 1 = y n + h ⋅ f ( x n , y n ) y_{n+1} = y_n + h \cdot f(x_n, y_n) y n + 1 = y n + h ⋅ f ( x n , y n ) x n + 1 = x n + h x_{n+1} = x_n + h x n + 1 = x n + h Where h h h is the step size.
Algorithm:
Set x 0 , y 0 x_0, y_0 x 0 , y 0 from the initial condition. For each step n = 0 , 1 , 2 , … n = 0, 1, 2, \ldots n = 0 , 1 , 2 , … : Compute the slope: m n = f ( x n , y n ) m_n = f(x_n, y_n) m n = f ( x n , y n ) . Update: y n + 1 = y n + h ⋅ m n y_{n+1} = y_n + h \cdot m_n y n + 1 = y n + h ⋅ m n . Advance: x n + 1 = x n + h x_{n+1} = x_n + h x n + 1 = x n + h . Example. Use Euler’s method with h = 0.1 h = 0.1 h = 0.1 to approximate y ( 0.5 ) y(0.5) y ( 0.5 ) for d y d x = x + y \dfrac{dy}{dx} = x + y d x d y = x + y , y ( 0 ) = 1 y(0) = 1 y ( 0 ) = 1 .
n n n x n x_n x n y n y_n y n f ( x n , y n ) = x n + y n f(x_n, y_n) = x_n + y_n f ( x n , y n ) = x n + y n 0 0.0 1.000 1.000 1 0.1 1.100 1.200 2 0.2 1.220 1.420 3 0.3 1.362 1.662 4 0.4 1.528 1.928 5 0.5 1.721 ,
Euler’s approximation: y ( 0.5 ) ≈ 1.721 y(0.5) \approx 1.721 y ( 0.5 ) ≈ 1.721 .
Exact solution. This is a linear DE: y ′ − y = x y' - y = x y ′ − y = x . Integrating factor e − x e^{-x} e − x :
d d x ( y e − x ) = x e − x \frac{d}{dx}(ye^{-x}) = xe^{-x} d x d ( y e − x ) = x e − x Integrating by parts: y e − x = − ( x + 1 ) e − x + C ye^{-x} = -(x+1)e^{-x} + C y e − x = − ( x + 1 ) e − x + C . With y ( 0 ) = 1 y(0) = 1 y ( 0 ) = 1 : C = 2 C = 2 C = 2 .
y = 2 e x − x − 1 y = 2e^x - x - 1 y = 2 e x − x − 1 At x = 0.5 x = 0.5 x = 0.5 : y = 2 e 0.5 − 1.5 ≈ 1.797 y = 2e^{0.5} - 1.5 \approx 1.797 y = 2 e 0.5 − 1.5 ≈ 1.797 .
The Euler approximation of 1.721 1.721 1.721 underestimates the true value by about 0.076 0.076 0.076 A relative error Of roughly 4.2 % 4.2\% 4.2% .
Euler’s method has local truncation error proportional to h 2 h^2 h 2 and global error Proportional to h h h . Halving the step size approximately halves the global error.
A more accurate variant uses the average of the slopes at the beginning and end of each step:
k 1 = f ( x n , y n ) k_1 = f(x_n, y_n) k 1 = f ( x n , y n ) k 2 = f ( x n + h , y n + h k 1 ) k_2 = f(x_n + h, y_n + hk_1) k 2 = f ( x n + h , y n + h k 1 ) y n + 1 = y n + h 2 ( k 1 + k 2 ) y_{n+1} = y_n + \frac{h}{2}(k_1 + k_2) y n + 1 = y n + 2 h ( k 1 + k 2 )
This is a second order method with global error proportional to h 2 h^2 h 2 Offering significantly Better accuracy than the basic Euler method for the same step size.
Caution
Euler’s method can produce wildly inaccurate results for stiff equations or when the step size is too Large. Always check whether the approximation is reasonable by comparing with qualitative behaviour Of the DE (equilibrium, asymptotes, periodicity).
Worked Example: Separable Equation with Partial Fractions
Solve d y d x = y 2 − 1 x \dfrac{dy}{dx} = \dfrac{y^2 - 1}{x} d x d y = x y 2 − 1 with y ( 1 ) = 2 y(1) = 2 y ( 1 ) = 2 , x > 0 x \gt 0 x > 0 .
Solution Separate variables:
d y y 2 − 1 = d x x \frac{dy}{y^2 - 1} = \frac{dx}{x} y 2 − 1 d y = x d x Apply partial fractions to the left side: 1 y 2 − 1 = 1 2 ( y − 1 ) − 1 2 ( y + 1 ) \dfrac{1}{y^2 - 1} = \dfrac{1}{2(y-1)} - \dfrac{1}{2(y+1)} y 2 − 1 1 = 2 ( y − 1 ) 1 − 2 ( y + 1 ) 1 .
∫ 1 2 ( y − 1 ) − 1 2 ( y + 1 ) d y = ∫ d x x \int \frac{1}{2(y-1)} - \frac{1}{2(y+1)}\,dy = \int \frac{dx}{x} ∫ 2 ( y − 1 ) 1 − 2 ( y + 1 ) 1 d y = ∫ x d x 1 2 ln ∣ y − 1 ∣ − 1 2 ln ∣ y + 1 ∣ = ln x + C \frac{1}{2}\ln|y-1| - \frac{1}{2}\ln|y+1| = \ln x + C 2 1 ln ∣ y − 1∣ − 2 1 ln ∣ y + 1∣ = ln x + C ln ∣ y − 1 y + 1 ∣ = 2 ln x + 2 C = ln ( x 2 ) + 2 C \ln\left|\frac{y-1}{y+1}\right| = 2\ln x + 2C = \ln(x^2) + 2C ln y + 1 y − 1 = 2 ln x + 2 C = ln ( x 2 ) + 2 C ∣ y − 1 y + 1 ∣ = e 2 C x 2 = A x 2 \left|\frac{y-1}{y+1}\right| = e^{2C} x^2 = Ax^2 y + 1 y − 1 = e 2 C x 2 = A x 2 Where A = e 2 C > 0 A = e^{2C} \gt 0 A = e 2 C > 0 .
Apply y ( 1 ) = 2 y(1) = 2 y ( 1 ) = 2 : 1 3 = A ⋅ 1 ⟹ A = 1 3 \dfrac{1}{3} = A \cdot 1 \implies A = \dfrac{1}{3} 3 1 = A ⋅ 1 ⟹ A = 3 1 .
Since y ( 1 ) = 2 > 1 y(1) = 2 \gt 1 y ( 1 ) = 2 > 1 The numerator y − 1 y - 1 y − 1 is positive initially. For x > 0 x \gt 0 x > 0 near 1 1 1 :
y − 1 y + 1 = x 2 3 \frac{y-1}{y+1} = \frac{x^2}{3} y + 1 y − 1 = 3 x 2 3 ( y − 1 ) = x 2 ( y + 1 ) ⟹ 3 y − 3 = x 2 y + x 2 ⟹ y ( 3 − x 2 ) = 3 + x 2 3(y - 1) = x^2(y + 1) \implies 3y - 3 = x^2 y + x^2 \implies y(3 - x^2) = 3 + x^2 3 ( y − 1 ) = x 2 ( y + 1 ) ⟹ 3 y − 3 = x 2 y + x 2 ⟹ y ( 3 − x 2 ) = 3 + x 2 y = 3 + x 2 3 − x 2 y = \frac{3 + x^2}{3 - x^2} y = 3 − x 2 3 + x 2 This is valid for 0 < x < 3 0 \lt x \lt \sqrt{3} 0 < x < 3 .
Worked Example: Integrating Factor with Trigonometric Coefficients
Solve d y d x + y tan x = cos x \dfrac{dy}{dx} + y\tan x = \cos x d x d y + y tan x = cos x for − π 2 < x < π 2 -\dfrac{\pi}{2} \lt x \lt \dfrac{\pi}{2} − 2 π < x < 2 π .
Solution Here P ( x ) = tan x P(x) = \tan x P ( x ) = tan x So:
μ ( x ) = exp ( ∫ tan x d x ) = exp ( − ln ∣ cos x ∣ ) = 1 cos x = sec x \mu(x) = \exp\!\left(\int \tan x\,dx\right) = \exp(-\ln|\cos x|) = \frac{1}{\cos x} = \sec x μ ( x ) = exp ( ∫ tan x d x ) = exp ( − ln ∣ cos x ∣ ) = cos x 1 = sec x Multiply through: sec x d y d x + y sec x tan x = sec x cos x = 1 \sec x \dfrac{dy}{dx} + y\sec x \tan x = \sec x \cos x = 1 sec x d x d y + y sec x tan x = sec x cos x = 1 .
The left side is d d x ( y sec x ) \dfrac{d}{dx}(y \sec x) d x d ( y sec x ) So:
d d x ( y sec x ) = 1 ⟹ y sec x = x + C \frac{d}{dx}(y \sec x) = 1 \implies y \sec x = x + C d x d ( y sec x ) = 1 ⟹ y sec x = x + C y = ( x + C ) cos x y = (x + C)\cos x y = ( x + C ) cos x Worked Example: Second Order with Complex Roots and Initial Conditions
Solve y ′ ′ − 4 y ′ + 13 y = 0 y'' - 4y' + 13y = 0 y ′′ − 4 y ′ + 13 y = 0 with y ( 0 ) = 1 y(0) = 1 y ( 0 ) = 1 and y ′ ( 0 ) = 6 y'(0) = 6 y ′ ( 0 ) = 6 .
Solution Characteristic equation: λ 2 − 4 λ + 13 = 0 \lambda^2 - 4\lambda + 13 = 0 λ 2 − 4 λ + 13 = 0 .
λ = 4 ± 16 − 52 2 = 4 ± − 36 2 = 2 ± 3 i \lambda = \frac{4 \pm \sqrt{16 - 52}}{2} = \frac{4 \pm \sqrt{-36}}{2} = 2 \pm 3i λ = 2 4 ± 16 − 52 = 2 4 ± − 36 = 2 ± 3 i General solution: y = e 2 x ( A cos 3 x + B sin 3 x ) y = e^{2x}(A\cos 3x + B\sin 3x) y = e 2 x ( A cos 3 x + B sin 3 x ) .
Compute y ′ y' y ′ :
y ′ = 2 e 2 x ( A cos 3 x + B sin 3 x ) + e 2 x ( − 3 A sin 3 x + 3 B cos 3 x ) y' = 2e^{2x}(A\cos 3x + B\sin 3x) + e^{2x}(-3A\sin 3x + 3B\cos 3x) y ′ = 2 e 2 x ( A cos 3 x + B sin 3 x ) + e 2 x ( − 3 A sin 3 x + 3 B cos 3 x ) y ′ = e 2 x [ ( 2 A + 3 B ) cos 3 x + ( 2 B − 3 A ) sin 3 x ] y' = e^{2x}\bigl[(2A + 3B)\cos 3x + (2B - 3A)\sin 3x\bigr] y ′ = e 2 x [ ( 2 A + 3 B ) cos 3 x + ( 2 B − 3 A ) sin 3 x ] Apply y ( 0 ) = 1 y(0) = 1 y ( 0 ) = 1 : A = 1 A = 1 A = 1 .
Apply y ′ ( 0 ) = 6 y'(0) = 6 y ′ ( 0 ) = 6 : 2 ( 1 ) + 3 B = 6 ⟹ 3 B = 4 ⟹ B = 4 3 2(1) + 3B = 6 \implies 3B = 4 \implies B = \dfrac{4}{3} 2 ( 1 ) + 3 B = 6 ⟹ 3 B = 4 ⟹ B = 3 4 .
y = e 2 x ( cos 3 x + 4 3 sin 3 x ) y = e^{2x}\!\left(\cos 3x + \frac{4}{3}\sin 3x\right) y = e 2 x ( cos 3 x + 3 4 sin 3 x ) Worked Example: Newton’s Law of Cooling with Two Data Points
A cup of coffee at 85 ∘ C 85\,^{\circ}\mathrm{C} 85 ∘ C is placed in a room at 22 ∘ C 22\,^{\circ}\mathrm{C} 22 ∘ C . After 5 5 5 minutes the temperature is 70 ∘ C 70\,^{\circ}\mathrm{C} 70 ∘ C And after 10 10 10 minutes it is 60 ∘ C 60\,^{\circ}\mathrm{C} 60 ∘ C . Find the temperature after 20 20 20 minutes.
Solution The model is T ( t ) = 22 + ( 85 − 22 ) e − k t = 22 + 63 e − k t T(t) = 22 + (85 - 22)e^{-kt} = 22 + 63e^{-kt} T ( t ) = 22 + ( 85 − 22 ) e − k t = 22 + 63 e − k t .
From the first data point: 70 = 22 + 63 e − 5 k ⟹ e − 5 k = 48 63 = 16 21 70 = 22 + 63e^{-5k} \implies e^{-5k} = \dfrac{48}{63} = \dfrac{16}{21} 70 = 22 + 63 e − 5 k ⟹ e − 5 k = 63 48 = 21 16 .
From the second data point: 60 = 22 + 63 e − 10 k ⟹ e − 10 k = 38 63 60 = 22 + 63e^{-10k} \implies e^{-10k} = \dfrac{38}{63} 60 = 22 + 63 e − 10 k ⟹ e − 10 k = 63 38 .
Check consistency: ( 16 21 ) 2 = 256 441 ≈ 0.5805 \left(\dfrac{16}{21}\right)^2 = \dfrac{256}{441} \approx 0.5805 ( 21 16 ) 2 = 441 256 ≈ 0.5805 And 38 63 ≈ 0.6032 \dfrac{38}{63} \approx 0.6032 63 38 ≈ 0.6032 . These are close but not exactly equal, indicating measurement Imprecision. Using the 10 10 10 -minute data point:
e − 10 k = 38 63 ⟹ − 10 k = ln ( 38 63 ) ⟹ k = 1 10 ln ( 63 38 ) ≈ 0.0506 e^{-10k} = \frac{38}{63} \implies -10k = \ln\!\left(\frac{38}{63}\right) \implies k = \frac{1}{10}\ln\!\left(\frac{63}{38}\right) \approx 0.0506 e − 10 k = 63 38 ⟹ − 10 k = ln ( 63 38 ) ⟹ k = 10 1 ln ( 38 63 ) ≈ 0.0506 T ( 20 ) = 22 + 63 ( 38 63 ) 2 = 22 + 1444 63 ≈ 22 + 22.92 = 44.9 ∘ C T(20) = 22 + 63\left(\frac{38}{63}\right)^2 = 22 + \frac{1444}{63} \approx 22 + 22.92 = 44.9\,^{\circ}\mathrm{C} T ( 20 ) = 22 + 63 ( 63 38 ) 2 = 22 + 63 1444 ≈ 22 + 22.92 = 44.9 ∘ C Worked Example: Euler’s Method with Small Step Size
Use Euler’s method with h = 0.05 h = 0.05 h = 0.05 to approximate y ( 0.3 ) y(0.3) y ( 0.3 ) for d y d x = x − y \dfrac{dy}{dx} = x - y d x d y = x − y y ( 0 ) = 2 y(0) = 2 y ( 0 ) = 2 .
Solution n n n x n x_n x n y n y_n y n f ( x n , y n ) = x n − y n f(x_n, y_n) = x_n - y_n f ( x n , y n ) = x n − y n 0 0.00 2.0000 − 2.0000 -2.0000 − 2.0000 1 0.05 1.9000 − 1.8500 -1.8500 − 1.8500 2 0.10 1.8075 − 1.7075 -1.7075 − 1.7075 3 0.15 1.7221 − 1.5721 -1.5721 − 1.5721 4 0.20 1.6435 − 1.4435 -1.4435 − 1.4435 5 0.25 1.5713 − 1.3213 -1.3213 − 1.3213 6 0.30 1.5053 ,
Euler approximation: y ( 0.3 ) ≈ 1.505 y(0.3) \approx 1.505 y ( 0.3 ) ≈ 1.505 .
The exact solution (integrating factor): y ′ + y = x y' + y = x y ′ + y = x , μ = e x \mu = e^x μ = e x .
d d x ( y e x ) = x e x ⟹ y e x = ( x − 1 ) e x + C \frac{d}{dx}(ye^x) = xe^x \implies ye^x = (x - 1)e^x + C d x d ( y e x ) = x e x ⟹ y e x = ( x − 1 ) e x + C With y ( 0 ) = 2 y(0) = 2 y ( 0 ) = 2 : C = 3 C = 3 C = 3 . So y = x − 1 + 3 e − x y = x - 1 + 3e^{-x} y = x − 1 + 3 e − x .
At x = 0.3 x = 0.3 x = 0.3 : y = − 0.7 + 3 e − 0.3 ≈ − 0.7 + 3 ( 0.7408 ) = − 0.7 + 2.2225 = 1.522 y = -0.7 + 3e^{-0.3} \approx -0.7 + 3(0.7408) = -0.7 + 2.2225 = 1.522 y = − 0.7 + 3 e − 0.3 ≈ − 0.7 + 3 ( 0.7408 ) = − 0.7 + 2.2225 = 1.522 .
Error: ∣ 1.522 − 1.505 ∣ ≈ 0.017 |1.522 - 1.505| \approx 0.017 ∣1.522 − 1.505∣ ≈ 0.017 Roughly 1.1 % 1.1\% 1.1% .
A differential equation is a sentence about change. It does not tell you where you are; it tells you how you are moving. Separable equations are the simplest case, imagine a car whose speed depends only on its position. You can separate the “where” from the “how fast” and integrate each side independently. The integrating factor trick for linear equations is like finding the right lens through which a tangled expression suddenly comes into focus, it transforms a messy left side into the derivative of a product you can integrate directly. Second order equations describe systems with inertia, like springs and circuits, where the future depends on both position and velocity.
Forgetting the constant of integration. When solving a separable equation, each side of the separated equation produces its own constant. These combine into a single constant C C C But omitting it entirely loses the generality of the solution.
Losing solutions during separation. Dividing by g ( y ) g(y) g ( y ) implicitly assumes g ( y ) ≠ 0 g(y) \ne 0 g ( y ) = 0 . The equilibrium solution g ( y ) = 0 g(y) = 0 g ( y ) = 0 must be checked separately. For example, in d y d x = y 2 \dfrac{dy}{dx} = y^2 d x d y = y 2 dividing by y 2 y^2 y 2 loses the solution y = 0 y = 0 y = 0 .
Incorrect sign in the integrating factor. The standard form is d y d x + P ( x ) y = Q ( x ) \dfrac{dy}{dx} + P(x)y = Q(x) d x d y + P ( x ) y = Q ( x ) . If the equation is d y d x = P ( x ) y + Q ( x ) \dfrac{dy}{dx} = P(x)y + Q(x) d x d y = P ( x ) y + Q ( x ) You must rewrite it as d y d x − P ( x ) y = Q ( x ) \dfrac{dy}{dx} - P(x)y = Q(x) d x d y − P ( x ) y = Q ( x ) before computing μ = e ∫ − P ( x ) d x \mu = e^{\int -P(x)\,dx} μ = e ∫ − P ( x ) d x .
Misidentifying the discriminant for second order equations. For a λ 2 + b λ + c = 0 a\lambda^2 + b\lambda + c = 0 a λ 2 + bλ + c = 0 The discriminant is Δ = b 2 − 4 a c \Delta = b^2 - 4ac Δ = b 2 − 4 a c . If Δ = 0 \Delta = 0 Δ = 0 The repeated root gives ( A + B x ) e λ x (A + Bx)e^{\lambda x} ( A + B x ) e λ x not A e λ x Ae^{\lambda x} A e λ x .
Confusing the damping cases. In the damped oscillation equation x ¨ + 2 γ x ˙ + ω 0 2 x = 0 \ddot{x} + 2\gamma\dot{x} + \omega_0^2 x = 0 x ¨ + 2 γ x ˙ + ω 0 2 x = 0 It is γ 2 \gamma^2 γ 2 that is compared with ω 0 2 \omega_0^2 ω 0 2 . A common error is to compare γ \gamma γ with ω 0 \omega_0 ω 0 directly.
Euler’s method sign errors. The update formula is y n + 1 = y n + h ⋅ f ( x n , y n ) y_{n+1} = y_n + h \cdot f(x_n, y_n) y n + 1 = y n + h ⋅ f ( x n , y n ) . A negative sign in f f f does not change the formula; it only affects the value of the slope f ( x n , y n ) f(x_n, y_n) f ( x n , y n ) at each step.
Applying initial conditions prematurely. Apply the initial condition only after finding the general solution with the constant C C C . Applying it during the separation or integration step leads to incorrect particular solutions.
Ignoring the domain of the solution. Solutions to DEs may only be valid on specific intervals. For example, y = 3 + x 2 3 − x 2 y = \dfrac{3 + x^2}{3 - x^2} y = 3 − x 2 3 + x 2 blows up at x = 3 x = \sqrt{3} x = 3 . Always state the domain on which the solution is defined.
Solve d y d x = e x + y e x + 1 \dfrac{dy}{dx} = \dfrac{e^{x+y}}{e^x + 1} d x d y = e x + 1 e x + y given y ( 0 ) = ln 3 y(0) = \ln 3 y ( 0 ) = ln 3 .
Solve d y d x + 2 y x = x 3 \dfrac{dy}{dx} + \dfrac{2y}{x} = x^3 d x d y + x 2 y = x 3 for x > 0 x \gt 0 x > 0 Given y ( 1 ) = 0 y(1) = 0 y ( 1 ) = 0 .
Find the general solution of y ′ ′ + 6 y ′ + 9 y = 0 y'' + 6y' + 9y = 0 y ′′ + 6 y ′ + 9 y = 0 and identify the type of damping.
A radioactive isotope has a half-life of 8 8 8 days. A sample initially contains 200 g 200\,\mathrm{g} 200 g . How long until only 12.5 g 12.5\,\mathrm{g} 12.5 g remain? Give your answer to the nearest day.
Use Euler’s method with h = 0.25 h = 0.25 h = 0.25 to estimate y ( 1 ) y(1) y ( 1 ) for d y d x = 2 x − y \dfrac{dy}{dx} = 2x - y d x d y = 2 x − y y ( 0 ) = 0 y(0) = 0 y ( 0 ) = 0 . Find the exact solution and compute the percentage error.
A particle of mass 2 k g 2\,\mathrm{kg} 2 kg falls from rest under gravity with air resistance equal to 0.5 v 0.5v 0.5 v (where v v v is the velocity in m / s \mathrm{m/s} m/s ). Find the terminal velocity and the time taken to reach 90 % 90\% 90% of terminal velocity. Take g = 9.8 m / s 2 g = 9.8\,\mathrm{m/s}^2 g = 9.8 m/s 2 .
Solve d y d x = x 2 + 1 2 y \dfrac{dy}{dx} = \dfrac{x^2 + 1}{2y} d x d y = 2 y x 2 + 1 with y ( 0 ) = 2 y(0) = 2 y ( 0 ) = 2 . Find the value of y y y when x = 2 x = 2 x = 2 .
The temperature of an object follows Newton’s law of cooling. It cools from 95 ∘ C 95\,^{\circ}\mathrm{C} 95 ∘ C to 75 ∘ C 75\,^{\circ}\mathrm{C} 75 ∘ C in 15 15 15 minutes in a room at 20 ∘ C 20\,^{\circ}\mathrm{C} 20 ∘ C . How long does it take to cool from 95 ∘ C 95\,^{\circ}\mathrm{C} 95 ∘ C to 30 ∘ C 30\,^{\circ}\mathrm{C} 30 ∘ C ?
For the A-Level Further Maths treatment of this topic, see Differential Equations .
Tip
questions within the IB specification for this topic, each with a full worked solution.
Unit tests probe edge cases and common misconceptions. Integration tests combine Differential Equations with other IB mathematics topics to test synthesis under exam conditions.
See for instructions on self-marking and building a personal test matrix.
Topic Site Link [Differential Equations] A-Level View [Differential Equations] IB View [Differential Equations] University View
This topic covers the mathematical techniques and concepts related to differential equations, including key theorems, methods, and problem-solving approaches.
Key concepts include:
kinematics (SUVAT equations) dynamics and Newton’s laws moments and equilibrium work, energy, and power projectile motion Regular practice with a variety of question types is essential to build fluency and confidence in applying these mathematical techniques. | [Differential Equations] | A-Level | View | | [Differential Equations] | IB | View | | [Differential Equations] | University | View |