Bernoulli Equation Calculator

Type y' + P(x)y = Q(x)y^n, and optionally an initial condition, to solve it.

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′+y=x y3y' + y = x\,y^{3}

1y2=x+12+C e2x\displaystyle \frac{1}{y^{2}} = x + \frac{1}{2} + C\,e^{2x}

The constant function y = 0 is also a solution of the equation; it is not in the family above.

Show the work
  1. Type of equation

    The equation has the form y' + P(x)y = Q(x)y^n, a Bernoulli equation with n = 3.

  2. Bernoulli equation

    The equation has the form y′+P(x)y=Q(x)yny' + P(x)y = Q(x)y^n with P=1P = 1, Q=xQ = x and n=3n = 3.

    y′+y=x y3y' + y = x\,y^{3}
  3. Substitution v = y^(1-n)

    Put v=y1−n=y−2v = y^{1-n} = y^{-2}. Dividing by yny^n and using v′=(1−n)y−ny′v' = (1-n)y^{-n}y' turns the equation into a linear one in vv.

    Using v′+(1−n)P(x) v=(1−n)Q(x)v' + (1-n)P(x)\,v = (1-n)Q(x)

    v′−2v=−2xv' - 2v = -2x
  4. Integrating factor

    Multiply the equation by μ(x)=e∫P(x) dx\mu(x) = e^{\int P(x)\,dx}: the left side then becomes (μv)′(\mu v)'.

    μ(x)=e∫P(x) dx=e∫−2 dx=e−2x\begin{aligned} \mu(x) &= e^{\int P(x)\,dx} \\ &= e^{\int -2\,dx} \\ &= e^{-2x} \end{aligned}
  5. Integrate both sides

    Now (μv)′=μQ(\mu v)' = \mu Q, so integrate μQ\mu Q and divide by μ\mu.

    μv=∫−2x e−2x dx=x e−2x+e−2x2+C\begin{aligned} \mu v &= \int -2x\,e^{-2x}\,dx \\ &= x\,e^{-2x} + \frac{e^{-2x}}{2} + C \end{aligned}
  6. Back-substitute

    Solve for vv and replace vv by y−2y^{-2}.

    1y2=x+12+C e2x\frac{1}{y^{2}} = x + \frac{1}{2} + C\,e^{2x}
  7. Result

    The general solution, with arbitrary constants.

Worked examples