Linear differential equations

A first-order linear differential equation is one where the dependent variable and its derivative appear only to the first power — no y2y^2, no y⋅dydxy\cdot\dfrac{dy}{dx}, no sin⁡y\sin y. That simplicity is deceptive: the left-hand side still cannot be integrated directly as it stands. The fix is one of the neatest tricks in the calculus syllabus — multiply the whole equation by a cleverly chosen function, the integrating factor, and the messy left side collapses into the derivative of a single product. After that, solving is just integration. This article builds the standard form, shows exactly why the integrating factor works, and works through the exam-style calculations — including the case where it pays to solve for xx in terms of yy instead of the other way round.

The core insight

Multiplying dydx+Py=Q\dfrac{dy}{dx}+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)\dfrac{d}{dx}\big(y\cdot e^{\int P\,dx}\big), so the equation can be integrated directly to give y⋅I.F.=∫Q⋅I.F. dx+Cy\cdot\text{I.F.} = \int Q\cdot\text{I.F.}\,dx + C.

The core idea

Standard form. A first-order linear differential equation in yy is written as

dydx+Py=Q\frac{dy}{dx} + Py = Q

where: PP and QQ are functions of xx only (or constants) — never of yy. Getting the coefficient of dydx\dfrac{dy}{dx} down to exactly 11 before reading off PP and QQ is the first and most commonly skipped step.

The integrating factor. Define

I.F.=e∫P dx\text{I.F.} = e^{\int P\,dx}

Multiplying the standard-form equation through by this factor converts the left side into an exact derivative of a product:

ddx(y⋅I.F.)=Q⋅I.F.\frac{d}{dx}\big(y\cdot \text{I.F.}\big) = Q\cdot \text{I.F.}

Integrating both sides gives the general solution:

y⋅I.F.=∫Q⋅I.F. dx+Cy\cdot \text{I.F.} = \int Q\cdot \text{I.F.}\,dx + C

where: CC is the arbitrary constant of integration; a given initial condition pins it down to a particular solution.

Linear in xx instead. Sometimes the equation is more naturally linear in xx as a function of yy — this shows up when trying to isolate dydx\dfrac{dy}{dx} would leave QQ depending on yy, which the standard form forbids. The mirror-image toolkit is

dxdy+Px=Q,I.F.=e∫P dy,x⋅I.F.=∫Q⋅I.F. dy+C\frac{dx}{dy} + Px = Q, \qquad \text{I.F.}=e^{\int P\,dy}, \qquad x\cdot\text{I.F.} = \int Q\cdot\text{I.F.}\,dy + C

with P,QP,Q now functions of yy only. Recognising which variable is the natural dependent one — before committing to a form — saves a lot of wasted algebra.

Where this sits in the syllabus. This is the third and final solving technique in the Differential Equations section of the Calculus unit, coming after variable separable and homogeneous equations. ISC Class 12 restricts the method strictly to the first-order, first-degree linear form: you are asked to apply the stated integrating-factor formula, not to derive or prove it, and second-order linear equations lie outside the syllabus entirely.

General versus particular solution. The formula y⋅I.F.=∫Q⋅I.F. dx+Cy\cdot\text{I.F.} = \int Q\cdot\text{I.F.}\,dx + C produces the general solution — an entire family of curves, one for every real value of CC. A single extra piece of information, an initial condition such as y(0)=1y(0)=1, singles out one member of that family: substitute the given point into the general solution, solve for CC, and the result is the particular solution satisfying that condition. The picture below shows what the general solution actually looks like: a whole family of integral curves, one for each value of CC, all satisfying the same differential equation but passing through different points.

Figure
A family of solution curves for a first order linear differential equation, each curve corresponding to a different constant of integration, fanning out from near the origin
One equation, a family of solutions — each C gives a curve x y C = 2 C = 0 C = -2 y . I.F. = integral of Q . I.F. dx + C — same shape, shifted by C
Derivation AWhy the integrating factor makes the equation solvable

The goal is to show, using nothing beyond the product rule and the fundamental theorem of calculus, that multiplying dydx+Py=Q\dfrac{dy}{dx}+Py=Q by e∫P dxe^{\int P\,dx} is not an arbitrary trick but the unique choice that turns the left-hand side into the derivative of a single product, which is exactly what makes the equation directly integrable.

Step 1. Multiply the standard-form equation through by a to-be-determined factor μ(x)\mu(x): μdydx+Pμy=Qμ\mu\dfrac{dy}{dx} + P\mu y = Q\mu. The hope is that the left side is secretly ddx(yμ)\dfrac{d}{dx}(y\mu) for the right choice of μ\mu.

Step 2. Expand that target by the product rule: ddx(yμ)=μdydx+ydμdx\dfrac{d}{dx}(y\mu) = \mu\dfrac{dy}{dx} + y\dfrac{d\mu}{dx}. Comparing this with the left side of Step 1 term by term, the two match exactly when dμdx=Pμ\dfrac{d\mu}{dx} = P\mu.

Step 3. Solve that condition for μ\mu: it is a variable-separable equation, dμμ=P dx\dfrac{d\mu}{\mu} = P\,dx, which integrates to ln⁡μ=∫P dx\ln\mu = \int P\,dx, so μ=e∫P dx\mu = e^{\int P\,dx}. This is precisely the integrating factor — it exists because this one auxiliary equation is always solvable, whatever P(x)P(x) is.

Step 4. With μ=e∫P dx\mu = e^{\int P\,dx}, the left side of the multiplied equation is now guaranteed to equal ddx(y⋅I.F.)\dfrac{d}{dx}(y\cdot\text{I.F.}), so the whole equation reads ddx(y⋅I.F.)=Q⋅I.F.\dfrac{d}{dx}(y\cdot\text{I.F.}) = Q\cdot\text{I.F.}. Integrating both sides with respect to xx removes the derivative on the left and produces the general solution y⋅I.F.=∫Q⋅I.F. dx+Cy\cdot\text{I.F.} = \int Q\cdot\text{I.F.}\,dx + C.

