Processed online by Toolvito
Differential Equation Solver
Type an ordinary differential equation such as y'' + y = 0 or dy/dx = x y, with conditions such as y(0) = 1 if you have them. You get the general or particular solution with the method and its steps, a graph and checks. Euler’s method and Runge–Kutta give numerical solutions step by step.
How to solve a differential equation
- Type the equation with y', y'' (or dy/dx, d2y/dx2), such as y'' - 3y' + 2y = x or dy/dx = x y. Use x or t as the variable.
- Optional: type the conditions one per line, such as y(0) = 1 and y'(0) = 0, for the particular solution.
- Leave the method on Automatic, or choose one (separation of variables, integrating factor, …) to see its steps. Select Solve.
- For a system, type one equation per line, such as x' = 3x + 4y and y' = -4x + 3y, with conditions such as x(0) = 1, y(0) = 0.
Methods and their steps
- Separable: dy/dx = g(x)·h(y), so ∫dy/h(y) = ∫g(x) dx + C. Linear first order: y′ + P(x)·y = Q(x) with the integrating factor μ = e^(∫P dx).
- Exact, Bernoulli (v = y^(1−n)) and homogeneous (y = u·x) equations.
- Linear with constant coefficients: the characteristic equation (try y = e^(rx)); real, repeated and complex roots give e^(rx), x·e^(rx) and e^(ax)·cos(bx), e^(ax)·sin(bx); a right side is handled by undetermined coefficients or variation of parameters.
- Cauchy–Euler: x²y″ + a·x·y′ + b·y = 0 with y = x^r and the indicial equation. Power series for equations without a closed form near a point.
- With conditions the constants C1, C2 … are found from the equations they give. Systems x′ = A·x use the eigenvalues and eigenvectors of A.
- Partial differential equations (heat, wave, Laplace equations) are not solved here; Laplace-transform methods are on the Laplace Transform Calculator.
Numerical solutions
- Choose Numerically and give the starting conditions, the end point and the step size h. Euler’s method, the improved Euler (Heun) method, the midpoint method and the classical Runge–Kutta method (RK4) show every step in a table; RK45 and LSODA choose the step themselves.
- Each step is compared with a high-accuracy reference solution (SciPy DOP853 with tolerance 10⁻¹²) and, when SymPy finds it, with the exact solution, so the error of the method is shown.
- An equation of order 2 or more is written as a system of first-order equations first.
Graphs and checks
- The solution of an initial value problem is drawn with points of an independent numerical solution. A first-order general solution is drawn for several values of the constant, over its slope field (direction field).
- Every solution is put back into the equation (SymPy checkodesol), each condition is checked, and an initial value problem is compared with SciPy’s solver at many points. A job stops after about a minute rather than giving a guess.