Linear Differential Equations: Integrating Factor Method

#Calculus
TL;DR
Linear differential equations are first-order equations of the form dydx+P(x),y=Q(x)\frac{dy}{dx} + P(x),y = Q(x), where yy and its derivative appear only to the first power and never multiplied together. You solve them with the integrating factor μ(x)=e∫P(x),dx\mu(x) = e^{\int P(x),dx}: multiply through by μ\mu, the left side collapses into ddx[μy]\frac{d}{dx}\big[\mu y\big], and one integration gives y=1μ∫μ,Q,dxy = \frac{1}{\mu}\int \mu,Q,dx.
BT
Bhanzu TeamLast updated on September 29, 202612 min read

What Are Linear Differential Equations?

Linear differential equations are differential equations in which the unknown function yy and its derivative dydx\frac{dy}{dx} each appear to the first power only, with no products such as ydydxy\frac{dy}{dx} and no powers such as y2y^2 or (dydx)2\left(\frac{dy}{dx}\right)^2. A first-order linear equation can always be written in one standard form:

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

Here P(x)P(x) and Q(x)Q(x) are known functions of xx alone. The word linear refers to how yy and its derivative enter, not to whether PP and QQ are straight lines; P(x)P(x) can be 2x\frac{2}{x} and Q(x)Q(x) can be sin⁡x\sin x, and the equation is still linear.

Two conditions make an equation qualify:

  • yy and dydx\frac{dy}{dx} appear only to the first power. No y2y^2, no y\sqrt{y}, no (dydx)2\left(\frac{dy}{dx}\right)^2.

  • yy and dydx\frac{dy}{dx} are never multiplied together, and neither sits inside another function. Terms like ydydxy\frac{dy}{dx}, sin⁡y\sin y, or eye^{y} make the equation nonlinear.

If Q(x)=0Q(x) = 0 the equation is called homogeneous and also separates easily; when Q(x)≠0Q(x) \neq 0 the integrating factor below is the reliable route. These sit inside the wider family of ordinary differential equations, and the general map of the subject lives in the calculus overview.

How Do You Solve Linear Differential Equations With An Integrating Factor?

The method rests on one trick: find a multiplier μ(x)\mu(x), called the integrating factor, that turns the whole left side into the derivative of a single product. Multiply the standard form by μ(x)\mu(x):

μdydx+μP,y=μQ\mu\frac{dy}{dx} + \mu P,y = \mu Q

We want the left side to equal ddx[μy]\frac{d}{dx}\big[\mu y\big]. Expanding that target with the product rule gives μdydx+μ′y\mu\frac{dy}{dx} + \mu' y. Matching it against the line above forces one condition:

μ′=μP⟹μ′μ=P(x)\mu' = \mu P \quad\Longrightarrow\quad \frac{\mu'}{\mu} = P(x)

Integrating both sides, ln⁡μ=∫P(x),dx\ln \mu = \int P(x),dx, so the integrating factor is

μ(x)=e∫P(x),dx.\mu(x) = e^{\int P(x),dx}.

No constant of integration is needed at this step; any one antiderivative of PP produces a valid multiplier. Once μ\mu is in hand, the equation reads ddx[μy]=μQ\frac{d}{dx}\big[\mu y\big] = \mu Q, and a single integration undoes the derivative:

μ,y=∫μ,Q,dx+C⟹y=1μ(∫μ,Q,dx+C)\mu, y = \int \mu, Q,dx + C \qquad\Longrightarrow\qquad y = \frac{1}{\mu}\left(\int \mu, Q,dx + C\right)

The constant CC enters here, and it must be added before dividing by μ\mu, or the Cμ\frac{C}{\mu} term (the homogeneous part of the solution) goes missing.

The full procedure is five short steps:

  1. Put the equation in standard form so the coefficient of dydx\frac{dy}{dx} is exactly 11, then read off P(x)P(x) and Q(x)Q(x).

  2. Compute the integrating factor μ(x)=e∫P(x),dx\mu(x) = e^{\int P(x),dx}.

  3. Multiply the whole equation by μ(x)\mu(x), so the left side becomes ddx[μy]\frac{d}{dx}\big[\mu y\big].

  4. Integrate both sides with respect to xx, adding one constant CC.

  5. Divide by μ(x)\mu(x) to isolate yy.

The dedicated walkthrough of this routine, with more variations, lives at the integrating factor method page.

What Do Linear Differential Equations Look Like Geometrically?

