Linear and Bernoulli equations

Most first-order differential equations resist every elementary trick — separation fails, the equation is not exact — yet a huge and useful class still yields to a single clean idea: multiply by the right function and the left side collapses into the derivative of a product. That function is the integrating factor, and the equations it tames are the linear first-order ODEs. Sitting right beside them is Bernoulli's equation, which looks stubbornly nonlinear because of a yny^n term, but a one-line substitution converts it into exactly the linear form already solved. Together these two techniques are the third leg of the MA10001 ODE toolkit, after separable and exact equations, and they are exam-heavy precisely because the method is mechanical once the pattern is recognized. This article rebuilds the integrating factor from first principles, shows why the Bernoulli substitution is not a lucky guess but a forced choice, and works two problems end to end so the machinery is visible at every step.

The core insight

Multiplying a linear ODE y′+Py=Qy' + Py = Q by the integrating factor e∫P dxe^{\int P\,dx} turns the left side into the exact derivative ddx(y⋅e∫P dx)\frac{d}{dx}(y\cdot e^{\int P\,dx}), so integrating solves it directly, and Bernoulli's equation y′+Py=Qyny' + Py = Qy^n reduces to this same linear form via the substitution v=y1−nv = y^{1-n}.

The core idea

A first-order linear ODE is any equation that can be written in the standard form

dydx+P(x) y=Q(x),\frac{dy}{dx} + P(x)\,y = Q(x),

where: P(x)P(x) and Q(x)Q(x) are given functions of xx only — crucially, yy appears just to the first power and never multiplied by itself or by dy/dxdy/dx. Standard form matters because the method that follows only works once the coefficient of dy/dxdy/dx is exactly 11; if the original equation has some other coefficient in front, you must divide through first before reading off P(x)P(x). The central device is the integrating factor

IF(x)=e∫P(x) dx,\mathrm{IF}(x) = e^{\int P(x)\,dx},

where: the integral ∫P(x) dx\int P(x)\,dx can be any one antiderivative of PP (the arbitrary constant of integration is deliberately dropped here, since it only rescales the whole IF by a nonzero constant that cancels later). Multiplying the standard-form equation by IF\mathrm{IF} makes the left side collapse into a single derivative,

ddx[y⋅IF]=Q(x)⋅IF,\frac{d}{dx}\big[y\cdot \mathrm{IF}\big] = Q(x)\cdot \mathrm{IF},

after which one integration finishes the job:

y⋅IF=∫Q(x)⋅IF dx+C.y\cdot \mathrm{IF} = \int Q(x)\cdot \mathrm{IF}\,dx + C.

Bernoulli's equation looks like a small variation but is genuinely nonlinear:

dydx+P(x) y=Q(x) yn,n≠0,1.\frac{dy}{dx} + P(x)\,y = Q(x)\,y^n, \qquad n \neq 0, 1.

(When n=0n=0 or n=1n=1 the right side is already linear in yy, so no substitution is needed at all — a common exam trap is not noticing this shortcut.) Dividing through by yny^n and substituting v=y1−nv = y^{1-n} turns it, after a short chain-rule step, into a linear equation for v(x)v(x), which the integrating-factor method above then solves; back-substituting y=v1/(1−n)y = v^{1/(1-n)} recovers the answer.

Figure
Diagram showing a nonlinear Bernoulli equation reduced by substitution v equals y to the power one minus n into a linear equation solved by an integrating factor then back substituted to y
From Bernoulli to linear and back y' + Py = Qy^n nonlinear Bernoulli v = y^(1-n) v' + (1-n)Pv = (1-n)Q linear in v IF = e^∫Pdx v(x) found by IF then y = v^(1/(1-n)) The substitution exponent 1-n is chosen so the chain rule exactly produces the term left over after dividing by y^n.
Derivation AWhy the integrating factor solves the linear ODE

