impera Open Impera

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.

Example

$y = Ae^{3x}$ solves $\frac{dy}{dx} = 3y$, because $\frac{dy}{dx} = 3Ae^{3x} = 3y$.

Check yourself

What makes a solution a particular solution?

  • It is the simplest possible solution of the equation

  • It still contains an arbitrary constant C in it

  • It has no x in it, so it is a constant function

  • The constant has been fixed using a given condition

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$$

Worked example

Exponential growth

  1. $\frac{dy}{dx} = ky$. Separate: $\int \frac{1}{y}\,dy = \int k\,dx$.
  2. $\ln|y| = kx + C$, so $y = Ae^{kx}$.
Worked example

A particular solution

  1. $\frac{dy}{dx} = xy$ with $y(0) = 2$.
  2. $\int \frac{1}{y}\,dy = \int x\,dx$, so $\ln|y| = \frac{x^2}{2} + C$.
  3. $y = Ae^{\frac{x^2}{2}}$. At $x = 0$: $A = 2$.
  4. $y = 2e^{\frac{x^2}{2}}$.
Check yourself

What is the general solution of dy/dx = ky?

  • y = e^k + C

  • y = kx + C

  • y = A ln(kx)

  • y = Ae^(kx)

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.

Worked example

A homogeneous equation

  1. $\frac{dy}{dx} = 1 + \frac{y}{x}$. Let $y = vx$.
  2. $v + x\frac{dv}{dx} = 1 + v$, so $\frac{dv}{dx} = \frac{1}{x}$.
  3. $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.

Worked example

Using an integrating factor

  1. $\frac{dy}{dx} + 2y = e^{-x}$. The factor is $e^{\int 2\,dx} = e^{2x}$.
  2. Multiply: $\frac{d}{dx}\left(ye^{2x}\right) = e^{x}$.
  3. Integrate: $ye^{2x} = e^x + C$.
  4. $y = e^{-x} + Ce^{-2x}$.
Check yourself

What is the integrating factor for dy/dx + 3y = x?

  • e^(−3x)

  • e^(3x)

  • e^x

  • 3x

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)$$

Worked example

Euler's method

  1. $\frac{dy}{dx} = x + y$, $y(0) = 1$, step $h = 0.1$.
  2. $y_1 = 1 + 0.1(0 + 1) = 1.1$.
  3. $y_2 = 1.1 + 0.1(0.1 + 1.1) = 1.22$.
  4. $y_3 = 1.22 + 0.1(0.2 + 1.22) = 1.362$.
  5. 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?

  • The average of all gradients

  • The gradient at the end of the step

  • f(xₙ, yₙ) at the start of the step

  • Always 1

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.
Worked example

Newton's law of cooling

  1. Tea at 90 °C cools in a room at 20 °C, with $k = 0.1$ per minute.
  2. Solution: $T = 20 + 70e^{-0.1t}$.
  3. 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$?

  • The surrounding temperature

  • The starting temperature

  • Zero degrees Celsius

  • Infinity (it keeps rising)

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)$.

Worked example

$\frac{dy}{dx} = x + y$, $y(0) = 1$, $h = 0.1$

  1. $f(0, 1) = 1$, so $y_1 = 1 + 0.1(1) = 1.1$ at $x = 0.1$.
  2. $f(0.1, 1.1) = 1.2$, so $y_2 = 1.1 + 0.1(1.2) = 1.22$ at $x = 0.2$.
  3. $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?

  • Use a larger step size

  • Use a smaller step size

  • Use only one step

  • Skip steps

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