Steply

Solve y' - 2xy = 6x

Step by step, with the reason for every step · The integrating factor · Differential Equations

Step by step

The question

Question: solve y′ − 2xy = 6x.

y′ − 2xy = 6x

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 = 6x.

P = −2x, Q = 6x

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 = 6xe^(−x²)

Careful!

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

Both sides, always.

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

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)′ = 6xe^(−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 = ∫ (6xe^(−x²)) dx

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

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

6 Solve for y

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

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

Divide each term.

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

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

7 Check

Let's check with a calculator, taking C = 1.

At x = 1: y is about −0.282, and its slope about 5.437.

C = 1, x = 1: y ≈ −0.282, slope ≈ 5.437

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

The same.

Right!

Q − Py: 6x − −2xy ≈ 5.437

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^(−x²) = Ce^(x²)

Your turn

Try this one yourself, then check:

Solve y′ − 2xy = 4x
Show the answer
y = −2 + Ce^(x²)

More from The integrating factor

The whole lesson: The integrating factor →