Separable Differential Equation Calculator

Type y' = g(x)h(y), and optionally an initial condition, to separate and integrate.

Write y' and y'' (or dy/dx and d^2y/dx^2): y' + 2y = 4 or y'' - 3y' + 2y = 0. Type powers with ^ and functions with brackets: e^x, sin(x), ln(x).

Optional: one condition such as y(0) = 2. Leave empty for the general solution, with its constant C.

Try

Result

You enteredy′=y2y' = y^{2}

y=−1x+C\displaystyle y = -\frac{1}{x + C}

The constant function y = 0 is also a solution of the equation: it was lost when both sides were divided by y^n.

Show the work
  1. Type of equation

    The right side of y' is a product g(x)h(y), so this equation is separable.

  2. Separation of variables

    The right side is a product of a function of xx and a function of yy, g(x)=1g(x) = 1 and h(y)=y2h(y) = y^{2}, so the variables can be separated.

    Using dyh(y)=g(x) dx\frac{dy}{h(y)} = g(x)\,dx

    dydx=g(x) h(y)  ⇒  dyh(y)=g(x) dx\begin{aligned} \frac{dy}{dx} &= g(x)\,h(y) \;\Rightarrow\; \frac{dy}{h(y)} \\ &= g(x)\,dx \end{aligned}
  3. Integrate both sides

    With h(y)=y2h(y) = y^{2} the yy side integrates by the power rule.

    ∫dyh(y)=∫1y2 dy=−1y=x+C\begin{aligned} \int \frac{dy}{h(y)} &= \int \frac{1}{y^{2}}\,dy \\ &= -\frac{1}{y} \\ &= x + C \end{aligned}
  4. Solve for y

    Take reciprocals; the constant is renamed so that the sum reads naturally.

    y=−1x+Cy = -\frac{1}{x + C}
  5. Result

    The general solution, with arbitrary constants.

Worked examples