5. Calculus

Numerical Solutions To Differential Equations

Numerical Solutions to Differential Equations

Introduction

students, this lesson explores how to find approximate solutions to differential equations when an exact formula is hard or impossible to get. In calculus, a differential equation is an equation that involves a function and one or more of its derivatives, such as $\frac{dy}{dx}=f(x,y)$. These equations are used to describe change in the real world 📈, including population growth, cooling, motion, and the spread of disease.

The key idea behind numerical solutions is simple: instead of solving the differential equation exactly, we build a sequence of approximations step by step. This is powerful because many important differential equations do not have neat closed-form solutions. By the end of this lesson, you should be able to explain the main terminology, use a basic numerical method, and connect this topic to the wider study of calculus.

Learning objectives

  • Explain what a numerical solution to a differential equation is.
  • Use a numerical method to approximate values of a solution.
  • Interpret the meaning of step size, initial condition, and approximation error.
  • Connect numerical methods to differentiation, integration, and modelling.

Why numerical methods are needed

A differential equation often describes how a quantity changes, but not every such equation can be solved exactly with algebraic methods. For example, the equation $\frac{dy}{dx}=x+y^2$ is not easy to solve by standard techniques at IB level. In situations like this, numerical methods let us estimate the solution at selected points.

This idea is common in science and engineering. For example, if a company models the temperature of a drink cooling in a room, or if a biologist models the number of bacteria in a lab culture, the exact function may be too complicated to write down neatly. A numerical method gives useful values that can be checked against data and used for predictions.

A numerical solution usually starts from an initial condition such as $y(x_0)=y_0$. This tells us where the solution begins. From there, we move forward in small steps of size $h$ to estimate the next value of the function. The smaller the step size, the more accurate the estimate is usually, although calculations become longer.

Euler’s method: the basic idea

The most important introductory numerical method is Euler’s method. It uses the slope of the tangent line to estimate the next point on the curve. If the differential equation is

$$\frac{dy}{dx}=f(x,y),$$

and we know a starting value $\left(x_0,y_0\right)$, then Euler’s method uses

$$y_{n+1}=y_n+h\,f\left(x_n,y_n\right),$$

with

$$x_{n+1}=x_n+h.$$

Here, $h$ is the step size. This formula says: take the current value $y_n$, then add the change predicted by the slope $f\left(x_n,y_n\right)$ multiplied by the step length $h$.

This works because the derivative $\frac{dy}{dx}$ represents the instantaneous rate of change. Over a very small interval, the curve behaves almost like a straight line. Euler’s method uses this local linear behaviour to estimate the next point. ✅

Example 1

Suppose

$$\frac{dy}{dx}=x+y$$

with initial condition $y(0)=1$, and step size $h=0.2$.

First point: $x_0=0$, $y_0=1$.

Using Euler’s method:

$$y_1=y_0+h\,f\left(x_0,y_0\right)=1+0.2\left(0+1\right)=1.2.$$

Then $x_1=0.2$.

Next step:

$$y_2=y_1+h\,f\left(x_1,y_1\right)=1.2+0.2\left(0.2+1.2\right)=1.48.$$

Then $x_2=0.4$.

So the approximate values are $\left(0,1\right)$, $\left(0.2,1.2\right)$, and $\left(0.4,1.48\right)$. These are not exact values, but they give a practical estimate of the solution curve.

Understanding step size, accuracy, and error

The step size $h$ is one of the most important features of a numerical method. If $h$ is large, the method moves quickly but may miss important changes in the curve. If $h$ is small, the method is usually more accurate, but it requires more calculations.

This is closely related to the idea of approximation error. The error is the difference between the numerical estimate and the true value. In reality, the true solution may be known only in special cases, so error is often estimated by comparing methods or by using a smaller step size and checking how much the answers change.

For example, if Euler’s method gives a value of $y=2.4$ at some point, and a smaller step size gives $y=2.38$, then the first estimate is probably not far from the true value. This does not prove exact accuracy, but it gives evidence that the estimate is reasonable.

In IB Mathematics: Analysis and Approaches HL, understanding accuracy is more important than memorizing a long list of formulas. You should be able to explain why reducing $h$ usually improves the approximation and why numerical answers should be treated as estimates rather than exact results.

Worked interpretation of the method