Worked example

Solve dydx+2yx=x2\dfrac{dy}{dx} + \dfrac{2y}{x} = x^2, for x>0x>0, and find the particular solution given the general one.

Step 1. Identify PP and QQ. The equation is already in standard form with P=2xP=\dfrac{2}{x} and Q=x2Q=x^2.

Step 2. Compute the integrating factor. I.F.=e∫2x dx=e2ln⁡x=eln⁡x2=x2\text{I.F.} = e^{\int \frac{2}{x}\,dx} = e^{2\ln x} = e^{\ln x^2} = x^2 — the log laws simplify the exponential-of-log form down to a clean power of xx.

Step 3. Multiply through and recognise the exact derivative. x2dydx+2xy=x4  ⟹  ddx(y⋅x2)=x4x^2\dfrac{dy}{dx} + 2xy = x^4 \;\Longrightarrow\; \dfrac{d}{dx}\big(y\cdot x^2\big) = x^4.

Step 4. Integrate both sides. y⋅x2=∫x4 dx=x55+Cy\cdot x^2 = \displaystyle\int x^4\,dx = \dfrac{x^5}{5}+C, so the general solution is

y=x35+Cx2y = \frac{x^3}{5} + \frac{C}{x^2}

Step 5. Check by differentiating: dydx=3x25−2Cx−3\dfrac{dy}{dx} = \dfrac{3x^2}{5}-2Cx^{-3}, and dydx+2yx=3x25−2Cx−3+2x25+2Cx−3=x2\dfrac{dy}{dx}+\dfrac{2y}{x} = \dfrac{3x^2}{5}-2Cx^{-3}+\dfrac{2x^2}{5}+2Cx^{-3} = x^2. ✓ The general solution is y=x35+Cx2y = \dfrac{x^3}{5} + \dfrac{C}{x^2}.

Competitive stretch

Solve dydx−3y=e2x\dfrac{dy}{dx} - 3y = e^{2x} given y(0)=1y(0)=1. Here P=−3P=-3 (a constant), Q=e2xQ=e^{2x}, so I.F.=e∫(−3)dx=e−3x\text{I.F.}=e^{\int(-3)dx}=e^{-3x}. Multiplying: ddx(y e−3x)=e2x⋅e−3x=e−x\dfrac{d}{dx}\big(y\,e^{-3x}\big) = e^{2x}\cdot e^{-3x} = e^{-x}. Integrating: y e−3x=−e−x+Cy\,e^{-3x} = -e^{-x}+C, so y=−e2x+Ce3xy = -e^{2x}+Ce^{3x}. Applying y(0)=1y(0)=1: 1=−1+C⇒C=21=-1+C \Rightarrow C=2. Particular solution: y=2e3x−e2xy = 2e^{3x}-e^{2x}.

Common traps

  • Forcing the equation into dy/dx+Py=Qdy/dx+Py=Q when it is actually linear in xx — if isolating dydx\dfrac{dy}{dx} would leave QQ depending on yy, switch to the dx/dy+Px=Qdx/dy+Px=Q form instead.
  • Leaving the integrating factor as e2ln⁡xe^{2\ln x} instead of simplifying with log laws to x2x^2 — an unsimplified I.F. makes the next integration much harder to spot.
  • Reading off PP and QQ before the coefficient of dydx\dfrac{dy}{dx} is exactly 11 — rearrange fully into standard form first.
  • Integrating the original messy left-hand side directly instead of recognising it as ddx(y⋅I.F.)\dfrac{d}{dx}(y\cdot\text{I.F.}) after multiplying — that recognition step is the entire point of the method.

Ask the tutor: Stuck on whether your equation is linear in yy or in xx, or want another integrating-factor example worked out step by step? Ask the AI tutor to walk through it with you.

How do I know a differential equation is linear before I even start solving it?

Check that yy and dydx\dfrac{dy}{dx} each appear only to the first power, with no products like ydydxy\dfrac{dy}{dx}, no y2y^2, and no yy inside a function like sin⁡y\sin y or eye^y. If you can rearrange the whole equation into dydx+Py=Q\dfrac{dy}{dx}+Py=Q with P,QP,Q depending only on xx, it is linear. If a stray yy shows up inside QQ, try the xx-as-dependent-variable version instead before giving up.

Why can I drop the modulus sign when the integrating factor involves a logarithm?

When you integrate P dxP\,dx and get something like 2ln⁡∣x∣2\ln|x|, exponentiating gives e2ln⁡∣x∣=∣x∣2=x2e^{2\ln|x|}=|x|^2=x^2, since squaring removes the sign anyway. In general, once the exponent is simplified using log laws, any leftover sign ambiguity from the modulus gets absorbed into the arbitrary constant CC in the final solution, so it is standard practice to drop the modulus at the integrating-factor stage.

What if P is just a constant number instead of a function of x, and why does the integrating factor never need its own constant of integration?

Nothing changes in the method if PP is constant — a constant is still a function of xx that happens not to vary. If P=−3P=-3, then ∫P dx=−3x\int P\,dx = -3x, so I.F.=e−3x\text{I.F.}=e^{-3x}, exactly as in the competitive stretch example above. And you never add a "+k" when computing that integral: any extra constant would only multiply the integrating factor by a fixed number eke^k, which cancels straight back out once you divide through to isolate yy at the end. The one arbitrary constant that survives to the end, CC, is the one that appears after the final integration of Q⋅I.F.Q\cdot\text{I.F.}.

Before this