Every first-order equation dydx=Q(x)−P(x)y\frac{dy}{dx} = Q(x) - P(x)y hands you a slope at each point of the plane: plug in (x,y)(x, y) and it returns the steepness a solution curve must have as it passes through. Drawing a short segment of that slope at many points fills the plane with a slope field, and a solution is any curve that stays tangent to the field everywhere it goes.

  • The algebra gives one formula; the geometry gives a whole family. The constant CC in y=1μ(∫μQ,dx+C)y = \frac{1}{\mu}\left(\int \mu Q,dx + C\right) labels which curve you are on. Different values of CC are parallel members of one family, stacked through the slope field.

  • A single starting point picks one curve. Fixing yy at one value of xx (an initial condition) selects the CC that threads the field through that point, which is the idea behind initial value problems.

  • The integrating factor is a change of view. Multiplying by μ\mu bends the tangled slope field into one where the solution is simply "an antiderivative," the geometric reason the method works.

How Do You Use The Integrating Factor? Worked Examples

Each example is fully stepped, and every solution is checked by differentiating it back into the original equation.

Example 1: A constant-coefficient equation.

Solve dydx+y=ex\dfrac{dy}{dx} + y = e^{x}.

The equation is already in standard form with P(x)=1P(x) = 1 and Q(x)=exQ(x) = e^{x}. The integrating factor is

μ(x)=e∫1,dx=ex.\mu(x) = e^{\int 1,dx} = e^{x}.

Multiply through by exe^{x}; the left side becomes an exact derivative:

ddx[exy]=ex⋅ex=e2x\frac{d}{dx}\big[e^{x} y\big] = e^{x}\cdot e^{x} = e^{2x}

Integrate both sides:

exy=∫e2x,dx=12e2x+Ce^{x} y = \int e^{2x},dx = \tfrac{1}{2}e^{2x} + C

Divide by exe^{x}:

y=12ex+Ce−xy = \tfrac{1}{2}e^{x} + C e^{-x}

Check: with y=12ex+Ce−xy = \tfrac{1}{2}e^{x} + C e^{-x}, the derivative is dydx=12ex−Ce−x\dfrac{dy}{dx} = \tfrac{1}{2}e^{x} - C e^{-x}, so dydx+y=12ex−Ce−x+12ex+Ce−x=ex\dfrac{dy}{dx} + y = \tfrac{1}{2}e^{x} - C e^{-x} + \tfrac{1}{2}e^{x} + C e^{-x} = e^{x}. The equation holds.

Final answer: y=12ex+Ce−xy = \tfrac{1}{2}e^{x} + C e^{-x}.

Example 2: A variable coefficient P(x)=2xP(x) = \dfrac{2}{x}.

Solve dydx+2x,y=x\dfrac{dy}{dx} + \dfrac{2}{x},y = x.

Here P(x)=2xP(x) = \dfrac{2}{x} and Q(x)=xQ(x) = x. The integrating factor uses ∫2x,dx=2ln⁡∣x∣=ln⁡x2\int \dfrac{2}{x},dx = 2\ln|x| = \ln x^{2}:

μ(x)=eln⁡x2=x2.\mu(x) = e^{\ln x^{2}} = x^{2}.

Multiply through by x2x^{2}:

ddx[x2y]=x2⋅x=x3\frac{d}{dx}\big[x^{2} y\big] = x^{2}\cdot x = x^{3}

Integrate both sides:

x2y=∫x3,dx=x44+Cx^{2} y = \int x^{3},dx = \frac{x^{4}}{4} + C

Divide by x2x^{2}:

y=x24+Cx2y = \frac{x^{2}}{4} + \frac{C}{x^{2}}

Check: with y=x24+Cx−2y = \dfrac{x^{2}}{4} + C x^{-2}, the derivative is dydx=x2−2Cx−3\dfrac{dy}{dx} = \dfrac{x}{2} - 2C x^{-3}. Then dydx+2xy=x2−2Cx−3+2x(x24+Cx−2)=x2−2Cx−3+x2+2Cx−3=x\dfrac{dy}{dx} + \dfrac{2}{x}y = \dfrac{x}{2} - 2Cx^{-3} + \dfrac{2}{x}\left(\dfrac{x^{2}}{4} + Cx^{-2}\right) = \dfrac{x}{2} - 2Cx^{-3} + \dfrac{x}{2} + 2Cx^{-3} = x. The equation holds.

Final answer: y=x24+Cx2y = \dfrac{x^{2}}{4} + \dfrac{C}{x^{2}}.

Example 3: Standard form first (the coefficient of dydx\frac{dy}{dx} is not 11).

Solve xdydx−y=x2x\dfrac{dy}{dx} - y = x^{2}.

