de calculator

Differential Equation (DE) Calculator

Approximate the solution of a first-order differential equation of the form dy/dx = f(x, y) using Euler, Heun, or RK4 methods.

Use JavaScript-style math: sin(x), exp(x), sqrt(x), log(x), and ^ for powers.
Enter values and click Calculate to see the approximation.

What this de calculator does

This de calculator solves initial value problems numerically. If you know an equation for the rate of change, such as dy/dx = x + y, and an initial condition like y(0) = 1, the calculator estimates the value of y at a future point.

Instead of requiring an exact symbolic solution, it computes the answer in small increments. That makes it useful for equations that are difficult—or impossible—to solve by hand.

How to use it

1) Enter your differential equation

Type the right-hand side of dy/dx = f(x, y) in the equation box. For example, if your equation is dy/dx = x + y, enter x + y.

2) Set your initial condition and target point

  • x₀: starting x-value
  • y₀: starting y-value (the value of y at x₀)
  • xtarget: where you want to evaluate y
  • Steps: how many increments to use between x₀ and xtarget

3) Choose a method

  • Euler: fastest, least accurate for many problems
  • Heun: better accuracy using a predictor-corrector approach
  • RK4: usually the best balance of stability and accuracy
Tip: Increasing the number of steps often improves accuracy, especially for rapidly changing systems.

Supported expression syntax

You can use common math functions in the equation field:

  • sin(x), cos(x), tan(x)
  • exp(x), log(x), sqrt(x), abs(x)
  • pi for π
  • ^ for powers (example: y^2)

Example problem

Suppose your model is dy/dx = y - x² + 1 with y(0) = 0.5, and you want y(2). Enter:

  • Equation: y - x^2 + 1
  • x₀: 0
  • y₀: 0.5
  • xtarget: 2
  • Steps: 20 (or more)
  • Method: RK4

The result gives an approximation of the solution at x = 2, plus a step-by-step table so you can inspect the numeric path.

When to use numerical DE tools

Numerical methods are practical in real-world modeling: population dynamics, cooling/heating, finance, epidemiology, control systems, and chemical kinetics. A quick de calculator lets you test assumptions and compare scenarios quickly.

For critical applications, always validate your model assumptions and compare multiple step sizes to check convergence.

🔗 Related Calculators