Linear Differential Equations: Integrating Factor Method

#Calculus
TL;DR
Linear differential equations are first-order equations of the form $\frac{dy}{dx} + P(x),y = Q(x)$, where $y$ and its derivative appear only to the first power and never multiplied together. You solve them with the integrating factor $\mu(x) = e^{\int P(x),dx}$: multiply through by $\mu$, the left side collapses into $\frac{d}{dx}\big[\mu y\big]$, and one integration gives $y = \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 $y$ and its derivative $\frac{dy}{dx}$ each appear to the first power only, with no products such as $y\frac{dy}{dx}$ and no powers such as $y^2$ or $\left(\frac{dy}{dx}\right)^2$. A first-order linear equation can always be written in one standard form:

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

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

Two conditions make an equation qualify:

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

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

If $Q(x) = 0$ the equation is called homogeneous and also separates easily; when $Q(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 $\mu(x)$, called the integrating factor, that turns the whole left side into the derivative of a single product. Multiply the standard form by $\mu(x)$:

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

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

$$\mu' = \mu P \quad\Longrightarrow\quad \frac{\mu'}{\mu} = P(x)$$

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

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

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

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

The constant $C$ enters here, and it must be added before dividing by $\mu$, or the $\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 $\frac{dy}{dx}$ is exactly $1$, then read off $P(x)$ and $Q(x)$.

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

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

  4. Integrate both sides with respect to $x$, adding one constant $C$.

  5. Divide by $\mu(x)$ to isolate $y$.

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 $\frac{dy}{dx} = Q(x) - P(x)y$ hands you a slope at each point of the plane: plug in $(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 $C$ in $y = \frac{1}{\mu}\left(\int \mu Q,dx + C\right)$ labels which curve you are on. Different values of $C$ are parallel members of one family, stacked through the slope field.

  • A single starting point picks one curve. Fixing $y$ at one value of $x$ (an initial condition) selects the $C$ 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 $\dfrac{dy}{dx} + y = e^{x}$.

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

$$\mu(x) = e^{\int 1,dx} = e^{x}.$$

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

$$\frac{d}{dx}\big[e^{x} y\big] = e^{x}\cdot e^{x} = e^{2x}$$

Integrate both sides:

$$e^{x} y = \int e^{2x},dx = \tfrac{1}{2}e^{2x} + C$$

Divide by $e^{x}$:

$$y = \tfrac{1}{2}e^{x} + C e^{-x}$$

Check: with $y = \tfrac{1}{2}e^{x} + C e^{-x}$, the derivative is $\dfrac{dy}{dx} = \tfrac{1}{2}e^{x} - C e^{-x}$, so $\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 = \tfrac{1}{2}e^{x} + C e^{-x}$.

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

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

Here $P(x) = \dfrac{2}{x}$ and $Q(x) = x$. The integrating factor uses $\int \dfrac{2}{x},dx = 2\ln|x| = \ln x^{2}$:

$$\mu(x) = e^{\ln x^{2}} = x^{2}.$$

Multiply through by $x^{2}$:

$$\frac{d}{dx}\big[x^{2} y\big] = x^{2}\cdot x = x^{3}$$

Integrate both sides:

$$x^{2} y = \int x^{3},dx = \frac{x^{4}}{4} + C$$

Divide by $x^{2}$:

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

Check: with $y = \dfrac{x^{2}}{4} + C x^{-2}$, the derivative is $\dfrac{dy}{dx} = \dfrac{x}{2} - 2C x^{-3}$. Then $\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 = \dfrac{x^{2}}{4} + \dfrac{C}{x^{2}}$.

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

Solve $x\dfrac{dy}{dx} - y = x^{2}$.

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

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

Now $P(x) = -\dfrac{1}{x}$ and $Q(x) = x$. The integrating factor uses $\int -\dfrac{1}{x},dx = -\ln|x| = \ln x^{-1}$:

$$\mu(x) = e^{\ln x^{-1}} = \frac{1}{x}.$$

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

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

Integrate both sides:

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

Multiply by $x$:

$$y = x^{2} + Cx$$

Check: with $y = x^{2} + Cx$, the derivative is $\dfrac{dy}{dx} = 2x + C$, so $x\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 = 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 $\dfrac{dy}{dx} + P(x)y = Q(x)$ with $\mu(x) = e^{\int P,dx}$:

$$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)$ looks like, since the integrating factor is where students spend most of their effort.

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

