Steply

The integrating factor

Differential Equations · 22 problems, easy to harder

▶ Watch the first one solved

How we do it

  1. Standard form
  2. The integrating factor
  3. Multiply both sides
  4. One derivative on the left
  5. Integrate both sides
  6. Solve for y
  7. Use the starting value
  8. Check

The steps for Solve y' + 2xy = 4x, y(0) = 5. Every solution names its steps, so you always know what comes next.

Worked examples

Solve y' + 2y = 4 Easy

The question

Question: solve y′ + 2y = 4.

y′ + 2y = 4

1 Standard form

Linear means this form: y′ + P y = Q.

P and Q have only x.

linear: y′ + P(x) y = Q(x)

Here P = 2 and Q = 4.

P = 2, Q = 4

2 The integrating factor

The integrating factor is e to the integral of P.

Multiplying by it makes the left side one derivative.

integrating factor: μ = e^(∫P dx)

First the integral of P: the integral of 2 is 2x.

∫ 2 dx = 2x

So the integrating factor is e^(2x).

No + C needed here: any one factor works.

μ = e^(2x)

3 Multiply both sides

Multiply both sides by e^(2x).

Every term, on both sides.

e^(2x)y′ + 2e^(2x)y = 4e^(2x)

Careful!

The right side is multiplied by e^(2x) too.

Both sides, always.

Careful: not (e^(2x)y)′ = 4 ✗

4 One derivative on the left

By the product rule, the derivative of e^(2x) × y is exactly our left side.

(μy)′ = μy′ + μ′y
μ′ = 2e^(2x)

So the left side is just (e^(2x)y)′: one derivative.

(e^(2x)y)′ = 4e^(2x)

5 Integrate both sides

Integrate both sides.

The integral of a derivative is the function itself.

e^(2x)y = ∫ (4e^(2x)) dx

On the right: 2e^(2x), and + C.

e^(2x)y = 2e^(2x) + C

6 Solve for y

Divide both sides by e^(2x).

y = 2e^(2x) + Ce^(2x)

Divide each term.

Dividing by e to a power is the same as e to minus that power.

y = 2 + Ce^(−2x)
C over e^(2x) = Ce^(−2x)

7 Check

Let's check: put y back in.

First y′ is −2Ce^(−2x).

y′ = −2Ce^(−2x)

Then y′ + 2y.

y′ + 2y = −2Ce^(−2x) + 2(2 + Ce^(−2x))

The C parts cancel, and we get 4: Q again.

Right!

= 4

Let's look back.

First: standard form.

Then: the integrating factor.

Then: multiply both sides.

Then: one derivative on the left.

Then: integrate both sides.

Then: solve for y.

Last: check.

Answer
C over e^(2x) = Ce^(−2x)

▶ Watch it solved

Solve y' - 3y = e^(2x) Medium

The question

Question: solve y′ − 3y = e^(2x).

y′ − 3y = e^(2x)

1 Standard form

Linear means this form: y′ + P y = Q.

P and Q have only x.

linear: y′ + P(x) y = Q(x)

Here P = −3 and Q = e^(2x).

P = −3, Q = e^(2x)

2 The integrating factor

The integrating factor is e to the integral of P.

Multiplying by it makes the left side one derivative.

integrating factor: μ = e^(∫P dx)

First the integral of P: the integral of −3 is −3x.

∫ −3 dx = −3x

So the integrating factor is e^(−3x).

No + C needed here: any one factor works.

μ = e^(−3x)

3 Multiply both sides

Multiply both sides by e^(−3x).

Every term, on both sides.

e^(−3x)y′ − 3e^(−3x)y = e^(−x)

Careful!

The right side is multiplied by e^(−3x) too.

Both sides, always.

Careful: not (e^(−3x)y)′ = e^(2x) ✗

4 One derivative on the left

By the product rule, the derivative of e^(−3x) × y is exactly our left side.

(μy)′ = μy′ + μ′y
μ′ = −−3e^(−3x)

So the left side is just (e^(−3x)y)′: one derivative.

(e^(−3x)y)′ = e^(−x)

5 Integrate both sides

Integrate both sides.

The integral of a derivative is the function itself.

e^(−3x)y = ∫ e^(−x) dx

On the right: −e^(−x), and + C.

e^(−3x)y = −e^(−x) + C

6 Solve for y

Divide both sides by e^(−3x).

y = −e^(−x) + Ce^(−3x)

Divide each term.

Dividing by e to a power is the same as e to minus that power.

y = −e^(2x) + Ce^(3x)
C over e^(−3x) = Ce^(3x)

7 Check

Let's check: put y back in.

First y′ is −2e^(2x) + 3Ce^(3x).

y′ = −2e^(2x) + 3Ce^(3x)

Then y′ − 3y.

y′ − 3y = −2e^(2x) + 3Ce^(3x) − 3(−e^(2x) + Ce^(3x))

The C parts cancel, and we get e^(2x): Q again.

Right!

= e^(2x)

Let's look back.

First: standard form.

Then: the integrating factor.

Then: multiply both sides.

Then: one derivative on the left.

Then: integrate both sides.

Then: solve for y.

Last: check.

Answer
C over e^(−3x) = Ce^(3x)

