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-th order DE contains n arbitrary constants. A particular solution is obtained by imposing Initial or boundary conditions.
Separable First Order Equations
Form and Method
A first order ODE is separable if it can be written in the form:
dxdy=f(x)⋅g(y)
Equivalently:
g(y)dy=f(x)dx
Integrate both sides:
∫g(y)1dy=∫f(x)dx
Worked Examples
Example. Solve dxdy=yx with y(0)=2.
Separate: ydy=xdx.
∫ydy=∫xdx⟹2y2=2x2+C
Apply y(0)=2: 24=0+C⟹C=2.
y2=x2+4⟹y=x2+4
(We take the positive root since y(0)=2>0.)
Example. Solve dxdy=xy.
ydy=xdx⟹ln∣y∣=2x2+C⟹y=Aex2/2
Where A=±eC.
Example. Solve dxdy=xy+1, x>0.
y+1dy=xdx⟹ln∣y+1∣=lnx+C⟹∣y+1∣=eC⋅x
y+1=Ax⟹y=Ax−1
First Order Linear Equations and Integrating Factors
Standard Form
A first order linear ODE has the form:
dxdy+P(x)y=Q(x)
The Integrating Factor
Multiply through by the integrating factor:
μ(x)=exp(∫P(x)dx)
This transforms the equation into:
dxd[μ(x)⋅y]=μ(x)⋅Q(x)
Integrate both sides:
y=μ(x)1∫μ(x)⋅Q(x)dx
Derivation. By the product rule:
dxd(μy)=μdxdy+ydxdμ
We need dxdμ=μP(x)Which gives μ1dxdμ=P(x)Hence μ=exp(∫P(x)dx).
Worked Examples
Example. Solve dxdy+xy=x2, x>0.
Here P(x)=x1So:
μ(x)=exp(∫x1dx)=elnx=x
Multiply through: xdxdy+y=x3I.e. dxd(xy)=x3.
xy=∫x3dx=4x4+C⟹y=4x3+xC
Example. Solve dxdy+2y=e−x.
μ(x)=e2x.
dxd(e2xy)=e2x⋅e−x=ex
e2xy=ex+C⟹y=e−x+Ce−2x
Example. Solve dxdy−3y=6Given y(0)=1.
μ(x)=e−3x.
dxd(e−3xy)=6e−3x
e−3xy=−2e−3x+C⟹y=−2+Ce3x
Using y(0)=1: 1=−2+C⟹C=3. Hence y=3e3x−2.
Second Order Homogeneous Equations
Form
adx2d2y+bdxdy+cy=0
Where a,b,c are constants and a=0.
The Characteristic Equation
Substitute y=eλx:
aλ2+bλ+c=0
This quadratic in λ is the auxiliary (or characteristic) equation.
Three Cases
Case 1: Two distinct real rootsλ1=λ2.
y=Aeλ1x+Beλ2x
Case 2: Repeated real rootλ.
y=(A+Bx)eλx
Case 3: Complex conjugate rootsλ=α±iβ.
y=eαx(Acosβx+Bsinβx)
Worked Examples
Example. Solve y"′−5y′+6y=0.
Characteristic equation: λ2−5λ+6=0⟹(λ−2)(λ−3)=0.
Roots: λ1=2, λ2=3 (distinct real).
y=Ae2x+Be3x
Example. Solve y′′+4y′+4y=0.
Characteristic equation: λ2+4λ+4=0⟹(λ+2)2=0.
Repeated root: λ=−2.
y=(A+Bx)e−2x
Example. Solve y′′+2y′+5y=0.
Characteristic equation: λ2+2λ+5=0.
λ=2−2±4−20=−1±2i
Here α=−1, β=2.
y=e−x(Acos2x+Bsin2x)
With Initial Conditions
Example. Solve y′′−y=0 with y(0)=0 and y′(0)=1.
Characteristic equation: λ2−1=0⟹λ=±1.
y=Aex+Be−x,y′=Aex−Be−x
y(0)=A+B=0⟹B=−A. y′(0)=A−B=1⟹2A=1⟹A=21.
y=21ex−21e−x=sinhx
Applications
Exponential Growth and Decay
The DE dtdN=kN has the general solution N=N0ekt.
Growth:k>0 (e.g. Population, compound interest).
Decay:k<0 (e.g. Radioactive decay, cooling).
Half-life. For radioactive decay, N=N0e−λt where λ>0 is the decay Constant. The half-life t1/2 satisfies:
N0e−λt1/2=2N0⟹t1/2=λln2
Example. A substance has a half-life of 5 years. How long until only 10% remains?
λ=5ln2
0.1N0=N0e−λt⟹−λt=ln0.1⟹t=ln2ln10⋅5≈16.6years
Newton’s Law of Cooling
dtdT=−k(T−Tenv)
Where T is the temperature of the object, Tenv is the ambient temperature, and k>0.
Solution: T(t)=Tenv+(T0−Tenv)e−kt.
Example. A body at 90∘C is placed in a room at 20∘C. After 10 minutes, its temperature is 60∘C. Find its temperature after 30 minutes.
60=20+70e−10k⟹e−10k=7040=74
T(30)=20+70(74)3=20+70⋅34364=20+3434480≈33.1∘C
Simple Harmonic Motion (SHM)
The equation of SHM is:
dt2d2x=−ω2x
Characteristic equation: λ2+ω2=0⟹λ=±iω.
x(t)=Acosωt+Bsinωt
This can also be written as x(t)=Rcos(ωt+ϕ) where R=A2+B2 and ϕ=arctan(−AB).
Key quantities:
Quantity
Formula
Amplitude
R=A2+B2
Period
T=ω2π
Frequency
f=T1=2πω
Angular frequency
ω=2πf
Maximum velocity
vmax=Rω
Maximum acceleration
amax=Rω2
Example. A particle moves with SHM. At t=0, x=3 and v=4. The angular frequency is ω=2. Find x(t).
x=Acos2t+Bsin2t,v=−2Asin2t+2Bcos2t
x(0)=A=3, v(0)=2B=4⟹B=2.
x(t)=3cos2t+2sin2t
Amplitude: R=9+4=13.
Damped Oscillations
With damping proportional to velocity:
dt2d2x+2γdtdx+ω02x=0
Where γ is the damping coefficient and ω0 is the natural frequency.
Characteristic equation: λ2+2γλ+ω02=0.
λ=−γ±γ2−ω02
Condition
Type of damping
Solution
γ2>ω02
Overdamped
Two distinct real roots: exponentials
γ2=ω02
Critically damped
Repeated root: (A+Bt)e−γt
γ2<ω02
Underdamped
λ=−γ±iωd: decaying oscillation
Where ωd=ω02−γ2 is the damped frequency.
Mechanics Applications
Example. A particle of mass 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 −kv:
mdtdv=mg−kv
dtdv+mkv=g
Integrating factor: μ=ekt/m.
dtd(vekt/m)=gekt/m
v=kmg+Ce−kt/m
If v(0)=0: C=−kmgGiving v=kmg(1−e−kt/m).
The terminal velocity is vT=kmg (as t→∞).
Numerical Methods
Euler’s Method
For the initial value problem dxdy=f(x,y) with y(x0)=y0Euler’s method Generates approximate values using:
yn+1=yn+h⋅f(xn,yn)
xn+1=xn+h
Where h is the step size.
Algorithm:
Set x0,y0 from the initial condition.
For each step n=0,1,2,…:
Compute the slope: mn=f(xn,yn).
Update: yn+1=yn+h⋅mn.
Advance: xn+1=xn+h.
Example. Use Euler’s method with h=0.1 to approximate y(0.5) for dxdy=x+y, y(0)=1.
n
xn
yn
f(xn,yn)=xn+yn
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.
Exact solution. This is a linear DE: y′−y=x. Integrating factor e−x:
dxd(ye−x)=xe−x
Integrating by parts: ye−x=−(x+1)e−x+C. With y(0)=1: C=2.
y=2ex−x−1
At x=0.5: y=2e0.5−1.5≈1.797.
The Euler approximation of 1.721 underestimates the true value by about 0.076A relative error Of roughly 4.2%.
Error Analysis
Euler’s method has local truncation error proportional to h2 and global error Proportional to h. Halving the step size approximately halves the global error.
Improved Euler Method (Heun’s Method)
A more accurate variant uses the average of the slopes at the beginning and end of each step:
This is a second order method with global error proportional to h2Offering significantly Better accuracy than the basic Euler method for the same step size.
:::caution Warning
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).
:::
Additional Worked Examples
Worked Example: Separable Equation with Partial Fractions
Solve dxdy=xy2−1 with y(1)=2, x>0.
Solution
Separate variables:
y2−1dy=xdx
Apply partial fractions to the left side: y2−11=2(y−1)1−2(y+1)1.
∫2(y−1)1−2(y+1)1dy=∫xdx
21ln∣y−1∣−21ln∣y+1∣=lnx+C
lny+1y−1=2lnx+2C=ln(x2)+2C
y+1y−1=e2Cx2=Ax2
Where A=e2C>0.
Apply y(1)=2: 31=A⋅1⟹A=31.
Since y(1)=2>1The numerator y−1 is positive initially. For x>0 near 1:
y+1y−1=3x2
3(y−1)=x2(y+1)⟹3y−3=x2y+x2⟹y(3−x2)=3+x2
y=3−x23+x2
This is valid for 0<x<3.
Worked Example: Integrating Factor with Trigonometric Coefficients
Solve dxdy+ytanx=cosx for −2π<x<2π.
Solution
Here P(x)=tanxSo:
μ(x)=exp(∫tanxdx)=exp(−ln∣cosx∣)=cosx1=secx
Multiply through: secxdxdy+ysecxtanx=secxcosx=1.
The left side is dxd(ysecx)So:
dxd(ysecx)=1⟹ysecx=x+C
y=(x+C)cosx
Worked Example: Second Order with Complex Roots and Initial Conditions
Solve y′′−4y′+13y=0 with y(0)=1 and y′(0)=6.
Solution
Characteristic equation: λ2−4λ+13=0.
λ=24±16−52=24±−36=2±3i
General solution: y=e2x(Acos3x+Bsin3x).
Compute y′:
y′=2e2x(Acos3x+Bsin3x)+e2x(−3Asin3x+3Bcos3x)
y′=e2x[(2A+3B)cos3x+(2B−3A)sin3x]
Apply y(0)=1: A=1.
Apply y′(0)=6: 2(1)+3B=6⟹3B=4⟹B=34.
y=e2x(cos3x+34sin3x)
Worked Example: Newton’s Law of Cooling with Two Data Points
A cup of coffee at 85∘C is placed in a room at 22∘C. After 5 minutes the temperature is 70∘CAnd after 10 minutes it is 60∘C. Find the temperature after 20 minutes.
Solution
The model is T(t)=22+(85−22)e−kt=22+63e−kt.
From the first data point: 70=22+63e−5k⟹e−5k=6348=2116.
From the second data point: 60=22+63e−10k⟹e−10k=6338.
Check consistency: (2116)2=441256≈0.5805And 6338≈0.6032. These are close but not exactly equal, indicating measurement Imprecision. Using the 10-minute data point:
e−10k=6338⟹−10k=ln(6338)⟹k=101ln(3863)≈0.0506
T(20)=22+63(6338)2=22+631444≈22+22.92=44.9∘C
Worked Example: Euler’s Method with Small Step Size
Use Euler’s method with h=0.05 to approximate y(0.3) for dxdy=x−yy(0)=2.
Solution
n
xn
yn
f(xn,yn)=xn−yn
0
0.00
2.0000
−2.0000
1
0.05
1.9000
−1.8500
2
0.10
1.8075
−1.7075
3
0.15
1.7221
−1.5721
4
0.20
1.6435
−1.4435
5
0.25
1.5713
−1.3213
6
0.30
1.5053
—
Euler approximation: y(0.3)≈1.505.
The exact solution (integrating factor): y′+y=x, μ=ex.
dxd(yex)=xex⟹yex=(x−1)ex+C
With y(0)=2: C=3. So y=x−1+3e−x.
At x=0.3: y=−0.7+3e−0.3≈−0.7+3(0.7408)=−0.7+2.2225=1.522.
Error: ∣1.522−1.505∣≈0.017Roughly 1.1%.
Common Pitfalls
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 CBut omitting it entirely loses the generality of the solution.
Losing solutions during separation. Dividing by g(y) implicitly assumes g(y)=0. The equilibrium solution g(y)=0 must be checked separately. For example, in dxdy=y2 dividing by y2 loses the solution y=0.
Incorrect sign in the integrating factor. The standard form is dxdy+P(x)y=Q(x). If the equation is dxdy=P(x)y+Q(x)You must rewrite it as dxdy−P(x)y=Q(x) before computing μ=e∫−P(x)dx.
Misidentifying the discriminant for second order equations. For aλ2+bλ+c=0The discriminant is Δ=b2−4ac. If Δ=0The repeated root gives (A+Bx)eλxnotAeλx.
Confusing the damping cases. In the damped oscillation equation x¨+2γx˙+ω02x=0It is γ2 that is compared with ω02. A common error is to compare γ with ω0 directly.
Euler’s method sign errors. The update formula is yn+1=yn+h⋅f(xn,yn). A negative sign in f does not change the formula; it only affects the value of the slope f(xn,yn) at each step.
Applying initial conditions prematurely. Apply the initial condition only after finding the general solution with the constant 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−x23+x2 blows up at x=3. Always state the domain on which the solution is defined.
Exam-Style Problems
Solve dxdy=ex+1ex+y given y(0)=ln3.
Solve dxdy+x2y=x3 for x>0Given y(1)=0.
Find the general solution of y′′+6y′+9y=0 and identify the type of damping.
A radioactive isotope has a half-life of 8 days. A sample initially contains 200g. How long until only 12.5g remain? Give your answer to the nearest day.
Use Euler’s method with h=0.25 to estimate y(1) for dxdy=2x−yy(0)=0. Find the exact solution and compute the percentage error.
A particle of mass 2kg falls from rest under gravity with air resistance equal to 0.5v (where v is the velocity in m/s). Find the terminal velocity and the time taken to reach 90% of terminal velocity. Take g=9.8m/s2.
Solve dxdy=2yx2+1 with y(0)=2. Find the value of y when x=2.
The temperature of an object follows Newton’s law of cooling. It cools from 95∘C to 75∘C in 15 minutes in a room at 20∘C. How long does it take to cool from 95∘C to 30∘C?
:::tip Tip Ready to test your understanding of Differential Equations? The contains the hardest 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. :::
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 |