In this guide
← Maths AI guides

Calculus · AI HL

Differential equations, Euler’s method and phase portraits

Model changing quantities with differential equations, approximate their solutions and interpret coupled systems through eigendirections and phase space.

Course focus: AI HL · First-assessment-2021 course. The sections distinguish the mathematical idea, the calculation and its interpretation.

Before you start: Differentiation, integration, matrix eigenvalues and initial conditions.

Start with a small example

Build it from the beginning

HL content

A differential equation gives a rate rather than the final value of a changing quantity. Euler approximation follows the current tangent for one small time step, then updates the slope. For coupled equations, calculate both next values from the same old state.

A first walkthrough

Use one Euler step of size 0.1 for dy/dt=y, starting at y=2 when t=0.

  1. The current slope is the old value y=2.
  2. Change is step times slope: \(0.1(2)=0.2\).
  3. The next value is \(2+0.2=2.2\) at t=0.1. It is an approximation.
Try the practice ladder after learning the methods ↓

The foundations behind the method

Understand what the symbols mean

Rate equations model how a state moves. A single dependent variable uses a slope field; two coupled variables use a vector direction at each state-space point. A phase trajectory is not a time graph: time moves along the curve, while its axes are the two state quantities. Initial conditions decide which trajectory is followed.

How the ideas connect

Continuous eigenmodes use exponentials e to the eigenvalue times time, whereas discrete matrix iterations use powers of the eigenvalues. Negative continuous eigenvalues decay without alternating sign, unlike negative discrete multipliers. This distinction links earlier matrix work to differential systems while preventing a misleading transfer of the discrete interpretation.

01

Start with the idea

Build your understanding

Two spaces

A time graph plots one quantity against time; a phase portrait plots state components against each other with time indicated by direction.

Two evolution rules

Discrete iterations use λⁿ, while continuous eigenmodes use e^(λt). Their negative-sign behaviour is different.

Compare the approaches

Choose by the information in the question, rather than the formula you recognise first.

Analytic solution

When it helpsUse separation or a justified eigenvector form when the equation supports it.

Check before using itCheck excluded equilibria, initial conditions and the domain; not every matrix has a complete eigenbasis.

Euler approximation

When it helpsUse successive tangent updates with a stated step.

Check before using itIn a coupled system calculate all new components from the same old state, and assess step-size effects.

Your method plan

  1. Define variables, rate law and initial state.
  2. Choose an analytic or numerical method and preserve its conditions.
  3. Verify the initial condition and interpret equilibrium, direction and approximation error.
02

Learn the methods

Learn step by step

1. An equation for a changing function

A differential equation specifies how a quantity changes rather than giving its value directly. Its solution is a function over an interval. A general solution contains constants; initial values select a particular trajectory. Define the independent variable, dependent quantities and units before writing a rate law. A numerical model of a physical process may only apply while quantities remain nonnegative or while other assumptions hold.

2. Separate variables and retain equilibria

For \(dy/dx=g(x)h(y)\), separate and integrate where division by h(y) is valid. Before dividing, check values making h(y)=0, because they can be constant equilibrium solutions. After integration, use the initial condition and state the valid domain. Absolute values in a logarithmic antiderivative represent sign information; a contextual positivity condition can select a branch. Verify a solution by differentiating and substituting it into the original rate equation.

Separated integration

Why this formula works

Along a non-equilibrium solution, moving the dependent-variable factor to the derivative side allows each side to be integrated with respect to its own variable. The division excludes roots of h, so those equilibrium cases must be checked independently. Initial data then selects a constant and may limit the permitted branch.

The formula

\(\int\frac{dy}{h(y)}=\int g(x)\,dx\), where \(h(y)\ne0\).

Quick example

For y′=2y and y(0)=3, separation gives ln|y|=2x+C and the selected solution is \(y=3e^{2x}\).

3. Read a slope field

