Connect via MCP →

Enter Calculation

Formula

Advertisement

Results

y(xn) — approximate value at endpoint
0.7652614605
Euler approximation with step size h = 0.02
Subdivisions n 50
Step size h 0.02
k xk yk
0 0 0
1 0.02 0.02
2 0.04 0.039992
3 0.06 0.0599600128
4 0.08 0.0798881087
5 0.1 0.0997604665
6 0.12 0.1195614235
7 0.14 0.1392755248
8 0.16 0.1588875714
9 0.18 0.1783826662
10 0.2 0.1977462587
11 0.22 0.216964187
12 0.24 0.2360227179
13 0.26 0.2549085834
14 0.28 0.2736090157
15 0.3 0.2921117778
16 0.32 0.310405192
17 0.34 0.3284781643
18 0.36 0.3463202062
19 0.38 0.3639214525
20 0.4 0.3812726761
21 0.42 0.398365299
22 0.44 0.4151914008
23 0.46 0.4317437228
24 0.48 0.4480156699
25 0.5 0.4640013091
26 0.52 0.4796953648
27 0.54 0.495093212
28 0.56 0.5101908662
29 0.58 0.5249849718
30 0.6 0.5394727874
31 0.62 0.5536521696
32 0.64 0.5675215551
33 0.66 0.5810799408
34 0.68 0.5943268629
35 0.7 0.6072623745
36 0.72 0.6198870226
37 0.74 0.6322018242
38 0.76 0.6442082413
39 0.78 0.6559081561
40 0.8 0.6673038459
41 0.82 0.6783979575
42 0.84 0.6891934817
43 0.86 0.6996937286
44 0.88 0.7099023023
45 0.9 0.7198230767
46 0.92 0.7294601715
47 0.94 0.7388179287
48 0.96 0.74790089
49 0.98 0.7567137752
50 1 0.7652614605

What this calculator does

This tool numerically solves a first-order ordinary differential equation of the form \(y' = F(x, y)\) with the initial condition \(y(x_0) = y_0\), using the classic forward (explicit) Euler method. It marches from \(x_0\) to \(x_n\) in \(n\) equal steps and returns the step size \(h\), a full table of \((x, y)\) approximations, and the approximate endpoint value \(y(x_n)\).

How to use it

Enter the right-hand side \(F(x, y)\) as a math expression in the variables \(x\) and \(y\) (operators + - * / ^, parentheses, and functions such as sin, cos, exp, log/ln, sqrt, abs, plus the constants pi and e). Set the starting point \(x_0\), the initial value \(y_0\), the endpoint \(x_n\), and choose the number of subdivisions \(n\). Larger \(n\) gives a smaller step and generally a more accurate result.

The formula explained

The step size is $$h = \frac{x_n - x_0}{n},$$ and the grid points are \(x_k = x_0 + k \cdot h\). Starting from \(y_0\), each new value is computed as $$y_{k+1} = y_k + h \cdot F(x_k, y_k):$$ the slope \(F\) is sampled at the current point and used to take a straight-line step of width \(h\). The method is first-order accurate, so the global error scales like \(O(h)\).

Advertisement
Euler method stepping along the tangent line from one point to the next
Each Euler step follows the tangent slope \(F(x,y)\) for one step size \(h\), drifting from the true curve.

Worked example

For \(y' = 1 - y^2\) with \(x_0 = 0\), \(y_0 = 0\), \(x_n = 1\) and \(n = 5\), the step size is \(h = 0.2\). The iteration gives \(y_1 = 0.2\), \(y_2 = 0.392\), \(y_3 = 0.5612672\), \(y_4 \approx 0.6982668\), \(y_5 \approx 0.8007513\). So the Euler estimate at \(x = 1\) is about \(0.8008\). The exact solution is \(\tanh(x)\), so \(\tanh(1) \approx 0.7616\); increasing \(n\) drives the Euler value toward this true value.

Table of Euler iteration steps with x and y columns
The worked example builds a step-by-step table of \(x_k\) and \(y_k\) values up to the endpoint \(x_n\).

FAQ

Why is my answer different from the exact solution? Euler's method is only first-order accurate. The error shrinks roughly in proportion to \(h\), so picking a larger \(n\) (smaller step) improves accuracy.

Can \(x_n\) be smaller than \(x_0\)? Yes. The step size \(h\) becomes negative and the same recurrence integrates backwards.

What functions are supported? sin, cos, tan, asin, acos, atan, sinh, cosh, tanh, exp, log/ln, log10, sqrt and abs, along with the constants pi and e.

Last updated: