Skip to content
ihateDesmos

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.

Solution with y(0) = 1
y = 2e^(−2x)/3 + e^x/3
General solution
y = Ce^(−2x) + e^x/3
Type
First-order linear
Steps
  1. Write it in standard form, y′ + p(x)y = q(x): p(x) = 2 and q(x) = e^x
  2. The integrating factor is μ = e^(∫p dx). Here ∫p dx = 2x, so μ = e^(2x)
  3. Multiply through by μ. The left side becomes the derivative of μy: (e^(2x) · y)′ = e^(3x)
  4. Integrate both sides: e^(2x) · y = e^(3x)/3 + C
  5. Divide by μ: y = Ce^(−2x) + e^x/3
  6. Use y(0) = 1 to find the constant: C = 2/3
  7. So y = 2e^(−2x)/3 + e^x/3
−2−1.5−1−0.50.511.525101520(0, 1)
The solution through your starting point.

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

  1. 1
    Type your equation. Write the derivative as y', y'' or dy/dx, as in y' + 2y = e^x.
  2. 2
    If 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.
  3. 3
    Read the solution, follow the steps, and check the curves on the graph.

What it can solve

TypeExampleMethod
Direct integrationy' = x^2 + 1Integrate both sides
Separabley' = x yMove y to one side and x to the other, then integrate
Linear first-ordery' + 2y = e^xIntegrating factor
Second-order, constant coefficientsy'' - 3y' + 2y = 0Characteristic equation
With a right-hand sidey'' + y = sin(x)Undetermined coefficients
Cauchy–Eulerx^2 y'' + x y' - y = 0Try 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:

  1. Divide by y and multiply by dx: dy/y = x dx.
  2. Integrate both sides: ln|y| = x²/2 + c.
  3. Take exponentials: y = Ce^(x²/2), where C can be any number.
  4. 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ˣ:

  1. Here p = 2, so μ = e^(2x).
  2. Multiplying through gives (e^(2x) y)′ = e^(3x).
  3. Integrate: e^(2x) y = e^(3x)/3 + C.
  4. 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:

RootsSolutionLooks 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 ± bie^(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?
Use an apostrophe for each order, as in y′ and y″, or write dy/dx and d^2y/dx^2. If your equation uses t, as in dy/dt = t y, that works too, and the answer is written with x.
What is the difference between a general and a particular solution?
A general solution contains arbitrary constants and describes every solution. A particular solution is one curve, found by using initial conditions to fix those constants.
How many initial conditions do I need?
One for each order. A first-order equation needs one, y(0) = 1. A second-order equation needs two, y(0) = 1 and y′(0) = 2, at the same value of x.
Why did it say there is no formula?
Most differential equations can’t be solved in ordinary functions, and some can but need a method this calculator doesn’t have. It tells you which case it is as far as it can, and links to a slope field so you can still see the solutions.
Does it show steps?
Yes. It names the type of equation and method, then shows each stage: the integrating factor or characteristic equation, the integrals, and how the constants are found.
Is it free?
Yes, with no sign-up. It runs in your browser.

Related tools and guides

See the solutions move

Draw a slope field, drag a starting point, and watch the solution curve follow it.

Open the calculator