Bernoulli ODE Solver screenshot

Bernoulli ODE Solver

Solve y′ + P(x)y = Q(x)yⁿ numerically with Euler or RK4, stating the substitution and printing the solution table.

Privacy First
0 Runs
Updated 2026-11-22
Runs in your browser
No sign-up, no upload
Numeric table

Bernoulli ODE Solver

Solve y′ + P(x)y = Q(x)yⁿ numerically with Euler or RK4, stating the substitution and printing the solution table.

How this page computes

A Bernoulli equation has the form y′ + P(x)y = Q(x)yⁿ. The page builds that slope from your P and Q, integrates it with Euler or RK4, and prints the numeric solution table.

On y′ + y = y² with y(0) = 0.5 the exact solution is 1/(1+eˣ), so y(1) is about 0.2689; RK4 with ten steps of 0.1 reaches 0.268941439862. The page prints the method's order and the step count beside the table.

The substitution u = y^(1−n) that turns the equation linear is stated on the page, but the page integrates the original form. When n is not an integer and the solution reaches y ≤ 0, it refuses because yⁿ is then not real.

The calculation runs entirely in this browser tab; nothing is uploaded.

The page solves a Bernoulli equation numerically rather than pretending to a closed form. For y′ + y = y² with y(0) = 0.5, RK4 with ten steps of 0.1 gives y(1) ≈ 0.268941439862, while the exact 1/(1+e) is 0.26894142137.

The substitution u = y^(1−n) is printed because it is the standard way to linearise the equation, but the table comes from integrating the original slope. The method, its order, the step and the step count are all stated.

How to use Bernoulli ODE Solver

Type P(x), the coefficient of y, then Q(x) and the exponent n.

Set the initial condition, the step h and the number of steps, and choose RK4 or Euler.

Press Run. The output prints the substitution, the method and the table; read the final line for the endpoint value.

How the method works

Euler takes one slope per step and is first order; RK4 averages four slopes and is fourth order, which is why the same step count gives a visibly better answer. The page prints the order so the comparison is fair.

The equation is integrated in its original form because the substitution can introduce its own domain problem: u = y^(1−n) is not real for every y when n is fractional. The page's refusal at y ≤ 0 is the same fact, stated where it happens.

What to Expect

Best for

  • A numeric solution table for a Bernoulli equation
  • Comparing Euler and RK4 at the same step
  • Seeing the substitution that linearises the equation

Not ideal for

  • A symbolic closed form
  • A solution that crosses y = 0 with a fractional n
  • A stiff equation that needs an implicit method

What this tool keeps

  • P, Q, n and the initial condition exactly as typed

What may need cleanup

  • Nothing when the walk is finite; the refusal names the step when it is not

Common errors

  • A zero initial y is refused for n > 0
  • A fractional n with a negative y is refused
  • A non-finite slope is refused with the step and x

Example use cases

  • Solve y′ + y = y² from y(0) = 0.5
  • Compare Euler and RK4 on the same step
  • See a solution that approaches a finite limit

Sample input

P = 1, Q = 1, n = 2, y(0) = 0.5, h = 0.1, 10 steps, RK4

Sample output

final y(1) ≈ 0.268941439862, against the exact 1/(1+e) = 0.26894142137

Who this is for

  • Students meeting Bernoulli equations
  • Readers comparing Euler and RK4

Frequently asked questions

Why not solve it symbolically?

A Bernoulli equation can be linearised by u = y^(1−n), but the resulting integral may have no elementary form and the substitution has a domain restriction. The page states the substitution and gives a numeric table it can defend.

Which method should I choose?

RK4 for accuracy at the same step count; Euler to see the first-order method and its error. Both print their order, so the comparison is explicit.

Why does it stop when y goes negative?

For a fractional n, yⁿ is not real when y < 0, so the real-valued solution ends there. The page refuses at that step rather than printing a complex or NaN value.

Developer program

Build custom tools for your store

Join the SDK program to create useful ecommerce utilities for your store.