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′=x yy' = x\,y

y=C ex22\displaystyle y = C\,e^{\frac{x^{2}}{2}}
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)=xg(x) = x and h(y)=yh(y) = y, 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

    Here h(y)=yh(y) = y, so the yy side integrates to a logarithm.

    ln⁡∣y∣=x22+C0\ln\left|y\right| = \frac{x^{2}}{2} + C_0
  4. Solve for y

    Exponentiate and absorb the constant ±eC0\pm e^{C_0} into one constant CC; C=0C = 0 gives the constant solution.

    y=C ex22y = C\,e^{\frac{x^{2}}{2}}
  5. Result

    The general solution, with arbitrary constants.

Worked examples