Steply

Solve dy/dx = xy^2, y(0) = 2

Step by step, with the reason for every step · Separable equations · Differential Equations

Step by step

The question

Question: solve dy/dx = xy², with y(0) = 2.

dydx = xy2

y(0) = 2 is the starting value: when x is 0, y is 2.

y(0) = 2

The right side splits into an x part, x, times a y part, y².

That is a separable equation.

separable: x × y2

1 Separate x and y

Divide both sides by y², so y is only on the left.

1y2 × dydx = x
÷ y² both sides

Now multiply both sides by dx.

All the y parts are with dy, all the x parts with dx.

1y2 dy = x dx

2 Integrate both sides

Put an integral sign on both sides.

∫ 1y2 dy = ∫ x dx

On the left: −1 over y.

On the right: ½x².

One + C is enough: the two numbers join into one.

−1y = 12x2 + C

The power rule backwards, for y.

∫ y−2 dy = y−1−1 = −1y

3 Use the starting value

Put in x = 0 and y = 2.

The x side gives 0.

−12 = 0 + C

So C = −1/2.

C = −12

4 Solve for y

Multiply both sides by y.

−1 = y(12x2 + −12)

Careful!

The C stays inside the bottom: it came with ½x².

Careful: not y = −112x2 + C ✗

Divide both sides by ½x² − 1/2.

y = −112x2 − 12

No fraction inside a fraction: times the top and the bottom by 2.

y = −2x2 − 1

So y = −2/(x² − 1).

y = −2x2 − 1

5 Check

Let's check with a calculator.

At x = 0.5, our answer gives y ≈ 2.667.

x = 0.5: y ≈ 2.667

The slope between two very close points: about 3.56.

slope: y(0.501) − y(0.499)0.002 ≈ 3.56

The right side at that point: about 3.56.

The same slope.

Right!

right side: xy² ≈ 3.56

Let's look back.

First: separate x and y.

Then: integrate both sides.

Then: use the starting value.

Then: solve for y.

Last: check.

Answer
y = −2x2 − 1

Your turn

Try this one yourself, then check:

dydx = 6xy2
Show the answer
y = −13x2 − 1

More from Separable equations

The whole lesson: Separable equations →