The coefficient of dydx\dfrac{dy}{dx} is xx, not 11, so the equation is not yet in standard form. Divide every term by xx first:

dydx−1x,y=x\frac{dy}{dx} - \frac{1}{x},y = x

Now P(x)=−1xP(x) = -\dfrac{1}{x} and Q(x)=xQ(x) = x. The integrating factor uses ∫−1x,dx=−ln⁡∣x∣=ln⁡x−1\int -\dfrac{1}{x},dx = -\ln|x| = \ln x^{-1}:

μ(x)=eln⁡x−1=1x.\mu(x) = e^{\ln x^{-1}} = \frac{1}{x}.

Multiply the standard-form equation by 1x\dfrac{1}{x}:

ddx[1x,y]=1x⋅x=1\frac{d}{dx}\left[\frac{1}{x}, y\right] = \frac{1}{x}\cdot x = 1

Integrate both sides:

1x,y=∫1,dx=x+C\frac{1}{x}, y = \int 1,dx = x + C

Multiply by xx:

y=x2+Cxy = x^{2} + Cx

Check: with y=x2+Cxy = x^{2} + Cx, the derivative is dydx=2x+C\dfrac{dy}{dx} = 2x + C, so xdydx−y=x(2x+C)−(x2+Cx)=2x2+Cx−x2−Cx=x2x\dfrac{dy}{dx} - y = x(2x + C) - (x^{2} + Cx) = 2x^{2} + Cx - x^{2} - Cx = x^{2}. The original equation holds.

Final answer: y=x2+Cxy = x^{2} + Cx.

What Is The General-Solution Formula For Linear Differential Equations?

Collapsing the five steps into one line gives the formula quoted in most textbooks. For dydx+P(x)y=Q(x)\dfrac{dy}{dx} + P(x)y = Q(x) with μ(x)=e∫P,dx\mu(x) = e^{\int P,dx}:

y=1μ(x)(∫μ(x),Q(x),dx+C)y = \frac{1}{\mu(x)}\left(\int \mu(x),Q(x),dx + C\right)

The table below sorts the common cases by what P(x)P(x) looks like, since the integrating factor is where students spend most of their effort.

Table: Integrating factors for the standard shapes of P(x)P(x).

Standard form

P(x)P(x)

∫P,dx\int P,dx

Integrating factor μ(x)\mu(x)

dydx+ky=Q\frac{dy}{dx} + k y = Q

kk (constant)

kxkx

ekxe^{kx}

dydx+nxy=Q\frac{dy}{dx} + \frac{n}{x} y = Q

nx\frac{n}{x}

nln⁡∣x∣n\ln\lvert x\rvert

xnx^{n}

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

tan⁡x\tan x

ln⁡∣sec⁡x∣\ln\lvert\sec x\rvert

sec⁡x\sec x

dydx+2x,y=Q\frac{dy}{dx} + 2x, y = Q

2x2x

x2x^{2}

ex2e^{x^{2}}

Reading the integrating factor straight from this table removes the step where most sign and algebra slips happen. If the equation does not fit any row, fall back to computing ∫P,dx\int P,dx directly.

Why Do Linear Differential Equations Work This Way?

The whole method is one demand: make the left side an exact derivative. Everything else follows.

  • The product rule runs in reverse. ddx[μy]=μdydx+μ′y\frac{d}{dx}\big[\mu y\big] = \mu\frac{dy}{dx} + \mu' y. The equation already supplies μdydx+μPy\mu\frac{dy}{dx} + \mu P y. These match exactly when μ′=μP\mu' = \mu P, and no other choice of μ\mu works. The integrating factor is not a lucky guess; it is forced.

  • Integration undoes a derivative. Once the left side is ddx[μy]\frac{d}{dx}\big[\mu y\big], integrating both sides is the Fundamental Theorem of Calculus at work: the derivative and the integral cancel on the left, leaving μy\mu y against an ordinary integral on the right.

  • Linearity is what lets CC ride along. Because yy enters to the first power, the solution splits cleanly into one particular curve plus Cμ\frac{C}{\mu}, the family of homogeneous solutions. That clean split is exactly what fails for nonlinear equations, which is why this tidy recipe is special to the linear case.

Seen this way, the integrating factor is a translator. It rewrites a problem you cannot integrate directly into one that is a single antiderivative.

Who Discovered The Integrating Factor For Linear Differential Equations?

The method is almost as old as calculus itself, worked out within a decade of Leibniz publishing his notation.

