Since 2010 · Powering 2M+ tool runs every month
Since 2010
Add to Chrome

My Toolbox

Automatic Mode

No saved tools yet.

Go Premium
Related tools
First-Order ODE SolverSecond-Order ODE SolverSystem of ODEs SolverEuler's Method CalculatorRunge-Kutta (RK4) Method CalculatorDirection Field / Slope Field PlotterDilution Calculator
Home Page > Math > Calculus

Bernoulli ODE Solver

Solve Bernoulli differential equations step by step. Applies the v = y^(1-n) substitution to linearize the equation, builds the integrating factor, finds the closed-form solution and plots the particular curve against the slope field.

Free to useNo sign-up requiredInstant Results
Bernoulli ODE SolverTry it now — free ▼
y' + P(x) · y = Q(x) · y n
Use x, standard functions (sin, cos, exp, log, sqrt), * for multiplication and ^ or ** for powers. The exponent n can be an integer, a fraction like 3/2, or a decimal.

Embed Bernoulli ODE Solver Widget

About Bernoulli ODE Solver

The Bernoulli ODE Solver tackles one of the most famous nonlinear first-order differential equations — the Bernoulli equation y' + P(x)y = Q(x)yn — and turns the classic textbook derivation into an interactive, step-by-step walkthrough. It linearizes the equation via the substitution v = y1−n, builds the integrating factor μ(x), and overlays the resulting closed-form curve on an RK4 numerical solution and a slope field so you can see every detail at once.

What Is a Bernoulli Differential Equation?

Introduced by Jacob Bernoulli in 1695, a Bernoulli equation is a first-order ODE of the form

y' + P(x) · y = Q(x) · yn,  n ∈ ℝ

When n = 0 the equation is already linear; when n = 1 it is separable. For every other real n the equation is nonlinear, but the classic substitution v = y1−n converts it into a linear ODE in v, which can be solved with the standard integrating factor trick.

The Six-Step Bernoulli Method