▶ Watch it solved

Solve y' + 2xy = 4x, y(0) = 5 Harder

The question

Question: solve y′ + 2xy = 4x, with y(0) = 5.

y′ + 2xy = 4x

y(0) = 5 is the starting value.

y(0) = 5

1 Standard form

Linear means this form: y′ + P y = Q.

P and Q have only x.

linear: y′ + P(x) y = Q(x)

Here P = 2x and Q = 4x.

P = 2x, Q = 4x

2 The integrating factor

The integrating factor is e to the integral of P.

Multiplying by it makes the left side one derivative.

integrating factor: μ = e^(∫P dx)

First the integral of P: the integral of 2x is x².

∫ 2x dx = x2

So the integrating factor is e^(x²).

μ = e^(x²)

3 Multiply both sides

Multiply both sides by e^(x²).

Every term, on both sides.

e^(x²)y′ + 2xe^(x²)y = 4xe^(x²)

Careful!

The right side is multiplied by e^(x²) too.

Both sides, always.

Careful: not (e^(x²)y)′ = 4x ✗

4 One derivative on the left

By the product rule, the derivative of e^(x²) × y is exactly our left side.

(μy)′ = μy′ + μ′y
μ′ = 2xe^(x²)

So the left side is just (e^(x²)y)′: one derivative.

(e^(x²)y)′ = 4xe^(x²)

5 Integrate both sides

This integral needs u-substitution: the power's derivative, 2x, is outside.

u = x2, du = 2x dx

Integrate both sides.

The integral of a derivative is the function itself.

e^(x²)y = ∫ (4xe^(x²)) dx

On the right: 2e^(x²), and + C.

e^(x²)y = 2e^(x²) + C

6 Solve for y

Divide both sides by e^(x²).

y = 2e^(x²) + Ce^(x²)

Divide each term.

Dividing by e to a power is the same as e to minus that power.

y = 2 + Ce^(−x²)
C over e^(x²) = Ce^(−x²)

7 Use the starting value

Put in x = 0 and y = 5.

e⁰ = 1.

5 = 2 + C × 1

So C = 3.

C = 3

So y = 2 + 3e^(−x²).

y = 2 + 3e^(−x²)

8 Check

Let's check with a calculator.

At x = 1: y is about 3.104, and its slope about −2.207.

x = 1: y ≈ 3.104, slope ≈ −2.207

The equation wants y′ = Q − Py: about −2.207.

The same.

Right!

Q − Py: 4x − 2xy ≈ −2.207

Let's look back.

First: standard form.

Then: the integrating factor.

Then: multiply both sides.

Then: one derivative on the left.

Then: integrate both sides.

Then: solve for y.

Then: use the starting value.

Last: check.

Answer
y = 2 + 3e^(−x²)

▶ Watch it solved

Practice

Try each one, then open the answer. Stuck? Open the problem to watch every step.

Easy

  1. solve y' + 2y = 4
    Answer
    C over e^(2x) = Ce^(−2x)
  2. solve y' + 3y = 6
    Answer
    C over e^(3x) = Ce^(−3x)
  3. solve y' - y = 2
    Answer
    C over e^(−x) = Cex
  4. solve y' + y = 5
    Answer
    C over ex = Ce^(−x)
  5. solve y' + 2y = 4, y(0) = 1
    Answer
    y = 2 − e^(−2x)
  6. solve y' + 3y = 9, y(0) = 0
    Answer
    y = 3 − 3e^(−3x)
  7. solve y' = 6 - 3y
    Answer
    C over e^(3x) = Ce^(−3x)

Medium

  1. solve y' - 3y = e^(2x)
    Answer
    C over e^(−3x) = Ce^(3x)
  2. solve y' + y = e^x
    Answer
    C over ex = Ce^(−x)
  3. solve y' + 2y = e^(-x)
    Answer
    C over e^(2x) = Ce^(−2x)
  4. solve y' - 2y = 3e^(2x)
    Answer
    C over e^(−2x) = Ce^(2x)
  5. solve y' + 2y = 6e^x, y(0) = 5
    Answer
    y = 2ex + 3e^(−2x)
  6. solve 2y' + 4y = 8, y(0) = 3
    Answer
    y = 2 + e^(−2x)
  7. solve y' + 2xy = 6x
    Answer
    C over e^(x²) = Ce^(−x²)
  8. solve y' - 4y = 8, y(0) = -1
    Answer
    y = −2 + e^(4x)

Harder

  1. solve y' + 2xy = 4x, y(0) = 5
    Answer
    y = 2 + 3e^(−x²)
  2. solve xy' + 2y = 5x^2
    Answer
    y = 54x2 + Cx2
  3. solve xy' + y = 3x^2
    Answer
    y = x2 + Cx
  4. solve xy' + 3y = 10x^2, y(1) = 3
    Answer
    y = 2x2 + 1x3
  5. solve y' - 2xy = 6x
    Answer
    C over e^(−x²) = Ce^(x²)
  6. solve y' + y = 3e^(2x), y(0) = 2
    Answer
    y = e^(2x) + e^(−x)
  7. solve y' = 2y + 4e^(3x)
    Answer
    C over e^(−2x) = Ce^(2x)