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=y2,y(0)=12y' + y = y^{2},\quad y(0) = \frac{1}{2}

y=11+ex\displaystyle y = \frac{1}{1 + e^{x}}

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

General solution

y=11+C ex\displaystyle y = \frac{1}{1 + C\,e^{x}}
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 = 2.

  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=1Q = 1 and n=2n = 2.

    y′+y=y2y' + y = y^{2}
  3. Substitution v = y^(1-n)

    Put v=y1−n=y−1v = y^{1-n} = y^{-1}. 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′−v=−1v' - v = -1
  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∫−1 dx=e−x\begin{aligned} \mu(x) &= e^{\int P(x)\,dx} \\ &= e^{\int -1\,dx} \\ &= e^{-x} \end{aligned}
  5. Integrate both sides

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

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

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

    1y=1+C ex\frac{1}{y} = 1 + C\,e^{x}
  7. General solution

    The solution with arbitrary constants.

    y=11+C exy = \frac{1}{1 + C\,e^{x}}
  8. Initial conditions

    Substitute y(0)=12y(0) = \frac{1}{2} into the general solution and solve for the constant.

    C=1C = 1
  9. Result

    The particular solution that satisfies the initial conditions.

    y=11+exy = \frac{1}{1 + e^{x}}

Worked examples