• Foundation
  • About 22 min
  • 5 practice questions

Linear differential equations and the integrating factor

Recognise first-order linear equations dy/dx + Py = Q, derive and use the integrating factor e^(∫P dx), solve the form dx/dy + P₁x = Q₁, and find particular solutions.

If something looks wrong, please tell us.

The equation dy/dx = x + y is neither separable nor homogeneous. It belongs to a third family, the linear equations, in which y and dy/dx appear only to the first power. A single multiplier, the integrating factor, turns the left side of any such equation into the derivative of a product, and then one integration solves it.

The standard form

A first-order linear differential equation has the form dy/dx + P y = Q, where P and Q are constants or functions of x only. Examples: dy/dx − y = cos x; dy/dx + (2/x) y = x; dy/dx + y tan x = sec x. The other form, linear in x, is dx/dy + P₁ x = Q₁, where P₁ and Q₁ are constants or functions of y only, for example dx/dy + x/y = y². In a linear equation, y and its derivative are never squared, never multiplied together, and never inside functions such as sin y.

Deriving the integrating factor

Multiply dy/dx + Py = Q by a function g(x): g (dy/dx) + P g y = Q g. We want the left side to be the derivative of y·g, which is g (dy/dx) + y g′. Comparing, we need P g = g′, i.e. g′/g = P. Integrating, log g = ∫ P dx, so g(x) = e^(∫P dx). This g is the integrating factor (I.F.). With it, the equation becomes d/dx (y · I.F.) = Q · I.F., and integrating both sides gives the solution.

For dy/dx + Py = Q: I.F. = e^(∫P dx), and the solution is y × I.F. = ∫ (Q × I.F.) dx + C. For dx/dy + P₁x = Q₁: I.F. = e^(∫P₁ dy), and x × I.F. = ∫ (Q₁ × I.F.) dy + C.

Solving a linear equation

  1. Write in the form dy/dx + Py = Q (divide by the coefficient of dy/dx)
  2. Find I.F. = e^(∫P dx); simplify using e^(log u) = u
  3. Write y × I.F. = ∫ Q × I.F. dx + C
  4. Integrate and solve for y

Worked examples

Worked example 1

Solve dy/dx + y = e^(−x). Here P = 1, Q = e^(−x). I.F. = e^(∫1 dx) = eˣ. Then y eˣ = ∫ e^(−x) · eˣ dx + C = ∫ 1 dx + C = x + C. So y = (x + C) e^(−x).

Worked example 2: divide first

Solve x (dy/dx) − y = x² for x > 0. Divide by x: dy/dx − (1/x) y = x, so P = −1/x, Q = x. ∫P dx = −log x, so I.F. = e^(−log x) = 1/x. Then y (1/x) = ∫ x · (1/x) dx + C = x + C. So y = x² + Cx. Check: y′ = 2x + C, and x y′ − y = 2x² + Cx − x² − Cx = x². ✓

Worked example 3: a trigonometric coefficient

Solve dy/dx + 2y tan x = sin x. P = 2 tan x, so ∫P dx = 2 log |sec x| and I.F. = sec² x. Then y sec² x = ∫ sin x sec² x dx + C = ∫ sec x tan x dx + C = sec x + C. Multiply by cos² x: y = cos x + C cos² x.

Worked example 4: a curve through a point

Find the curve through (0, 1) whose slope at (x, y) is x + y. Then dy/dx = x + y, i.e. dy/dx − y = x, with P = −1, Q = x. I.F. = e^(−x). So y e^(−x) = ∫ x e^(−x) dx + C. By parts, ∫ x e^(−x) dx = −x e^(−x) − e^(−x). Hence y e^(−x) = −(x + 1) e^(−x) + C, i.e. y = −(x + 1) + C eˣ. At (0, 1): 1 = −1 + C, so C = 2. The curve is y = 2eˣ − x − 1.

Worked example 5: linear in x

Solve dx/dy + x/y = y² (y > 0). This is linear in x with P₁ = 1/y and Q₁ = y². I.F. = e^(∫dy/y) = e^(log y) = y. Then x y = ∫ y² · y dy + C = y⁴/4 + C. So xy = y⁴/4 + C. When an equation is not linear in y but becomes linear after swapping the roles of x and y, use this form.

Three methods for first-order equations

  • Variables separable
    • dy/dx = g(x) h(y)
    • Separate and integrate
    • Example: dy/dx = 2xy
  • Homogeneous
    • dy/dx = g(y/x)
    • Put y = vx, then separate
    • Example: dy/dx = (x + y)/x
  • Linear
    • dy/dx + Py = Q
    • Multiply by e^(∫P dx)
    • Example: dy/dx − y = x
Test for the simplest method first: separable, then homogeneous, then linear.

Key takeaways

  • Bring the equation to dy/dx + Py = Q, with coefficient 1 for dy/dx.
  • I.F. = e^(∫P dx); simplify with e^(log u) = u, and no constant is needed inside.
  • Solution: y × I.F. = ∫ Q × I.F. dx + C.
  • If the equation is linear in x, use dx/dy + P₁x = Q₁ and I.F. = e^(∫P₁ dy).
  • Use a given point to find C for a particular solution.

Check your understanding

  1. 1. What is the integrating factor of dy/dx + (2/x) y = x² (x > 0)?

    1. x²
    2. 2 log x
    3. e^(2/x)
    4. 1/x²
    Show answer

    Answer: A. P = 2/x, so ∫P dx = 2 log x = log x². I.F. = e^(log x²) = x².

  2. 2. What is the integrating factor of dy/dx − y tan x = cos x?

    1. sec x
    2. cos x
    3. e^(tan x)
    4. −tan x
    Show answer

    Answer: B. P = −tan x, so ∫P dx = −log |sec x| = log |cos x|. I.F. = e^(log cos x) = cos x.

  3. 3. What is the general solution of dy/dx + y = 1?

    1. y = 1 + C eˣ
    2. y = C e^(−x)
    3. y = 1 + C e^(−x)
    4. y = x + C
    Show answer

    Answer: C. P = 1, I.F. = eˣ. y eˣ = ∫ eˣ dx + C = eˣ + C, so y = 1 + C e^(−x). Check: y′ = −C e^(−x) and y′ + y = 1.

  4. 4. What is the integrating factor of dx/dy − x = y?

    1. eʸ
    2. e^(−y)
    3. y
    4. e^(−x)
    Show answer

    Answer: B. This is linear in x with P₁ = −1 (a function of y only). I.F. = e^(∫−1 dy) = e^(−y).

  5. 5. Assertion (A): dy/dx + y² = x is a linear differential equation. Reason (R): In a first-order linear equation, y and dy/dx occur only to the first power and are not multiplied together.

    1. Both A and R are true, and R is the correct explanation of A
    2. Both A and R are true, but R is not the correct explanation of A
    3. A is true, but R is false
    4. A is false, but R is true
    Show answer

    Answer: D. R correctly describes a linear equation dy/dx + Py = Q. Because y appears squared in dy/dx + y² = x, the equation is not linear, so A is false.

Privacy · Terms · Refunds · Delivery