# Midpoint method

This online calculator implements a direct midpoint method AKA modified Euler method, which is a second-order numerical method to solve a first-degree differential equation with a given initial value.

### This page exists due to the efforts of the following people:

#### Michele

Created: 2019-09-20 13:26:12, Last updated: 2020-12-11 14:12:44

This content is licensed under Creative Commons Attribution/Share-Alike License 3.0 (Unported). That means you may freely redistribute or modify this content under the same license conditions and must attribute the original author by placing a hyperlink from your site to this work https://planetcalc.com/8395/. Also, please do not modify any references to the original work (if any) contained in this content.

You can use this calculator to solve a first-degree differential equation with a given initial value using explicit midpoint method AKA modified Euler method.

To use this method, you should have differential equation in the form
$y \prime = f(x,y)$
and enter the right side of the equation f(x,y) in the y' field below.

You also need initial value as
$y(x_0)=y_0$
and the point $x$ for which you want to approximate the $y$ value.

The last parameter of a method - a step size- is a step along the tangent line to compute a function curve's successive approximation.

If you know the exact solution of a differential equation in the form y=f(x), you can enter it as well. In this case, the calculator also plots the solution along with approximation on the graph and computes the absolute error for each approximation step.

Method explanation can be found below the calculator.

#### Midpoint method

Digits after the decimal point: 2
Differential equation

Approximate value of y

Approximation
The file is very large. Browser slowdown may occur during loading and creation.

### Midpoint method

As with the Euler method we use the relation
$y_{i+1}=y_i + f \Delta x$

but compute f differently. Instead of using the tangent line at the current point to advance to the next point, we are using the tangent line at the midpoint, that is, an approximate value of the derivative at the midpoint between current and next points. To do this, we approximate the y value at the midpoint as
$y_n+\frac{\Delta x}{2}f(x_n, y_n)$

And our relation changes from
$y_{i+1}=y_i + f(x_i,y_i) \Delta x$

to

$y_{i+1}=y_i + f(x_i+\frac{\Delta x}{2}, y_i+\frac{\Delta x}{2}f(x_i, y_i)) \Delta x$

The local error at each step of the midpoint method is of order $O\left(h^3\right)$, giving a global error of order $O\left(h^2\right)$. Thus, while more computationally intensive than Euler's method, the midpoint method's error generally decreases faster as $h \to 0$.1

The method is an example of a family of higher-order methods known as Runge–Kutta methods.

URL copied to clipboard

#### Similar calculators

PLANETCALC, Midpoint method