At each plotted location (x,y), the equation supplies a local slope. A short segment indicates the direction a solution curve follows there. A solution passing through an initial point follows these local directions, but a segment is not itself a full solution. For an autonomous equation y′=h(y), slopes depend only on height, giving matching slopes along horizontal lines. Equilibrium levels have zero slope and can divide regions of increasing or decreasing solutions.

4. Euler takes one tangent step at a time

Use the current derivative to extrapolate over a short step: \(y_{n+1}=y_n+h f(x_n,y_n)\). Then update x and recalculate the derivative at the new approximate point. Do not keep the initial slope for every step. Euler’s method uses a local straight-line approximation, so error can accumulate. Smaller h often improves a smooth well-behaved calculation over a fixed interval, but stability and model behaviour must also be considered.

Euler update

Why this formula works

A tangent line predicts output change as current slope times the small input step. The next slope must be recalculated at the next approximate state. This is a first-order approximation to the solution, not an exact rearrangement of the differential equation for a finite step.

The formula

\(x_{n+1}=x_n+h\) \(y_{n+1}=y_n+h f(x_n,y_n)\).

Quick example

For y′=y, y(0)=1 and h=0.5, the first two values are 1.5 and 2.25, while the exact value at x=1 is e.

Worked example: Two Euler steps

Approximate y at x=1 for y′=y, y(0)=1 and h=0.5.

  1. At the first point, slope is 1, giving y1=1+0.5=1.5 at x=0.5.
  2. Recalculate slope as 1.5, giving y2=1.5+0.5(1.5)=2.25 at x=1.
  3. The exact value is \(e\approx2.71828\); the approximation is lower.
  4. Each tangent lies below the convex exact curve in this example. The step is not an exact exponential multiplier.

5. A coupled system changes two quantities together

