Differential Equation Solver
Solve ordinary differential equations step by step. First-order separable, linear and homogeneous equations and second-order linear equations with constant coefficients are solved symbolically and checked by substitution; anything else is solved numerically with RK4, with a slope field or phase plot.
How to Use
- Type the equation using
y'(ordy/dx) for the first derivative andy''for the second — e.g.dy/dx = 3x^2ory'' + 3y' + 2y = 0. - For an initial-value problem, fill in x₀ and y(x₀), and y′(x₀) for a second-order equation. Clear the boxes for the general solution with C, or C₁ and C₂.
- The method is picked for you: direct integration, separable, first-order linear (integrating factor), homogeneous (v = y/x), or the characteristic equation for second-order equations with constant coefficients.
- Read the general solution and the IVP solution. A solution that passes the substitution check is marked verified ✓; an equation with no symbolic method is solved numerically with RK4.
- The graph shows a slope field with your solution curve for first-order equations and a phase plot of y′ against y for second-order IVPs. Show Work has the working, step by step.
Slope field & solution
Worked Example
y″ + 3y′ + 2y = 0, y(0) = 1, y′(0) = 0. The characteristic equation r² + 3r + 2 = (r + 1)(r + 2) = 0 has roots −1 and −2, so y = C₁e^(−x) + C₂e^(−2x). The conditions give C₁ + C₂ = 1 and −C₁ − 2C₂ = 0, so C₁ = 2, C₂ = −1 and y = 2e^(−x) − e^(−2x). At x = 1 that is 0.6004.
y′ = y − x, y(0) = 2. In the form y′ + P y = Q, P = −1 and Q = −x, so the integrating factor is μ = e^(−x). ∫ −x e^(−x) dx = (x + 1)e^(−x), so y = x + 1 + Ceˣ, and y(0) = 2 gives C = 1: y = x + 1 + eˣ, which is 2 + e = 4.71828 at x = 1.
The common mistake: fitting the constants before adding the particular solution. For y″ + y = x with y(0) = 0 and y′(0) = 0, fitting C₁cos x + C₂sin x to the conditions alone gives C₁ = C₂ = 0 and y = 0 everywhere. The particular solution y_p = x has to be added first; then y′(0) = C₂ + 1 = 0 gives C₂ = −1 and y = x − sin x, which is 1.0907 at x = 2, not 0.
Show Work
Formulas
From Leibniz to Runge and Kutta
Differential equations are as old as calculus. Gottfried Wilhelm Leibniz found the method of separating variables in 1691, and Jacob Bernoulli posed the equation that carries his name in 1695. Leonhard Euler showed in 1743 how to solve linear equations with constant coefficients by substituting e^(rx), which turns the equation into the polynomial now called the characteristic equation.
Pierre-François Verhulst proposed the logistic equation for population growth in 1838. For equations with no formula solution, Carl Runge published a multi-stage numerical method in 1895, and Wilhelm Kutta developed it in 1901 into the fourth-order scheme, RK4, that is still the default in many solvers.
About This Tool
This solver reads an ordinary differential equation as you type it, picks a symbolic method, shows the steps and checks the answer by substitution. Initial conditions turn the general solution into the specific one, and when no symbolic method applies, the solution is computed with RK4 and drawn on a slope field or, for second-order equations, a phase plot as well.
Everything runs in your browser; nothing is uploaded.
Related tools: Calculus Workbench, Euler’s Method Calculator, and Integral Calculator.
Frequently Asked Questions
Which equations can it solve symbolically?
First-order: y′ = f(x) by direct integration, separable y′ = g(x)·h(y), linear y′ + P(x)y = Q(x) with the integrating factor μ = e^(∫P dx), and homogeneous y′ = F(y/x) with v = y/x. Second-order: ay″ + by′ + cy = g(x) with constant a, b, c, using the characteristic equation for distinct, repeated or complex roots and undetermined coefficients for polynomial, exponential and sine or cosine forcing. y′ = y − x with y(0) = 2, for example, is linear and gives y = x + 1 + eˣ.
How do I know the answer is right?
A first-order solution is substituted back into the equation at x = 0.3, 0.8, 1.3, 1.8 and 2.3, and dy/dx must match f(x, y) to about 0.1%; a particular solution of a second-order equation is checked the same way at four points. Solutions that pass are marked “verified ✓”. When the forcing term has no symbolic method, such as y″ + y = sin x (resonance), the initial-value problem is solved with RK4 instead.
What is an initial-value problem?
A differential equation plus enough conditions to fix the arbitrary constants: one, y(x₀) = y₀, for a first-order equation and two, y(x₀) and y′(x₀), for a second-order one. dy/dx = 3x² has the general solution y = x³ + C; y(0) = 2 gives C = 2 and y = x³ + 2.
How accurate is the RK4 numerical solution?
Very accurate at the step size used here, 200 steps per unit of x (h = 0.005). The logistic equation y′ = y(1 − y) with y(0) = 0.1 has no symbolic method in this tool, so the curve is drawn from RK4; at x = 2 the RK4 value is 0.4508530604, and the exact value 1/(1 + 9e^(−2)) differs by less than 10⁻¹². RK4’s error falls with h⁴: for y′ = y even h = 0.1 gives y(1) = 2.718280, 2 × 10⁻⁶ below e.
What do slope fields and phase plots show?
A slope field draws a short segment of slope f(x, y) at each point of a 27 × 19 grid, so the family of solutions is visible at a glance, with your solution drawn through its starting point. A phase plot draws y′ against y over 12 units of x: y″ + y = 0 traces a closed circle, while the damped y″ + 2y′ + 5y = 0 spirals in to (0, 0).
How do I use the Differential Equation Solver?
Just type your numbers. The answer shows up right away — there is no button to press. Change anything and it updates by itself.
Is it free? Does it work without internet?
Yes to both. It is free with no sign-up, and once the page has loaded it keeps working even with no internet.
Where does my data go?
Nowhere — every calculation runs on your own device. Nothing you enter is uploaded, logged, or stored.
Common Use Cases
Coursework
Check that y = 2e^(−x) − e^(−2x) solves y″ + 3y′ + 2y = 0 with y(0) = 1 and y′(0) = 0.
Vibrations
y″ + 2y′ + 5y = 0 has roots −1 ± 2i: an oscillation at angular frequency 2 that decays like e^(−x).
Cooling and decay
y′ = −0.1(y − 20) with y(0) = 90 gives y = 20 + 70e^(−0.1x), so y(10) = 45.75.
Population models
The logistic preset reaches half its capacity at x = ln 9 ≈ 2.197.
Teaching
The method, the characteristic roots, the slope field and the solution curve on one screen.
Last updated: