1. Home
  2. Explore
  3. Mathematics
  4. First-Order Linear Differential Equations

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

First-Order Linear Differential Equations

Solving First-Order Linear Differential Equations

Motivation: Reverse Product Rule

The integral ∫sin⁡xx dx\int \frac{\sin x}{x} \, dx∫xsinx​dx is a non-elementary integral—it has no closed-form antiderivative. However, adding a term can change the situation dramatically. Consider:

∫(sin⁡xx+ln⁡x⋅cos⁡x)dx\int \left( \frac{\sin x}{x} + \ln x \cdot \cos x \right) dx∫(xsinx​+lnx⋅cosx)dx

This integral does have a simple antiderivative: sin⁡x⋅ln⁡x+C\sin x \cdot \ln x + Csinx⋅lnx+C. Why? Because the integrand is exactly the derivative of sin⁡x⋅ln⁡x\sin x \cdot \ln xsinx⋅lnx obtained via the product rule:

ddx(sin⁡x⋅ln⁡x)=sin⁡x⋅1x+ln⁡x⋅cos⁡x\frac{d}{dx} \left( \sin x \cdot \ln x \right) = \sin x \cdot \frac{1}{x} + \ln x \cdot \cos xdxd​(sinx⋅lnx)=sinx⋅x1​+lnx⋅cosx

Key insight: Recognizing that a sum of terms came from a product rule derivative makes integration possible. This same idea is used to solve first-order linear differential equations.


Standard Form of a First-Order Linear Differential Equation

A first-order linear differential equation has the form:

dydx+P(x) y=Q(x)\frac{dy}{dx} + P(x) \, y = Q(x)dxdy​+P(x)y=Q(x)
  • First-order: only the first derivative dydx\frac{dy}{dx}dxdy​ appears.

  • Linear: yyy and dydx\frac{dy}{dx}dxdy​ are not raised to any power other than 1 (no y2y^2y2, y\sqrt{y}y​, cos⁡y\cos ycosy, etc.).

  • P(x)P(x)P(x) and Q(x)Q(x)Q(x) are functions of xxx only.

If the equation is not initially in this form, algebraic manipulation (e.g., dividing by a coefficient) puts it into standard form.


The Integrating Factor Method

The goal is to rewrite the left-hand side of the differential equation as the derivative of some product — specifically, the derivative of μ(x)⋅y\mu(x) \cdot yμ(x)⋅y, where μ(x)\mu(x)μ(x) is called the integrating factor.

Recall the product rule:

ddx(μ(x)⋅y)=μ(x)dydx+dμdx⋅y\frac{d}{dx} \left( \mu(x) \cdot y \right) = \mu(x) \frac{dy}{dx} + \frac{d\mu}{dx} \cdot ydxd​(μ(x)⋅y)=μ(x)dxdy​+dxdμ​⋅y

If we multiply the entire differential equation by μ(x)\mu(x)μ(x), we get:

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

For the left-hand side to match ddx(μy)\frac{d}{dx}(\mu y)dxd​(μy), we need:

μ(x)P(x)=dμdx\mu(x) P(x) = \frac{d\mu}{dx}μ(x)P(x)=dxdμ​

Deriving the Integrating Factor

  1. Set dμdx=μP(x)\frac{d\mu}{dx} = \mu P(x)dxdμ​=μP(x).

  2. Separate variables: dμμ=P(x) dx\frac{d\mu}{\mu} = P(x) \, dxμdμ​=P(x)dx.

  3. Integrate both sides:

    ln⁡∣μ(x)∣=∫P(x) dx\ln |\mu(x)| = \int P(x) \, dxln∣μ(x)∣=∫P(x)dx
  4. Exponentiate to solve for μ(x)\mu(x)μ(x):

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

    The absolute value can be dropped because only one (positive) integrating factor is needed — any constant factor cancels out in the process.

Definition: The integrating factor μ(x)=e∫P(x) dx\mu(x) = e^{\int P(x) \, dx}μ(x)=e∫P(x)dx transforms the left-hand side of the linear DE into the derivative of μ(x)⋅y\mu(x) \cdot yμ(x)⋅y.

Applying the Method

  • Multiply the original DE (in standard form) by μ(x)\mu(x)μ(x).

  • The left-hand side becomes ddx(μ(x)⋅y)\frac{d}{dx} \left( \mu(x) \cdot y \right)dxd​(μ(x)⋅y).

  • Integrate both sides with respect to xxx:

    μ(x) y=∫μ(x)Q(x) dx+C\mu(x) \, y = \int \mu(x) Q(x) \, dx + Cμ(x)y=∫μ(x)Q(x)dx+C
  • Solve for yyy by dividing by μ(x)\mu(x)μ(x).


Worked Example

Solve the differential equation:

cos⁡x dydx+sin⁡x y=1\cos x \, \frac{dy}{dx} + \sin x \, y = 1cosxdxdy​+sinxy=1

Step 1: Put into standard form

Divide by cos⁡x\cos xcosx:

dydx+sin⁡xcos⁡x y=1cos⁡x\frac{dy}{dx} + \frac{\sin x}{\cos x} \, y = \frac{1}{\cos x}dxdy​+cosxsinx​y=cosx1​

Recognize sin⁡xcos⁡x=tan⁡x\frac{\sin x}{\cos x} = \tan xcosxsinx​=tanx and 1cos⁡x=sec⁡x\frac{1}{\cos x} = \sec xcosx1​=secx. So the standard form is:

dydx+(tan⁡x) y=sec⁡x\frac{dy}{dx} + (\tan x) \, y = \sec xdxdy​+(tanx)y=secx

Step 2: Identify P(x)P(x)P(x) and Q(x)Q(x)Q(x)

P(x)=tan⁡x,Q(x)=sec⁡xP(x) = \tan x, \quad Q(x) = \sec xP(x)=tanx,Q(x)=secx

Step 3: Compute the integrating factor

μ(x)=e∫tan⁡x dx=eln⁡∣sec⁡x∣=sec⁡x\mu(x) = e^{\int \tan x \, dx} = e^{\ln |\sec x|} = \sec xμ(x)=e∫tanxdx=eln∣secx∣=secx

(We take the positive version sec⁡x\sec xsecx; dropping the absolute value and constant is fine.)

Step 4: Multiply the standard-form equation by μ(x)\mu(x)μ(x)

sec⁡x⋅dydx+sec⁡x⋅tan⁡x⋅y=sec⁡2x\sec x \cdot \frac{dy}{dx} + \sec x \cdot \tan x \cdot y = \sec^2 xsecx⋅dxdy​+secx⋅tanx⋅y=sec2x

The left-hand side is now ddx(sec⁡x⋅y)\frac{d}{dx} \left( \sec x \cdot y \right)dxd​(secx⋅y) because:

ddx(sec⁡x⋅y)=sec⁡x⋅dydx+y⋅ddx(sec⁡x)=sec⁡xdydx+y⋅(sec⁡xtan⁡x)\frac{d}{dx} (\sec x \cdot y) = \sec x \cdot \frac{dy}{dx} + y \cdot \frac{d}{dx}(\sec x) = \sec x \frac{dy}{dx} + y \cdot (\sec x \tan x)dxd​(secx⋅y)=secx⋅dxdy​+y⋅dxd​(secx)=secxdxdy​+y⋅(secxtanx)

Step 5: Integrate both sides

sec⁡x⋅y=∫sec⁡2x dx=tan⁡x+C\sec x \cdot y = \int \sec^2 x \, dx = \tan x + Csecx⋅y=∫sec2xdx=tanx+C

Step 6: Solve for yyy

Multiply both sides by cos⁡x\cos xcosx:

y=cos⁡x⋅(tan⁡x+C)=sin⁡x+Ccos⁡xy = \cos x \cdot (\tan x + C) = \sin x + C \cos xy=cosx⋅(tanx+C)=sinx+Ccosx

This is the general solution of the differential equation.


Initial Value Problem (IVP)

If an initial condition is supplied, the constant CCC can be determined.

Example: Solve the same DE with y(π)=2y(\pi) = 2y(π)=2.

From the general solution y=sin⁡x+Ccos⁡xy = \sin x + C \cos xy=sinx+Ccosx, substitute x=πx = \pix=π, y=2y = 2y=2:

2=sin⁡π+Ccos⁡π=0+C⋅(−1)=−C2 = \sin \pi + C \cos \pi = 0 + C \cdot (-1) = -C2=sinπ+Ccosπ=0+C⋅(−1)=−C

Thus C=−2C = -2C=−2, and the particular solution is:

y=sin⁡x−2cos⁡xy = \sin x - 2 \cos xy=sinx−2cosx

Summary of the Integrating Factor Method

  1. Write the differential equation in standard form: dydx+P(x)y=Q(x)\frac{dy}{dx} + P(x) y = Q(x)dxdy​+P(x)y=Q(x).

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

  3. Multiply the entire equation by μ(x)\mu(x)μ(x).

  4. Recognize the left-hand side as ddx(μ(x)y)\frac{d}{dx} \left( \mu(x) y \right)dxd​(μ(x)y).

  5. Integrate both sides: μ(x)y=∫μ(x)Q(x)dx+C\mu(x) y = \int \mu(x) Q(x) dx + Cμ(x)y=∫μ(x)Q(x)dx+C.

  6. Solve for yyy.

The key is that the integrating factor forces the left-hand side to become a perfect derivative, turning the differential equation into an integrable expression. This method works only for linear first-order ODEs.

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent