Differential equation calculator
Type a differential equation to solve it step by step. This calculator handles separable and linear first-order equations, and second-order linear equations. Add initial conditions to get one exact solution, and see it on a graph.
- Write it in standard form, y′ + p(x)y = q(x): p(x) = 2 and q(x) = e^x
- The integrating factor is μ = e^(∫p dx). Here ∫p dx = 2x, so μ = e^(2x)
- Multiply through by μ. The left side becomes the derivative of μy: (e^(2x) · y)′ = e^(3x)
- Integrate both sides: e^(2x) · y = e^(3x)/3 + C
- Divide by μ: y = Ce^(−2x) + e^x/3
- Use y(0) = 1 to find the constant: C = 2/3
- So y = 2e^(−2x)/3 + e^x/3
Checked: the formula was substituted back into the equation at several points before being shown.
Open in the graphing calculator →How to solve a differential equation here
- 1Type your equation. Write the derivative as
y',y''ordy/dx, as iny' + 2y = e^x. - 2If you have initial conditions, type them in the second box, such as
y(0) = 1. A second-order equation needs two:y(0) = 1, y'(0) = 2. - 3Read the solution, follow the steps, and check the curves on the graph.
What it can solve
| Type | Example | Method |
|---|---|---|
| Direct integration | y' = x^2 + 1 | Integrate both sides |
| Separable | y' = x y | Move y to one side and x to the other, then integrate |
| Linear first-order | y' + 2y = e^x | Integrating factor |
| Second-order, constant coefficients | y'' - 3y' + 2y = 0 | Characteristic equation |
| With a right-hand side | y'' + y = sin(x) | Undetermined coefficients |
| Cauchy–Euler | x^2 y'' + x y' - y = 0 | Try y = xʳ |
Worked example: a separable equation
Solve y′ = xy with y(0) = 3. The right side is a function of x times a function of y, so the variables can be separated:
- Divide by y and multiply by dx: dy/y = x dx.
- Integrate both sides: ln|y| = x²/2 + c.
- Take exponentials: y = Ce^(x²/2), where C can be any number.
- Use the condition: y(0) = C = 3, so y = 3e^(x²/2).
Dividing by y assumes y isn’t zero, so check that case separately. Here, y = 0 is also a solution, and it happens to be the formula with C = 0.
Worked example: an integrating factor
A linear first-order equation has the form y′ + p(x)y = q(x). Multiplying by μ = e^(∫p dx) turns the left side into the derivative of a product. For y′ + 2y = eˣ:
- Here p = 2, so μ = e^(2x).
- Multiplying through gives (e^(2x) y)′ = e^(3x).
- Integrate: e^(2x) y = e^(3x)/3 + C.
- Divide by μ: y = eˣ/3 + Ce^(−2x).
Second-order equations
For ay″ + by′ + cy = 0, trying y = e^(rx) gives the characteristic equation ar² + br + c = 0. Its roots decide the form of the solution:
| Roots | Solution | Looks like |
|---|---|---|
| Two real roots, r₁ and r₂ | C₁e^(r₁x) + C₂e^(r₂x) | Growth or decay |
| One repeated root, r | (C₁ + C₂x)e^(rx) | The boundary between the other two |
| Complex roots, a ± bi | e^(ax)(C₁ cos(bx) + C₂ sin(bx)) | Oscillation that grows or fades |
Two constants need two conditions, which is why a second-order problem gives both y and y′ at a starting point. If the equation has a right-hand side, such as a sine or an exponential, the calculator adds a particular solution of the same shape.
What it can’t solve
Most differential equations have no formula at all. An equation as simple as y′ = x² + y² has no solution in terms of ordinary functions, and y′ = e^(x²) leads to an integral with none either. This calculator also doesn’t handle partial differential equations, or equations above second order, or methods like variation of parameters and Laplace transforms.
When it can’t find a formula, it says so rather than guessing, and offers a slope field instead. That shows every solution’s shape, and the graphing calculator can trace any of them numerically.
How the answers are checked
Before showing a formula, the calculator differentiates it, puts it back into your equation and compares both sides at several points, for several values of the constants. If they don’t match, you see a message instead of an answer. Occasionally a formula only holds on part of the number line. For example, y = (x/2 + C)² solves y′ = √y only where x/2 + C ≥ 0. The page tells you when that happens. You can run the same check by hand, and it’s good practice.
Frequently asked questions
How do I type a derivative?
What is the difference between a general and a particular solution?
How many initial conditions do I need?
Why did it say there is no formula?
Does it show steps?
Is it free?
Related tools and guides
Direction fields for dy/dx = f(x, y), with solutions through any point.
Antiderivatives and definite integrals, exact where possible.
Symbolic derivatives with the rules shown step by step.
The S-curve from 0 to 1, midpoint (0, ½).
Draw a slope field, drag a starting point, and watch the solution curve follow it.