Differential Equation Calculator

CalculusFreeNo sign-up

Type an ODE such as y′′ + 3y′ + 2y = eˣ. The characteristic equation \(r^{2} + 3r + 2 = 0\) has roots −1 and −2, so \(y = C_{1}e^{-x} + C_{2}e^{-2x} + \frac{e^{x}}{6}\). Add initial conditions to get the one particular solution, and every answer is checked by substitution.

FreeStep by stepInitial value problems

Write derivatives as y’, y”, y”’ or dy/dx. Use x (or t) as the variable.

One condition per order of the equation.

Try:
General solution
\(\displaystyle y = C_{1} e^{-x} + C_{2} e^{-2x} + \frac{e^{x}}{6}\)
C₁ and C₂ are any constants.
xy0−3.0−2.5−2.0−1.5−1.0−0.50.51.01.52.02.53.0−6−4−2246

Several solutions from the general solution.

Type Linear, constant coefficients, order 2 (non-homogeneous)
Characteristic equation \(r^{2} + 3r + 2 = 0\)
Roots \(r = -1,\ r = -2\)
Particular solution \(y_{p} = \frac{e^{x}}{6}\)
Check Substituting y back into the equation gives 0 = 0 ✓
Show steps
  1. This is a linear equation with constant coefficients of order 2: \(y^{\prime\prime} + 3 y^{\prime} + 2 y = e^{x}\)
  2. Characteristic equation (replace \(y^{(k)}\) by \(r^{k}\)): \(r^{2} + 3r + 2 = 0\)
  3. Roots: \(r = -1,\quad r = -2\)
  4. Homogeneous solution: \(y_{h} = C_{1} e^{-x} + C_{2} e^{-2x}\)
  5. Find a particular solution yₚ for the right side \(g(x) = e^{x}\) (undetermined coefficients, checked with the Laplace transform): \(y_{p} = \frac{e^{x}}{6}\)

How to use the differential equation calculator

  1. Type the equation with y′ written as y’ (and y′′ as y”), or use dy/dx.
  2. Add initial conditions like y(0) = 1, y'(0) = 0 to solve an initial value problem, or leave them blank for the general solution.
  3. Press Solve. The method, each step, a check by substitution and a graph appear below.

Supported exactly: separable and linear first-order equations, and linear equations of any order up to 4 with constant coefficients whose right side is built from polynomials, exponentials, sines and cosines. Other first-order equations with an initial condition are solved numerically.

Linear equations with constant coefficients

For \(ay^{\prime\prime} + by^{\prime} + cy = g(x)\):

  1. Solve the characteristic equation \(ar^{2} + br + c = 0\).
  2. Build the homogeneous solution \(y_{h}\) from the roots (table below).
  3. Find a particular solution \(y_{p}\) for g(x) by undetermined coefficients.
  4. General solution: \(y = y_{h} + y_{p}\). Use initial conditions to find the constants.
Roots Homogeneous solution
Real, different: \(r_{1}, r_{2}\) \(C_{1}e^{r_{1}x} + C_{2}e^{r_{2}x}\)
Repeated: \(r\) \((C_{1} + C_{2}x)e^{rx}\)
Complex: \(\alpha \pm \beta i\) \(e^{\alpha x}(C_{1}\cos\beta x + C_{2}\sin\beta x)\)

First-order equations

Separable: \(\frac{dy}{dx} = g(x)h(y)\). Separate and integrate: \(\int \frac{dy}{h(y)} = \int g(x)\,dx + C\). Example: \(\frac{dy}{dx} = xy\) gives \(\ln|y| = \frac{x^{2}}{2} + C\), so \(y = Ce^{x^{2}/2}\).

Linear: \(\frac{dy}{dx} + P(x)y = Q(x)\). Multiply by the integrating factor \(\mu = e^{\int P\,dx}\): \((\mu y)^{\prime} = \mu Q\), so \(y = \frac{1}{\mu}\left(\int \mu Q\,dx + C\right)\). Example: \(y^{\prime} + 2y = 4x\) gives \(y = 2x – 1 + Ce^{-2x}\).

Worked example: initial value problem

\(y^{\prime\prime} + 3y^{\prime} + 2y = e^{x}\), \(y(0) = 1\), \(y^{\prime}(0) = 0\). The general solution is \(C_{1}e^{-x} + C_{2}e^{-2x} + \frac{e^{x}}{6}\). The conditions give \(C_{1} + C_{2} + \frac{1}{6} = 1\) and \(-C_{1} – 2C_{2} + \frac{1}{6} = 0\), so \(C_{1} = \frac{3}{2}\) and \(C_{2} = -\frac{2}{3}\):

\(y = \frac{3}{2}e^{-x} – \frac{2}{3}e^{-2x} + \frac{1}{6}e^{x}\)

Resonance and repeated terms

If g(x) already solves the homogeneous equation, the usual guess fails and must be multiplied by x. For \(y^{\prime\prime} + y = \sin x\), the particular solution is \(y_{p} = -\frac{x\cos x}{2}\), whose amplitude grows: this is resonance.

Differential equations practice quiz: 10 questions

Test yourself with 10 multiple-choice questions. Choose an answer and press Submit to see if you are right and why. Your score appears at the end.

Question 1 of 10
1. The order of y′′ + 3y′ = x is…

Found a mistake? Let us know!

2. General solution of y′ = 3y?

Found a mistake? Let us know!

3. Characteristic equation of y′′ − 5y′ + 6y = 0?

Found a mistake? Let us know!

4. Roots 2 and 3 give the homogeneous solution…

Found a mistake? Let us know!

5. y′′ + 9y = 0 has solution…

Found a mistake? Let us know!

6. A repeated root r = −1 gives…

Found a mistake? Let us know!

7. Integrating factor for y′ + 2y = 4x?

Found a mistake? Let us know!

8. y′ = 2y with y(0) = 5 gives…

Found a mistake? Let us know!

9. How many initial conditions does a 2nd-order IVP need?

Found a mistake? Let us know!

10. Which equation is separable?

Found a mistake? Let us know!

Frequently asked questions

What types of differential equations can this solve?

Separable and linear first-order equations; linear equations up to order 4 with constant coefficients and right sides made of polynomials, exponentials, sines and cosines; and, with an initial condition, other first-order equations numerically.

How do I enter derivatives?

Type y' for the first derivative, y'' for the second and y''' for the third, or use dy/dx and d^2y/dx^2.

What is the difference between the general and the particular solution?

The general solution contains arbitrary constants (C₁, C₂, …) and describes every solution. Initial conditions pick out one particular solution.

How do I know the solution is right?

The calculator substitutes the solution back into the equation symbolically and checks that both sides agree at many points.

What if there is no formula?

For a first-order equation with an initial condition, the calculator uses the fourth-order Runge–Kutta method and shows a table of values and the curve over the slope field.

Sources

Related calculators

Browse all calculators

More calculus calculators

Browse all 354 calculators

Related to This Article

What people say about "Differential Equation Calculator (ODE Solver) with Steps"?

No one replied yet.

Leave a Reply