The goal is to prove that multiplying the standard-form equation y′+P(x)y=Q(x)y' + P(x)y = Q(x) by the chosen function IF=e∫P dx\mathrm{IF}=e^{\int P\,dx} makes the left-hand side collapse exactly into the derivative of the single product y⋅IFy\cdot \mathrm{IF}, because that collapse is precisely what allows one plain integration to finish solving any first-order linear ODE no matter what P(x)P(x) and Q(x)Q(x) happen to be, and the same chain-rule idea is what later justifies the Bernoulli substitution.

Step 1. Multiply the standard-form equation through by IF\mathrm{IF}: IF⋅y′+IF⋅P⋅y=IF⋅Q\mathrm{IF}\cdot y' + \mathrm{IF}\cdot P\cdot y = \mathrm{IF}\cdot Q. Nothing has been assumed about IF\mathrm{IF} yet beyond it being some positive function of xx.

Step 2. Differentiate IF=e∫P dx\mathrm{IF} = e^{\int P\,dx} using the chain rule: ddx(IF)=e∫P dx⋅P(x)=IF⋅P(x)\dfrac{d}{dx}(\mathrm{IF}) = e^{\int P\,dx}\cdot P(x) = \mathrm{IF}\cdot P(x). This is the one property that makes the choice of IF\mathrm{IF} special — its own derivative is itself times PP.

Step 3. Recognize the product rule in reverse. By the product rule, ddx[y⋅IF]=y′⋅IF+y⋅ddx(IF)=y′⋅IF+y⋅IF⋅P\dfrac{d}{dx}\big[y\cdot \mathrm{IF}\big] = y'\cdot \mathrm{IF} + y\cdot \dfrac{d}{dx}(\mathrm{IF}) = y'\cdot\mathrm{IF} + y\cdot \mathrm{IF}\cdot P, which is exactly the left side obtained in Step 1. So the equation from Step 1 is identically ddx[y⋅IF]=Q⋅IF\dfrac{d}{dx}[y\cdot \mathrm{IF}] = Q\cdot \mathrm{IF}.

Step 4. Integrate both sides with respect to xx and divide by IF\mathrm{IF}: y=1IF(∫Q⋅IF dx+C)y = \dfrac{1}{\mathrm{IF}}\left(\displaystyle\int Q\cdot \mathrm{IF}\,dx + C\right). This is the general solution for every linear first-order ODE, and it shows the same reasoning explains Bernoulli's substitution: the exponent 1−n1-n in v=y1−nv = y^{1-n} is chosen precisely so that dvdx=(1−n)y−ndydx\dfrac{dv}{dx} = (1-n)y^{-n}\dfrac{dy}{dx} supplies exactly the y−ndy/dxy^{-n}dy/dx term left over after dividing y′+Py=Qyny'+Py=Qy^n by yny^n — nothing about either method is arbitrary.

Worked example

Solve dydx+2xy=x2\dfrac{dy}{dx} + \dfrac{2}{x}y = x^2 for x>0x>0, given y(1)=1y(1)=1, and then extend the same equation family to a Bernoulli version.

Step 1. Read off P(x)=2/xP(x) = 2/x and Q(x)=x2Q(x) = x^2; the equation is already in standard form.

Step 2. Compute the integrating factor: IF=e∫(2/x) dx=e2ln⁡x=x2\mathrm{IF} = e^{\int (2/x)\,dx} = e^{2\ln x} = x^2.

Step 3. Multiply through by IF=x2\mathrm{IF}=x^2 and recognize the product-rule collapse: x2dydx+2xy=x4  ⟹  ddx(x2y)=x4x^2\dfrac{dy}{dx} + 2xy = x^4 \implies \dfrac{d}{dx}(x^2 y) = x^4.

Step 4. Integrate both sides: x2y=∫x4 dx=x55+Cx^2 y = \displaystyle\int x^4\,dx = \dfrac{x^5}{5} + C, so y=x35+Cx2y = \dfrac{x^3}{5} + \dfrac{C}{x^2}.

Step 5. Apply y(1)=1y(1)=1: 1=15+C  ⟹  C=451 = \dfrac{1}{5} + C \implies C = \dfrac{4}{5}, giving the particular solution

y=x35+45x2.y = \frac{x^3}{5} + \frac{4}{5x^2}.

Competitive stretch