Standard form

$P(x)$

$\int P,dx$

Integrating factor $\mu(x)$

$\frac{dy}{dx} + k y = Q$

$k$ (constant)

$kx$

$e^{kx}$

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

$\frac{n}{x}$

$n\ln\lvert x\rvert$

$x^{n}$

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

$\tan x$

$\ln\lvert\sec x\rvert$

$\sec x$

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

$2x$

$x^{2}$

$e^{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 $\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. $\frac{d}{dx}\big[\mu y\big] = \mu\frac{dy}{dx} + \mu' y$. The equation already supplies $\mu\frac{dy}{dx} + \mu P y$. These match exactly when $\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 $\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 $\mu y$ against an ordinary integral on the right.

  • Linearity is what lets $C$ ride along. Because $y$ enters to the first power, the solution splits cleanly into one particular curve plus $\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 $\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 $\frac{dq}{dt} + \frac{1}{RC},q = \frac{V}{R}$, and the integrating factor $e^{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 $\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 $P$ and $Q$ before reaching standard form.

Where it slips in:

Given $x\frac{dy}{dx} - y = x^{2}$, a student reads $P = -1$ and computes $\mu = e^{-x}$, because the coefficient of $\frac{dy}{dx}$ was still $x$, not $1$.

Don't do this:

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

The correct way:

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

Mishandling the sign or the constant of the integrating factor.

Where it slips in:

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

Don't do this:

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

The correct way:

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

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

Where it slips in:

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

Don't do this:

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

The correct way:

Write $\mu y = \int \mu Q,dx + C$, then divide, so $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 $\dfrac{dy}{dx} + 3y = 6$.
    (Answer: $\mu = e^{3x}$, so $y = 2 + Ce^{-3x}$.)

  2. Solve $\dfrac{dy}{dx} + \dfrac{1}{x}y = x^{2}$.
    (Answer: $\mu = x$, so $y = \dfrac{x^{3}}{4} + \dfrac{C}{x}$.)

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

  4. Solve $x\dfrac{dy}{dx} + 3y = x^{2}$.
    (Answer: standard form gives $P = \dfrac{3}{x}$, $\mu = x^{3}$, so $y = \dfrac{x^{2}}{5} + \dfrac{C}{x^{3}}$.)

  5. Solve $\dfrac{dy}{dx} + 2xy = x$.
    (Answer: $\mu = e^{x^{2}}$, so $y = \dfrac{1}{2} + Ce^{-x^{2}}$.)

  6. Solve $\dfrac{dy}{dx} + y = e^{x}$ with $y(0) = 1$.
    (Answer: general $y = \tfrac{1}{2}e^{x} + Ce^{-x}$; $y(0)=1$ gives $C = \tfrac{1}{2}$, so $y = \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 $\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.

Book a Free Demo

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 $\frac{dy}{dx} + P(x)y = Q(x)$, where the unknown $y$ 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 $\mu(x) = e^{\int P(x),dx}$, computed from the coefficient $P(x)$ once the equation is in standard form. Multiplying the whole equation by $\mu(x)$ makes the left side equal $\frac{d}{dx}[\mu y]$, which you can then integrate directly.
How do you know if a differential equation is linear?
Check that $y$ and $\frac{dy}{dx}$ each appear only to the first power, with no term like $y^2$, $\sqrt{y}$, $y\frac{dy}{dx}$, or $\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)$ and $Q(x)$ are only correct when the coefficient of $\frac{dy}{dx}$ is exactly $1$. 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 $y$ terms sit on one side and all the $x$ terms on the other. A linear equation may not separate, but it always yields to the integrating factor; some equations, such as $\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)$ gives a valid integrating factor, so no $+C$ is attached to the exponent. The one constant $C$ enters later, when you integrate $\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 →