Worked examples
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
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
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.
▶ Watch it solved