Two figures carried the idea forward:

  • Johann Bernoulli (1667–1748, Switzerland) turned Leibniz's insight into the standard solving routine and taught it across Europe, including to the young Euler.

  • Leonhard Euler (1707–1783, Switzerland) generalised the integrating factor far beyond the linear case, connecting it to the theory of exact differential equations.

Where Are Linear Differential Equations Used In The Real World?

Any quantity whose rate of change is proportional to itself plus an outside push obeys a first-order linear equation, which is why they appear across the sciences.

  • Newton's law of cooling: a hot object loses heat at a rate proportional to how far its temperature sits above its surroundings, giving dTdt+kT=kTroom\frac{dT}{dt} + kT = kT_{\text{room}}, the equation behind the cooling cup in the hook.

  • RC electrical circuits: the charge on a capacitor through a resistor obeys dqdt+1RC,q=VR\frac{dq}{dt} + \frac{1}{RC},q = \frac{V}{R}, and the integrating factor et/RCe^{t/RC} produces the familiar charging curve.

  • Mixing and dilution: the amount of salt in a tank with brine flowing in and out follows a linear equation in the concentration, used in chemical engineering to size reactors.

  • Pharmacokinetics: the concentration of a drug in the bloodstream, cleared at a rate proportional to its amount while a drip adds more, is a linear equation that sets dosing schedules.

  • Population and finance: a population with constant immigration, or an account earning interest while receiving deposits, both reduce to dydt+ky=Q(t)\frac{dy}{dt} + ky = Q(t).

One equation form, solved one way, describes cooling coffee, charging phones, medicated bloodstreams, and growing savings. That reach is why the integrating factor earns a permanent place in every calculus course.

What Are The Most Common Mistakes With Linear Differential Equations?

These three errors account for most lost marks on linear differential equations, and each matches a question real students ask on r/learnmath, math.stackexchange, and course common-error handouts.

Reading off PP and QQ before reaching standard form.

Where it slips in:

Given xdydx−y=x2x\frac{dy}{dx} - y = x^{2}, a student reads P=−1P = -1 and computes μ=e−x\mu = e^{-x}, because the coefficient of dydx\frac{dy}{dx} was still xx, not 11.

Don't do this:

Do not identify P(x)P(x) until the coefficient of dydx\frac{dy}{dx} is exactly 11.

The correct way:

Divide the whole equation by the coefficient of dydx\frac{dy}{dx} first. Here divide by xx to get dydx−1xy=x\frac{dy}{dx} - \frac{1}{x}y = x, so P=−1xP = -\frac{1}{x} and μ=1x\mu = \frac{1}{x}.

Mishandling the sign or the constant of the integrating factor.

Where it slips in:

With P=−1xP = -\frac{1}{x}, a student writes ∫−1x,dx=ln⁡x\int -\frac{1}{x},dx = \ln x (sign dropped) or adds a constant, e−ln⁡x+Ce^{-\ln x + C}, and carries the stray eCe^{C} through the whole problem.

Don't do this:

Do not drop the sign in ∫P,dx\int P,dx, and do not attach a +C+C to the integrating-factor exponent.

The correct way:

Keep the sign: ∫−1x,dx=−ln⁡∣x∣=ln⁡x−1\int -\frac{1}{x},dx = -\ln|x| = \ln x^{-1}, so μ=1x\mu = \frac{1}{x}. Any single antiderivative of PP is enough; the constant belongs later, not here.

Forgetting +C+C before dividing by μ\mu.

Where it slips in:

After integrating ddx[μy]=μQ\frac{d}{dx}[\mu y] = \mu Q, a student writes μy=∫μQ,dx\mu y = \int \mu Q,dx with no constant, then divides by μ\mu and loses the entire Cμ\frac{C}{\mu} term.

Don't do this:

Do not integrate without the constant, and never add CC after you have already divided by μ\mu.

The correct way:

Write μy=∫μQ,dx+C\mu y = \int \mu Q,dx + C, then divide, so y=1μ∫μQ,dx+Cμy = \frac{1}{\mu}\int \mu Q,dx + \frac{C}{\mu}. That second piece is the homogeneous solution and is part of the answer.

Practice Problems On Linear Differential Equations

