Ordinary Differential Equation Solver Calculator

Numerically solve IVPs with clear method controls. See stepwise dynamics and compare accuracy. Export tables for reliable reporting today.

Solve an initial value problem

Enter an equation, choose a method, and set an interval and step. This tool computes a numerical approximation step by step.

Example: x - y, sin(x) - y^2, exp(-x)*y
Example: -y, -0.2*v - y, sin(x) - y
Tip: RK4 is usually accurate for smooth problems.

Example data table

Example for first-order y' = x - y, with x₀=0, y₀=1, h=0.5.
Stepxyf(x,y)hy(next)
00.0000001.000000-1.0000000.5000000.500000
10.5000000.5000000.0000000.5000000.500000
21.0000000.5000000.5000000.5000000.750000

Formula used

The solver advances from (x_n, y_n) to (x_{n+1}, y_{n+1}) using step h.
Euler
y_{n+1} = y_n + h f(x_n, y_n)
Heun (Improved Euler)
y* = y_n + h f(x_n, y_n)
y_{n+1} = y_n + (h/2)[f(x_n,y_n) + f(x_{n+1}, y*)]
Midpoint
y_{n+1} = y_n + h f(x_n + h/2, y_n + (h/2) f(x_n,y_n))
RK4
k1 = f(x_n, y_n)
k2 = f(x_n + h/2, y_n + (h/2)k1)
k3 = f(x_n + h/2, y_n + (h/2)k2)
k4 = f(x_n + h, y_n + hk3)
y_{n+1} = y_n + (h/6)(k1 + 2k2 + 2k3 + k4)
Second-order conversion
y'' = g(x,y,y') with v = y' becomes: y' = v, v' = g(x,y,v)

How to use this calculator

  1. Choose Problem type: first-order or second-order.
  2. Enter the expression: f(x,y) or g(x,y,v).
  3. Set x₀, x₁, and step size h.
  4. Provide y₀, and for second-order also y'₀.
  5. Pick a method (RK4 is a strong default).
  6. Click Solve ODE to display the table and endpoint values.
  7. Use downloads to export the full table when needed.
Notes: Smaller h improves accuracy but increases steps. If results blow up, reduce h or change the method.

FAQs

1) What problems does this solver handle?
It solves initial value problems for first-order equations y'=f(x,y) and second-order equations y''=g(x,y,y'). Boundary value problems need different methods.
2) Which method should I choose for accuracy?
RK4 is typically accurate for smooth functions with moderate steps. Heun and Midpoint often improve over Euler at similar cost, but may still need smaller steps.
3) What does the Heun error estimate mean?
Heun computes a predictor and a corrected value. The difference between them is a simple local indicator. It is not a guaranteed global error bound.
4) Why do my results explode or become NaN?
The step may be too large for a stiff or unstable problem, or the expression may create huge values. Reduce h, shorten the interval, or try RK4.
5) What functions and variables can I use in expressions?
Use x, y, and v (for second-order). Common functions include sin, cos, tan, exp, log, sqrt, abs, and pow. Use ^ for powers.
6) Can it solve systems of many equations?
This version supports a scalar first-order equation or a converted two-state second-order form. For larger systems, extend the vector operations similarly.
7) How do I pick a good step size?
Start with a moderate h, then halve it and compare endpoints. If values change noticeably, continue reducing h until results stabilize for your tolerance.
8) What do CSV and PDF exports include?
Exports include your settings and the full step table. The PDF is a compact preview of the first rows, while CSV preserves all rows for analysis.

Related Calculators

taylor series expansion calculatorexact differential equation calculatorequilibrium points calculatornonhomogeneous differential equation calculatorsecond order differential equation calculatorrunge kutta method calculatorundetermined coefficients calculatorhigher order differential equation calculatorriccati equation solver

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.