Now solve the related Bernoulli equation dydx−y=xy3\dfrac{dy}{dx} - y = xy^3, where P=−1P=-1, Q=xQ=x, n=3n=3. Dividing by y3y^3 gives y−3y′−y−2=xy^{-3}y' - y^{-2} = x. Substituting v=y1−n=y−2v = y^{1-n} = y^{-2}, so v′=−2y−3y′v' = -2y^{-3}y', transforms the equation into the linear form v′+2v=−2xv' + 2v = -2x. Its integrating factor is e2xe^{2x}, giving ddx(ve2x)=−2xe2x\frac{d}{dx}(ve^{2x}) = -2xe^{2x}; integrating the right side by parts yields ve2x=−xe2x+12e2x+C1ve^{2x} = -xe^{2x} + \tfrac{1}{2}e^{2x} + C_1, so v=−x+12+C1e−2xv = -x + \tfrac{1}{2} + C_1e^{-2x}. Back-substituting v=y−2v=y^{-2} gives the implicit general solution

1y2=−x+12+C1e−2x.\frac{1}{y^2} = -x + \frac{1}{2} + C_1 e^{-2x}.

This is the general solution of the Bernoulli equation, expressed implicitly in yy.

Common traps

  • Reading off P(x)P(x) before the equation is in standard form. Always divide through so the coefficient of dy/dxdy/dx is exactly 11 first; skipping this gives the wrong P(x)P(x) and a useless integrating factor.
  • Forgetting the integrating factor multiplies every term. It must be applied to Q(x)Q(x) as well as the left side — a common arithmetic slip that silently drops a term.
  • Mis-forming the Bernoulli substitution. Using v=ynv=y^n instead of v=y1−nv=y^{1-n}, or losing the factor (1−n)(1-n) when computing dv/dxdv/dx, wrecks the reduction to a linear equation.
  • Missing the n=0n=0 or n=1n=1 shortcut. These special cases are already linear and need no substitution at all — trying to substitute anyway just adds unnecessary work.
  • Dropping the final constant CC. It is fine (and conventional) to omit the constant when computing ∫P dx\int P\,dx for the integrating factor itself, but the constant of integration in the general solution must never be dropped.

Ask the tutor: stuck computing an integrating factor with a tricky ∫P(x) dx\int P(x)\,dx, or want to double-check a Bernoulli substitution on a new example? Ask the AI tutor to work through it with you step by step.

Why can we ignore the constant of integration when computing the integrating factor, but not in the final answer?

Any antiderivative of P(x)P(x) works inside IF=e∫P dx\mathrm{IF}=e^{\int P\,dx} because adding a constant kk there multiplies IF\mathrm{IF} by the fixed nonzero number eke^k, which cancels on both sides of the equation once you divide back through — it changes nothing about the solution. The constant CC that appears after the final integration is different: it is not a fixed multiplier but a genuine free parameter labelling the whole family of solutions, and dropping it throws away information needed to match an initial condition.

How do I tell quickly whether an ODE is linear, Bernoulli, or neither?

Write it in the form y′+P(x)y=(right side)y' + P(x)y = (\text{right side}). If the right side is just Q(x)Q(x), with no yy at all, it is linear. If the right side is Q(x)ynQ(x)y^n for some constant power n≠0,1n\neq 0,1, it is Bernoulli. If yy appears any other way — inside a sine, under a square root with other terms, multiplied by y′y', and so on — neither method applies directly, and you should look for separability or exactness instead.

Does the Bernoulli substitution always give a linear equation, no matter what n is?

Yes, as long as nn is a constant different from 00 and 11. The algebra in the derivation above never used a specific value of nn; it only used that dividing by yny^n and setting v=y1−nv=y^{1-n} makes dv/dxdv/dx proportional to y−ndy/dxy^{-n}dy/dx, which is exactly the term that division produced. This works whether nn is a positive integer, a fraction, or negative — the resulting equation in vv is always linear in vv with coefficients (1−n)P(x)(1-n)P(x) and (1−n)Q(x)(1-n)Q(x).

Before this

Where this leads