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.
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.
This is a second order method with global error proportional to h2, offering significantly
better accuracy than the basic Euler method for the same step size.
warning
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).
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>1, the 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)=tanx, so:
μ(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∘C, and 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.5805, and
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−y,
y(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.
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, but 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=0, the discriminant is Δ=b2−4ac. If Δ=0, the
repeated root gives (A+Bx)eλx, notAeλx.
Confusing the damping cases. In the damped oscillation equation
x¨+2γx˙+ω02x=0, it 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.
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−y,
y(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
Ready to test your understanding of Differential Equations? The diagnostic test 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 Diagnostic Guide for instructions on self-marking and building a personal test matrix.