Steply

Solve xy' + y = 3x^2

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

Step by step

The question

Question: solve xy′ + y = 3x².

xy′ + y = 3x2

1 Standard form

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

P and Q have only x.

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

Divide everything by x, so y′ is alone at the front.

y′ + 1xy = 3x
÷ x

Here P = 1/x and Q = 3x.

P = 1x, Q = 3x

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 1/x is ln x.

Take x > 0.

∫ 1x dx = ln x

So the integrating factor is e to that power.

μ = e^(ln x)

And e to the ln of something is just that something.

So the integrating factor is x.

μ = x
e^(ln a) = a

3 Multiply both sides

Multiply both sides by x.

Every term, on both sides.

xy′ + 1y = 3x2

Careful!

The right side is multiplied by x too.

Both sides, always.

Careful: not (xy)′ = 3x ✗

4 One derivative on the left

By the product rule, the derivative of x × y is exactly our left side.

(μy)′ = μy′ + μ′y
μ′ = 1

So the left side is just (xy)′: one derivative.

(xy)′ = 3x2

5 Integrate both sides

Integrate both sides.

The integral of a derivative is the function itself.

xy = ∫ (3x2) dx

On the right: x³, and + C.

xy = x3 + C

6 Solve for y

Divide both sides by x.

y = x2 + Cx

Divide each term.

x to a power over x: take away the powers.

y = x2 + Cx

7 Check

Let's check: put y back in.

First y′ is 2x − C over x².

y′ = 2x − Cx2

Then y′ + (1/x) × y.

y′ + 1xy = 2x − Cx2 + 1x(x2 + Cx)

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

Right!

= 3x

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
y = x2 + Cx

Your turn

Try this one yourself, then check:

Solve xy′ + y = 4x3
Show the answer
y = x3 + Cx

More from The integrating factor

The whole lesson: The integrating factor →