Starting from y' + P(x)y = Q(x)yn:

  1. Divide by yn: \( y^{-n}y' + P(x)\,y^{1-n} = Q(x) \).
  2. Substitute v = y1−n: note that \( v' = (1-n)y^{-n}y' \), so \( y^{-n}y' = v'/(1-n) \).
  3. Linearize: \( v' + (1-n)P(x)\,v = (1-n)Q(x) \) — a first-order linear ODE in v.
  4. Integrating factor: \( \mu(x) = \exp\!\left(\int (1-n)P(x)\,dx\right) \), so \( (\mu v)' = \mu(1-n)Q(x) \).
  5. Solve for v(x): \( v(x) = \frac{1}{\mu(x)}\left[\mu(x_0)v_0 + \int_{x_0}^{x}\mu(t)(1-n)Q(t)\,dt\right] \).
  6. Back-substitute: \( y(x) = v(x)^{1/(1-n)} \).

When the integrals involved are elementary you recover a clean closed form; when they are not, the calculator evaluates them numerically using Simpson's rule to plot the solution curve.

Special Cases Handled Automatically

Exponent n Equation becomes How it's solved
n = 0 y' + P(x)y = Q(x) (linear) Integrating factor directly; no substitution needed.
n = 1 y' = (Q(x) − P(x))·y (separable) y(x) = y₀·exp(∫(Q−P) dx) — the Bernoulli substitution would divide by 1−n = 0, so this case is handled separately.
n = 2 Logistic-style: y' + Py = Qy² Standard Bernoulli with v = 1/y. Appears in population dynamics and chemical kinetics.
n = ½ y' + Py = Q√y v = √y. Watch out: requires y ≥ 0.
Non-integer n Any real exponent allowed Requires y > 0 (otherwise yn = en ln y would be complex). The solver flags this.

Worked Example — n = 2, Logistic-Style

Consider y' + y/x = x·y² with initial condition y(1) = 1. Here P(x) = 1/x, Q(x) = x, and n = 2, so 1 − n = −1.

  1. Substitute v = y−1 = 1/y. Then v' = −y−2y' and the equation becomes v' − (1/x)v = −x.
  2. Integrating factor: μ(x) = exp(∫−1/x dx) = 1/x.
  3. (μ·v)' = μ·(−x) = −1. Integrate: (1/x)·v = −x + C, i.e. v = −x² + Cx.
  4. Apply IC: at x = 1, v = 1/1 = 1, so 1 = −1 + C ⇒ C = 2. Hence v(x) = −x² + 2x.
  5. Back-substitute: y(x) = 1/v(x) = 1/(2x − x²) = 1/(x(2 − x)).

The closed-form solution y = 1/(x(2−x)) has vertical asymptotes at x = 0 and x = 2 — exactly the kind of thing a slope field makes obvious at a glance.

How to Use This Calculator

  1. Fill in the equation builder. Type P(x) and Q(x) into the blue slots, and the exponent n into the small superscript box. The layout mirrors the standard form y' + P(x)y = Q(x)yn.
  2. Set the initial condition (x₀, y₀) and the plotting range [x min, x max]. The range should contain x₀.
  3. Click Solve. The calculator detects whether you are in a special case (n = 0 or n = 1) and shows the matching derivation. Otherwise it runs the full six-step Bernoulli substitution with MathJax-rendered equations.
  4. Read the plot. The orange curve is the RK4 numerical solution. The blue dashed curve is the closed form evaluated via the integrating factor. The arrow field shows y' everywhere, so you can eyeball other solutions too.
  5. Copy a CSV of sample points if you want to import the trajectory into another program.

Tips, Pitfalls, and Edge Cases

Where Bernoulli Equations Appear

Frequently Asked Questions

What is a Bernoulli differential equation?

A Bernoulli equation is a first-order ODE of the form y' + P(x)y = Q(x)yn, where P and Q are continuous functions and n is any real number. It is a classic example of a nonlinear ODE that can be transformed into a linear one via the substitution v = y1−n.

How does the substitution v = y1−n work?

Multiply the original equation by y−n so every y term becomes y1−n or y−ny'. Setting v = y1−n gives v' = (1−n)y−ny'. Substituting transforms the Bernoulli equation into v' + (1−n)P(x)v = (1−n)Q(x), which is linear in v and solvable with an integrating factor.

What happens when n = 0 or n = 1?

When n = 0 the equation is already linear first-order, so no substitution is required. When n = 1 the Bernoulli recipe would divide by 1 − n = 0, so we handle it separately: the equation collapses to y' = (Q(x) − P(x))·y, which is separable with the closed-form solution y = y₀·exp(∫(Q−P) dx).

Can Bernoulli equations always be solved in closed form?

In principle yes, but the resulting integrals involving the integrating factor may not have elementary antiderivatives. When that happens the calculator evaluates them numerically with Simpson's rule and plots the solution curve. The method itself always reduces a Bernoulli ODE to quadratures.

Why do negative y and non-integer n cause trouble?

If n is not an integer, yn is defined as exp(n·ln y) and is only real for y > 0. Feeding a negative y would produce a complex number. The solver flags this situation and asks for y₀ > 0 or an integer exponent so the solution stays real-valued.

What does the slope field show?

The slope field is a grid of tiny tangent segments whose angle equals y' at that (x, y) point. Any solution curve is forced to follow these tangents, so the slope field lets you see the qualitative shape of all solutions at once, with the initial condition singling out the particular curve.

Further Reading

Reference this content, page, or tool as:

"Bernoulli ODE Solver" at https://MiniWebtool.com/bernoulli-ode-solver/ from MiniWebtool, https://MiniWebtool.com/

by miniwebtool team. Updated: Apr 23, 2026

You can also try our AI Math Solver GPT to solve your math problems through natural language question and answer.

Calculus:

Top & Updated:

Related Rates SolverRecurrence Relation SolverLogarithmic Equation SolverView all →
Home Page > Math > Calculus > Bernoulli ODE Solver