Solve each with the integrating factor, then check against the answer. Every answer is verified by substitution.

  1. Solve dydx+3y=6\dfrac{dy}{dx} + 3y = 6.
    (Answer: μ=e3x\mu = e^{3x}, so y=2+Ce−3xy = 2 + Ce^{-3x}.)

  2. Solve dydx+1xy=x2\dfrac{dy}{dx} + \dfrac{1}{x}y = x^{2}.
    (Answer: μ=x\mu = x, so y=x34+Cxy = \dfrac{x^{3}}{4} + \dfrac{C}{x}.)

  3. Solve dydx+y=x\dfrac{dy}{dx} + y = x.
    (Answer: μ=ex\mu = e^{x}, so y=x−1+Ce−xy = x - 1 + Ce^{-x}.)

  4. Solve xdydx+3y=x2x\dfrac{dy}{dx} + 3y = x^{2}.
    (Answer: standard form gives P=3xP = \dfrac{3}{x}, μ=x3\mu = x^{3}, so y=x25+Cx3y = \dfrac{x^{2}}{5} + \dfrac{C}{x^{3}}.)

  5. Solve dydx+2xy=x\dfrac{dy}{dx} + 2xy = x.
    (Answer: μ=ex2\mu = e^{x^{2}}, so y=12+Ce−x2y = \dfrac{1}{2} + Ce^{-x^{2}}.)

  6. Solve dydx+y=ex\dfrac{dy}{dx} + y = e^{x} with y(0)=1y(0) = 1.
    (Answer: general y=12ex+Ce−xy = \tfrac{1}{2}e^{x} + Ce^{-x}; y(0)=1y(0)=1 gives C=12C = \tfrac{1}{2}, so y=12ex+12e−xy = \tfrac{1}{2}e^{x} + \tfrac{1}{2}e^{-x}.)

Where Should You Go Next After Linear Differential Equations?

Linear differential equations are one branch of a larger tree, and several natural doors open from here.

  1. Ordinary differential equations. Step back to the full family and see where the linear first-order case fits among the other types.

  2. Separable differential equations. The other core first-order method, useful whenever the variables split apart cleanly.

  3. Homogeneous differential equations. A substitution technique for equations built from ratios yx\frac{y}{x}, and a common next topic after the linear case.

  4. Order and degree of a differential equation. Sharpen the vocabulary that classifies every equation you will meet.

If your child is meeting linear differential equations for the first time, a live Bhanzu trainer teaches the integrating factor from the standard-form step up, so each rule has a reason, in the Bhanzu math program.

Was this article helpful?

Your feedback helps us write better content

Frequently Asked Questions

What are linear differential equations in simple terms?
They are first-order equations of the form dydx+P(x)y=Q(x)\frac{dy}{dx} + P(x)y = Q(x), where the unknown yy and its derivative appear only to the first power and are never multiplied together. Linear differential equations are solved with an integrating factor, which turns the left side into a single derivative.
What is the integrating factor for a linear differential equation?
It is μ(x)=e∫P(x),dx\mu(x) = e^{\int P(x),dx}, computed from the coefficient P(x)P(x) once the equation is in standard form. Multiplying the whole equation by μ(x)\mu(x) makes the left side equal ddx[μy]\frac{d}{dx}[\mu y], which you can then integrate directly.
How do you know if a differential equation is linear?
Check that yy and dydx\frac{dy}{dx} each appear only to the first power, with no term like y2y^2, y\sqrt{y}, ydydxy\frac{dy}{dx}, or sin⁡y\sin y. If any such term is present the equation is nonlinear and the integrating factor method does not apply.
Why must the equation be in standard form first?
Because P(x)P(x) and Q(x)Q(x) are only correct when the coefficient of dydx\frac{dy}{dx} is exactly 11. Reading them off before dividing by that coefficient gives the wrong integrating factor, which is the most common error on linear differential equations.
What is the difference between linear and separable equations?
A separable equation can be rearranged so all the yy terms sit on one side and all the xx terms on the other. A linear equation may not separate, but it always yields to the integrating factor; some equations, such as dydx+y=0\frac{dy}{dx} + y = 0, happen to be both.
Do you add a constant of integration when finding the integrating factor?
No. Any single antiderivative of P(x)P(x) gives a valid integrating factor, so no +C+C is attached to the exponent. The one constant CC enters later, when you integrate μQ\mu Q, and it must be added before you divide by μ\mu.
✍️ Written By
BT
Bhanzu Team
Content Creator and Editor
Bhanzu’s editorial team, known as Team Bhanzu, is made up of experienced educators, curriculum experts, content strategists, and fact-checkers dedicated to making math simple and engaging for learners worldwide. Every article and resource is carefully researched, thoughtfully structured, and rigorously reviewed to ensure accuracy, clarity, and real-world relevance. We understand that building strong math foundations can raise questions for students and parents alike. That’s why Team Bhanzu focuses on delivering practical insights, concept-driven explanations, and trustworthy guidance-empowering learners to develop confidence, speed, and a lifelong love for mathematics.
Related Articles
Book a FREE Demo ClassBook Now →