IB Diploma Mathematics AA · Calculus
Differential equations (HL)
1What a differential equation is
A differential equation links a function with its derivatives, such as $\frac{dy}{dx} = 3y$.
- The general solution contains an arbitrary constant: a whole family of curves.
- A particular solution uses an initial condition, like $y(0) = 2$, to fix the constant.
To check a solution, substitute it back into the equation.
$y = Ae^{3x}$ solves $\frac{dy}{dx} = 3y$, because $\frac{dy}{dx} = 3Ae^{3x} = 3y$.
Check yourself
What makes a solution a particular solution?
Show the answer
The constant has been fixed using a given condition
An initial condition picks one curve from the family.
2Separating the variables
If the equation can be written as $g(y)\frac{dy}{dx} = f(x)$, separate it and integrate both sides:
$$\int g(y)\,dy = \int f(x)\,dx$$
Exponential growth
- $\frac{dy}{dx} = ky$. Separate: $\int \frac{1}{y}\,dy = \int k\,dx$.
- $\ln|y| = kx + C$, so $y = Ae^{kx}$.
A particular solution
- $\frac{dy}{dx} = xy$ with $y(0) = 2$.
- $\int \frac{1}{y}\,dy = \int x\,dx$, so $\ln|y| = \frac{x^2}{2} + C$.
- $y = Ae^{\frac{x^2}{2}}$. At $x = 0$: $A = 2$.
- $y = 2e^{\frac{x^2}{2}}$.
Check yourself
What is the general solution of dy/dx = ky?
Show the answer
y = Ae^(kx)
Separate and integrate: ln y = kx + C.
3Homogeneous equations and integrating factors
A homogeneous equation has the form $\frac{dy}{dx} = f\left(\frac{y}{x}\right)$. Substitute $y = vx$, so $\frac{dy}{dx} = v + x\frac{dv}{dx}$. The new equation separates.
A homogeneous equation
- $\frac{dy}{dx} = 1 + \frac{y}{x}$. Let $y = vx$.
- $v + x\frac{dv}{dx} = 1 + v$, so $\frac{dv}{dx} = \frac{1}{x}$.
- $v = \ln|x| + C$, so $y = x\ln|x| + Cx$.
A linear equation $\frac{dy}{dx} + P(x)y = Q(x)$ is solved with the integrating factor $e^{\int P(x)\,dx}$. Multiply through, and the left side becomes the derivative of $y$ times the factor.
Using an integrating factor
- $\frac{dy}{dx} + 2y = e^{-x}$. The factor is $e^{\int 2\,dx} = e^{2x}$.
- Multiply: $\frac{d}{dx}\left(ye^{2x}\right) = e^{x}$.
- Integrate: $ye^{2x} = e^x + C$.
- $y = e^{-x} + Ce^{-2x}$.
Check yourself
What is the integrating factor for dy/dx + 3y = x?
Show the answer
e^(3x)
e^(∫3 dx) = e^(3x).
4Slope fields and Euler's method
A slope field for dy/dx = x + y, with a solution curve and Euler steps
A slope field draws a short line at many points, each with the gradient given by the equation. Solution curves follow the lines.
When an equation cannot be solved exactly, Euler's method steps along the slope field in small steps of size $h$:
$$x_{n+1} = x_n + h \qquad y_{n+1} = y_n + h \times f(x_n, y_n)$$
Euler's method
- $\frac{dy}{dx} = x + y$, $y(0) = 1$, step $h = 0.1$.
- $y_1 = 1 + 0.1(0 + 1) = 1.1$.
- $y_2 = 1.1 + 0.1(0.1 + 1.1) = 1.22$.
- $y_3 = 1.22 + 0.1(0.2 + 1.22) = 1.362$.
- The exact value at $x = 0.3$ is $2e^{0.3} - 1.3 = 1.400$. Euler's method underestimates here because the curve bends upward.
A smaller step gives a better approximation, but takes more steps. Your GDC or a spreadsheet can do the repetition.
Check yourself
In Euler's method, what is used as the gradient for each step?
Show the answer
f(xₙ, yₙ) at the start of the step
The method follows the tangent from the current point.
5Modelling with differential equations
Many situations lead to differential equations.
- Exponential growth or decay: $\frac{dN}{dt} = kN$, with solution $N = N_0 e^{kt}$.
- Newton's law of cooling: $\frac{dT}{dt} = -k(T - T_s)$, where $T_s$ is the surrounding temperature.
- Logistic growth: $\frac{dP}{dt} = kP\left(1 - \frac{P}{K}\right)$, where $K$ is the carrying capacity.
Newton's law of cooling
- Tea at 90 °C cools in a room at 20 °C, with $k = 0.1$ per minute.
- Solution: $T = 20 + 70e^{-0.1t}$.
- After 10 minutes: $T = 20 + 70e^{-1} \approx 20 + 25.75 = 45.8$ °C.
Check yourself
In Newton's law of cooling, what does $T$ approach as $t \to \infty$?
Show the answer
The surrounding temperature
$e^{-kt} \to 0$.
6Euler's method step by step
Euler's method approximates solutions with small steps: $y_{n+1} = y_n + h \cdot f(x_n, y_n)$.
$\frac{dy}{dx} = x + y$, $y(0) = 1$, $h = 0.1$
- $f(0, 1) = 1$, so $y_1 = 1 + 0.1(1) = 1.1$ at $x = 0.1$.
- $f(0.1, 1.1) = 1.2$, so $y_2 = 1.1 + 0.1(1.2) = 1.22$ at $x = 0.2$.
- $f(0.2, 1.22) = 1.42$, so $y_3 = 1.22 + 0.142 = 1.362$ at $x = 0.3$.
The exact solution is $y = 2e^x - x - 1$, giving $y(0.3) \approx 1.3997$. Euler underestimates here because the curve is concave up; smaller steps improve accuracy.
Check yourself
In Euler's method, how can accuracy be improved?
Show the answer
Use a smaller step size
Smaller h.
Now test yourself
This lesson has a 8-question quiz and 5 exam-style questions with mark schemes in Impera. Free, with your progress saved.
Practise in Impera