Steply

Solve dy/dx = -x/y, y(0) = 5

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

Step by step

The question

Question: solve dy/dx = −x/y, with y(0) = 5.

dydx = −xy

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

y(0) = 5

The right side splits into an x part, −x, times a y part, 1 over y.

That is a separable equation.

separable: −x × 1y

1 Separate x and y

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

y × dydx = −x
× y both sides

Now multiply both sides by dx.

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

y dy = −x dx

2 Integrate both sides

Put an integral sign on both sides.

∫ y dy = ∫ −x dx

On the left: y² over 2.

On the right: −½x².

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

y22 = −12x2 + C

The power rule backwards, for y.

∫ y dy = y22

3 Use the starting value

Put in x = 0 and y = 5.

The x side gives 0.

522 = 0 + C

So C = 25/2.

C = 252

4 Solve for y

Multiply both sides by 2.

y2 = −x2 + 25

Careful!

The square root of a sum is not the sum of the roots.

It stays as one root.

Careful: not √(−x2 + 25) = −x + 25 ✗

Take the square root.

y(0) is positive, so we keep the plus root: y = √(− x² + 25).

y = √−x2 + 25

5 Check

Let's check with a calculator.

At x = 1, our answer gives y ≈ 4.899.

x = 1: y ≈ 4.899

The slope between two very close points: about −0.2.

slope: y(1.001) − y(0.999)0.002 ≈ −0.2

The right side at that point: about −0.2.

The same slope.

Right!

right side: −x/y ≈ −0.2

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 = √−x2 + 25

Your turn

Try this one yourself, then check:

dydx = −6xy
Show the answer
y = √−6x2 + 9

More from Separable equations

The whole lesson: Separable equations →