Differential Equation Solver is loading…
Type an equation using \(y’\) and \(y”\), like y'' - 3y' + 2y = 0. The solver figures out the type, picks the matching method (separation of variables, an integrating factor, or the characteristic equation), shows every step, and plugs the answer back into the equation to check it. Add \(x_0\), \(y(x_0)\) and \(y'(x_0)\) to solve an initial value problem.
Which Equations Can It Solve?
| Type | Looks like | Method | Example |
|---|---|---|---|
| First-order separable | \(y’ = g(x)\,h(y)\) | Separate and integrate | \(y’ = xy^2\) |
| First-order linear | \(y’ + P(x)y = Q(x)\) | Integrating factor | \(y’ + 2y = e^x\) |
| Second-order linear, constant coefficients | \(ay” + by’ + cy = g(x)\) | Characteristic equation, then a particular solution | \(y” – 3y’ + 2y = 0\) |
If your equation is not one of these, there may be no formula for the answer at all. In that case, use the Euler’s method calculator to get a numerical approximation and a graph.
How to Type Your Equation
- Use
y'for \(\frac{dy}{dx}\) andy''for \(\frac{d^2y}{dx^2}\). You can also typedy/dx. - Put a space or a star between letters:
x y'orx*y', notxy'. - The independent variable can be x or t. For example,
y'' + 9y = 0works with either. - Leave the initial-value boxes empty to get the general solution with constants \(C\), \(C_1\), \(C_2\).
Method 1: Separation of Variables
When \(y’\) equals a function of \(x\) times a function of \(y\), move all the \(y\)’s to one side and all the \(x\)’s to the other, then integrate both sides.
Example: \(y’ = xy^2\).
\[\frac{dy}{y^2} = x\,dx \;\Rightarrow\; -\frac{1}{y} = \frac{x^2}{2} + C \;\Rightarrow\; y = -\frac{1}{\frac{x^2}{2} + C}.\]
With \(y(0) = 1\), we get \(C = -1\), so \(y = \dfrac{1}{1 – x^2/2}\).
Method 2: The Integrating Factor
For a linear equation \(y’ + P(x)y = Q(x)\), multiply both sides by \(\mu(x) = e^{\int P(x)\,dx}\). The left side becomes the derivative of \(\mu y\), so you can integrate it in one step.
- Find \(\mu\). For \(y’ + 2y = e^x\), \(P = 2\), so \(\mu = e^{2x}\).
- Multiply through. \((e^{2x}y)’ = e^{2x}\cdot e^x = e^{3x}\).
- Integrate. \(e^{2x}y = \tfrac13 e^{3x} + C\).
- Solve for y. \(y = \tfrac13 e^{x} + Ce^{-2x}\).
The constant \(C\) is there for the same reason as the constant of integration in any antiderivative.
Method 3: The Characteristic Equation
For \(ay” + by’ + cy = 0\), guess \(y = e^{rx}\). This turns the differential equation into an ordinary quadratic, \(ar^2 + br + c = 0\). Solve it (the quadratic formula calculator helps), then use the table:
| Roots | General solution |
|---|---|
| Two real roots \(r_1 \ne r_2\) | \(y = C_1e^{r_1x} + C_2e^{r_2x}\) |
| One repeated root \(r\) | \(y = C_1e^{rx} + C_2\,x\,e^{rx}\) |
| Complex roots \(\alpha \pm \beta i\) | \(y = e^{\alpha x}\big(C_1\cos\beta x + C_2\sin\beta x\big)\) |
Example: \(y” – 3y’ + 2y = 0\) gives \(r^2 – 3r + 2 = (r – 1)(r – 2) = 0\), so \(y = C_1e^{2x} + C_2e^{x}\).
If the right side is not 0, the solver adds one particular solution using variation of parameters. For \(y” – 2y’ + y = e^x\) the answer is \(y = C_1e^x + C_2xe^x + \tfrac12x^2e^x\).
Initial Value Problems
A general solution is a whole family of curves. Initial conditions pick out one of them. A first-order equation needs one condition, \(y(x_0)\). A second-order equation needs two, \(y(x_0)\) and \(y'(x_0)\).
Example: \(y” + 4y = 0\) with \(y(0) = 1\) and \(y'(0) = 0\). The general solution is \(C_1\cos 2x + C_2\sin 2x\). The conditions give \(C_1 = 1\) and \(C_2 = 0\), so \(y = \cos 2x\). Try it with the example button above.
Learn the Math Behind the Differential Equation Solver
Solving a differential equation means finding a function from a rule about its derivatives. Initial values fix the constant of integration.
Frequently Asked Questions
How do I know my answer is right?
Plug it back in. Find \(y’\) and \(y”\), put them into the equation, and check that both sides match. The solver does this automatically and shows a “Verified” badge when the check passes.
Why is my textbook answer written differently?
Constants can be renamed and rearranged. For example, \(-\frac{1}{x^2/2 + C}\) and \(\frac{2}{K – x^2}\) are the same family with \(K = -2C\). Both are correct.
Can it solve systems or partial differential equations?
Not yet. This tool solves one ordinary differential equation for one unknown function \(y\). For transforms that turn equations into algebra, see the Laplace transform calculator.
What does “linear” mean for a differential equation?
It means \(y\) and its derivatives appear only to the first power and are never multiplied together. \(y” + xy = \sin x\) is linear; \(y’ = y^2\) is not.
Related Tools
- Euler’s method calculator for a numerical answer
- Wronskian calculator to check that two solutions are independent
- Laplace transform calculator