Think of walking along a path 🚶. At each point, the slope tells you which direction the path is heading. If you know your current position and the slope right there, you can take a small step in that direction. Euler’s method does exactly this on a graph.

Suppose the slope field for a differential equation shows that slopes are positive when $y$ is below a certain curve and negative when $y$ is above it. A numerical method can follow this pattern step by step. This makes differential equations more visual and easier to connect to graphs.

This is also why initial conditions matter. Two different initial values, such as $y(0)=1$ and $y(0)=3$, can produce two completely different solution curves even if the same differential equation is used. Numerical methods preserve this dependence on starting values.

Connecting numerical solutions to calculus

Numerical solutions are deeply connected to the rest of calculus.

First, they rely on differentiation, because a differential equation describes the derivative of a function. The expression $\frac{dy}{dx}$ gives the rate of change, and numerical methods use that rate to estimate future values.

Second, they relate to integration. Solving a differential equation can be seen as recovering a function from its rate of change, which is the reverse idea of differentiation. While exact integration may sometimes produce a formula, numerical methods offer an alternative when exact integration is difficult.

Third, numerical solutions are used in modelling. For example, if a tank is filling, the rate of change of volume may depend on the current volume. A model might take the form $\frac{dV}{dt}=g(t,V)$. A numerical method can then predict $V$ at later times.

Example 2: population growth model

Suppose a population $P$ satisfies

$$\frac{dP}{dt}=0.05P$$

with $P(0)=200$.

Using Euler’s method with step size $h=1$, we get

$$P_1=200+1\left(0.05\cdot 200\right)=210.$$

Then

$$P_2=210+1\left(0.05\cdot 210\right)=220.5.$$

This shows how numerical methods can estimate future population size. The method is easy to apply and gives a clear picture of growth over time.

In some cases, this equation can also be solved exactly, giving $P=200e^{0.05t}$. Comparing the exact formula with the numerical approximation helps show how numerical methods work and why they are useful. The numerical values will not match perfectly, but they can be close if the step size is suitable.

Limitations and good practice

Numerical methods are powerful, but they have limitations. The main limitation is that they do not give an exact formula. They only give approximations at chosen points. Another limitation is that if the step size is too large, the method may give poor results or even misrepresent the behaviour of the solution.

Sometimes a differential equation has rapid changes or sharp turns. In such cases, Euler’s method may be less reliable. More advanced numerical methods, such as the improved Euler method or Runge-Kutta methods, give better accuracy, but Euler’s method is the foundation for understanding them.

Good mathematical practice means writing down the differential equation clearly, stating the initial condition, showing each step in the calculation, and interpreting the result in context. If the answer represents a quantity like temperature or population, students, always include the unit and explain what the value means in the real situation.

Conclusion

Numerical solutions to differential equations are a major part of calculus because they turn abstract rates of change into practical predictions. When an exact solution is difficult, a method like Euler’s method uses the derivative to estimate the function step by step. The ideas of slope, initial condition, step size, and error are central to understanding how the method works.

For IB Mathematics: Analysis and Approaches HL, this topic matters because it connects differentiation, modelling, and real-world applications. It shows how calculus is not only about exact formulas, but also about making accurate and useful approximations. 🌟

Study Notes

  • A differential equation contains a function and one or more derivatives, such as $\frac{dy}{dx}=f(x,y)$.
  • A numerical solution gives approximate values of the function at selected points.
  • An initial condition like $y(x_0)=y_0$ gives the starting point for the approximation.
  • Euler’s method uses $y_{n+1}=y_n+h\,f\left(x_n,y_n\right)$ and $x_{n+1}=x_n+h$.
  • The step size $h$ controls the balance between speed and accuracy.
  • Smaller $h$ usually means better accuracy, but more calculations.
  • Numerical error is the difference between an approximation and the true value.
  • Numerical methods are useful when exact solutions are difficult or impossible to find.
  • These methods connect directly to differentiation because they use slopes.
  • They also connect to integration because solving differential equations is related to reversing rates of change.
  • Real-world applications include population growth, cooling, motion, and fluid flow.
  • Euler’s method is the basic numerical method and helps build understanding of more advanced methods.

Practice Quiz

5 questions to test your understanding

Numerical Solutions To Differential Equations — IB Mathematics Analysis And Approaches HL | A-Warded