For \(x'=ax+by\) and \(y'=cx+dy\), each rate depends on the same current pair. Matrix form is \(\mathbf u'=A\mathbf u\). An equilibrium solves both rates equal to zero. For a nonsingular homogeneous coefficient matrix the only equilibrium is the origin; a singular matrix can produce a line of equilibria. A state-space phase portrait plots x against y, not x against time, and each curve represents a joint trajectory.

6. Real eigenvalues separate continuous modes

If A has two independent real eigenvectors, a solution is \(\mathbf u(t)=C_1e^{\lambda_1t}\mathbf v_1+C_2e^{\lambda_2t}\mathbf v_2\). Initial conditions determine the constants. Negative eigenvalues produce continuous decay along their directions; positive ones produce growth. One positive and one negative direction give a saddle. Repeated eigenvalues need an independence check before this form is used without further terms.

A phase trajectory approaches a stable equilibrium

012012State xState y
  • Start (2,1): y = x²/4
  • Other trajectory
For x′=−x and y′=−2y, the shown positive-quadrant trajectories approach the origin as time increases. The axes are state variables x and y, not time. The highlighted start (2,1) follows y=x²/4.

Real-eigenvector solution

Why this formula works

Differentiating one eigenvector term multiplies it by its eigenvalue, and applying A to that direction does the same. Linear combinations therefore solve the linear system. Initial-state decomposition selects coefficients. This representation requires enough independent eigenvectors; repeated or complex cases need their appropriate form.

The formula

\(\mathbf u(t)=\sum_j C_je^{\lambda_jt}\mathbf v_j\), for a complete real eigenbasis.

Quick example

For diagonal A with entries −1 and −2 and initial (2,1), the solution is \((2e^{-t},e^{-2t})\).

Worked example: A stable node with exact coordinates

Solve x′=−x, y′=−2y with initial state (2,1).

  1. Solutions are \(x=2e^{-t}\) and \(y=e^{-2t}\).
  2. Both rates are zero only at the origin, the equilibrium.
  3. Eliminating time gives \(y=x^2/4\) for this trajectory, with x>0.
  4. As time increases, both coordinates decrease toward zero. The phase curve has arrows inward; reversing time changes the direction.

7. Interpret nodes and spirals

Two real negative eigenvalues with independent directions give a stable node; two positive ones give an unstable node. Complex-conjugate eigenvalues have a real part controlling growth or decay and an imaginary part controlling rotation. Negative real part gives an inward spiral and positive gives an outward spiral in the appropriate nondegenerate linear case. Pure imaginary eigenvalues produce a centre for a linear system, not a general guarantee for every nonlinear system. Zero real parts require further analysis.

8. Coupled Euler updates must be simultaneous

Calculate both new components from the old pair: \(x_{n+1}=x_n+h(ax_n+by_n)\), \(y_{n+1}=y_n+h(cx_n+dy_n)\). Using the already updated x in the y calculation changes the numerical method. Record both derivatives before changing either state entry. A spreadsheet can make this dependency visible, but a mistaken reference can implement an unintended sequential update. Confirm one manual step before trusting a long numerical table.

Worked example: A simultaneous update

For x′=y, y′=−x, start at (1,0) and take Euler step h=0.1.

  1. At the old state, derivatives are x′=0 and y′=−1.
  2. The new state is (1,−0.1).
  3. Recompute both derivatives from this pair before the next step.
  4. This method may gradually distort the circular exact motion; a preserved-looking initial coordinate is not proof of exact numerical accuracy.

9. Convert a second-order equation to a system

Introduce v=x′. Then an equation \(x''+ax'+bx=0\) becomes \(x'=v\), \(v'=-bx-av\). The phase variables are position and velocity; initial position alone does not determine a unique solution, so initial velocity is also needed. The matrix eigenvalues connect damping and oscillation to the phase portrait. Do not omit the x multiplying b when translating the original equation into this form.

Worked example: A second-order damping model

Convert x′′+3x′+2x=0 to first-order matrix form.

  1. Set v=x′.
  2. Then x′=v and v′=−2x−3v.
  3. The coefficient matrix is \(\begin{pmatrix}0&1\\-2&-3\end{pmatrix}\), with eigenvalues −1 and −2.
  4. Both real eigenvalues are negative, so the origin is a stable node in this linear position-velocity phase space. Initial x and v select the trajectory.

10. Assess a model and numerical trajectory

Check initial values, equilibrium solutions and physically admissible ranges. A linear model can predict negative populations or unlimited growth even when real resources impose a bound. A numerical method can produce artificial instability when its step is too large. Compare smaller steps over the same final interval and, when possible, an analytic solution. State which features are model predictions and which are artifacts of an approximation. A diagram’s time arrows are necessary to distinguish inward from outward motion.

Quick formula reference

For revision once you understand the methods above. Check the conditions before using a formula.

Separated integration

\(\int\frac{dy}{h(y)}=\int g(x)\,dx\), where \(h(y)\ne0\).

Return to the explanation →

Euler update

\(x_{n+1}=x_n+h\), \(y_{n+1}=y_n+h f(x_n,y_n)\).

Return to the explanation →

Real-eigenvector solution

\(\mathbf u(t)=\sum_j C_je^{\lambda_jt}\mathbf v_j\), for a complete real eigenbasis.

Return to the explanation →

Learn to diagnose an error

Spot the mistake

The statement below is incorrect. Identify the missing condition or reasoning before opening the explanation.

Incorrect reasoning

A continuous system with eigenvalue −2 flips sign every time step.

Explain and repair the mistake

A continuous mode is multiplied by e^(−2t), which stays positive and decays for increasing t. Sign alternation belongs to repeated multiplication by a negative discrete eigenvalue, not to a negative exponent in continuous time.

03

Connect and apply

Put the ideas together

A more demanding application of this guide’s methods. This is a learning stage; any additional HL content is labelled separately.

Worked application

A numerical step can change stability

For y′=−2y, what multiplier does Euler use with step h?

  1. The update is \(y_{n+1}=y_n-2hy_n=(1-2h)y_n\).
  2. The exact continuous solution decays for forward time.
  3. Euler decays only when |1−2h|<1, giving 0<h<1.
  4. For h>1 its magnitude grows, an artificial instability of the numerical method rather than the original equation.
Pause and explain

What happens at h=0.75?

Check your reasoning

The Euler multiplier is −0.5, so it alternates sign while shrinking. The exact solution remains on its original sign branch. Numerical stability does not mean the approximation preserves every qualitative feature.

Common mistakes and how to avoid them

  • A continuous mode is multiplied by e^(−2t), which stays positive and decays for increasing t. Sign alternation belongs to repeated multiplication by a negative discrete eigenvalue, not to a negative exponent in continuous time.
  • Check excluded equilibria, initial conditions and the domain; not every matrix has a complete eigenbasis.
  • In a coupled system calculate all new components from the same old state, and assess step-size effects.
04

Practise independently

Build confidence, then apply it

Try each question before opening its hint or solution. If a method is new, return to the walkthrough, then try again. These learning stages describe the practice sequence; additional HL content is labelled separately.

  1. 1

    Build confidence

    HL extension

    Take the next Euler step with the same step size.

    Need a starting point?

    Recalculate the slope using 2.2.

    Show the worked solution
    1. The added change is \(0.1(2.2)=0.22\).
    2. The new value is 2.42 at t=0.2.
  2. 2

    Apply and explain

    HL extension

    For dx/dt=y and dy/dt=-x, start at (x,y)=(1,0). Take one Euler step of size 0.1.

    Need a starting point?

    Use both slopes from the old pair.

    Show the worked solution
    1. The old slopes are 0 and -1.
    2. The new pair is (1,-0.1). Using the updated x or y midway would change the stated method.
  3. 3

    Check your understanding

    Why should roots of h(y) be checked before dividing in y′=g(x)h(y)?

    Show the worked solution

    They may be constant equilibrium solutions. Division by h(y) excludes them from the separated calculation, even though they can satisfy the original differential equation.

  4. 4

    Use the method

    For x′=−x and y′=−2y at (2,1), compute one simultaneous Euler step of size 0.1.

    Show the worked solution

    The old derivatives are −2 and −2, so the new pair is (1.8,0.8). Both updates use the old state. The exact values at time 0.1 are different, because Euler is an approximation.

Finished? Use the linked question bank below to practise selecting the method without a guide telling you which rule to use.

Using these methods in exam questions

AI Paper 1

GDC required

Short-response questions still need mathematical setup and interpretation. Choose the correct tool, enter the model or data carefully, and check units and rounding.

AI Paper 2

GDC required

Extended-response questions connect several steps. Keep intermediate values at full precision and explain how each result answers the context.

For this topic: Distinguish a function value from a derivative value. For a tangent give both the point and slope; for an integral show the integrand and limits, then interpret the sign and units.

HL only · GDC required

Paper 3: build a connected argument

Both AA HL and AI HL Paper 3 contain two extended problem-solving questions. A question develops a theme, so keep useful earlier results, test small cases and explain any proposed general rule. A calculator pattern can suggest a result; your mathematical reasoning must support it.

  1. Identify what the first part establishes and record the conditions under which it holds.
  2. When a later part introduces a new definition or model, connect it to methods you already know rather than assuming a new formula must have been memorised.
  3. Check the conclusion against an earlier numerical case and explain its meaning or limitation.

For the first-assessment-2021 courses. IB assessment reference ↗

Find a specific method or formula

Now practise the method

If you opened this guide from a question, return to that tab and try the method without looking at the example. Your answer stays in the question tab.

Practise this subtopic →

Want a broader practice session? Explore IB Maths AI HL practice questions →Try free IB Maths exam-style questions and worked solutions →

Original Arc Practice teaching notes for Maths AI. Core and HL sections are distinguished above. These notes follow the first-assessment-2021 course and are not an official IB publication or a complete syllabus checklist. IB course reference. Report a correction.