Differential Equations Visualizer
Pick a first-order ODE of the form dy/dx = f(x, y). The slope field shows the local direction of solutions at every grid point. Click anywhere on the plot to drop an initial condition. The tool uses classical fourth-order Runge-Kutta integration to draw the solution curve forward and backward through that point.
Click anywhere in the field to draw a solution curve through that point.
Current ODE
Solutions grow or decay exponentially. The general solution is y = C·exp(x).
How to read this
- Each tiny segment in the field shows the slope dy/dx at that point.
- Click anywhere on the plot to drop an initial condition. RK4 integrates forward and backward.
- Curves running parallel to nearby segments confirm the numerical solution agrees with the field.
Controls
Reference Guide
What a slope field shows
A first-order ODE dy/dx = f(x, y) assigns a slope to every point in the xy-plane. A slope field draws a short segment with that slope at each grid point. Solutions of the ODE are curves that stay tangent to the segments everywhere they pass.
Once you can read a slope field by eye, you can sketch how solutions behave without solving the equation. Look for horizontal segments (where f equals zero) to find equilibrium lines, and look for steep segments to spot regions of rapid growth.
Example
For the field is flat along y = 0 and y = 1. Solutions starting between those two values rise toward y = 1.
RK4 vs Euler
Forward Euler advances by using a single slope evaluation. Its global error scales like h.
The classical fourth-order Runge-Kutta method (RK4) takes four slope samples per step and combines them as a weighted average. Its global error scales like h to the fourth power, which means a step size of 0.05 with RK4 is already much more accurate than Euler at the same h.
| Method | Slope evals | Global error |
|---|---|---|
| Euler | 1 | O(h) |
| Midpoint | 2 | O(h²) |
| RK4 | 4 | O(h⁴) |
Autonomous vs non-autonomous
An ODE is autonomous when f depends only on y, not on x. Examples include and . The slope field of an autonomous ODE looks the same on every horizontal slice, so its segments form columns of identical arrows.
A non-autonomous ODE has explicit x dependence. Examples include and . The field changes left to right and curves can cross horizontal lines in non-trivial ways.
Equilibrium solutions of an autonomous ODE are horizontal lines where f(y) is zero. They are stable when f is negative just above and positive just below the line, and unstable when the signs flip.
How to use this tool
- Choose a preset f(x, y) from the dropdown, or type your own expression in the custom input.
- Click anywhere on the plot to drop an initial condition. The tool integrates from that point in both directions.
- Adjust step size h for finer accuracy. Smaller h takes longer but tracks the true solution more closely.
- Adjust curve length to extend or shorten how far each curve follows the field.
- Use the share button to copy a link that captures the equation, view, and every initial condition you placed.
Custom expression syntax
Variables x and y. Constants pi and e. Operators + - * / ^ . Functions sin, cos, tan, exp, log, sqrt, abs. Parentheses for grouping.