Worked examples
The question
Question: solve dy/dx = 2xy, with y(0) = 3.
dydx = 2xy
y(0) = 3 is the starting value: when x is 0, y is 3.
y(0) = 3
The right side splits into an x part, 2x, times a y part, y.
That is a separable equation.
separable: 2x Ć y
1 Separate x and y
Divide both sides by y, so y is only on the left.
1y Ć dydx = 2x
Ć· y both sides
Now multiply both sides by dx.
All the y parts are with dy, all the x parts with dx.
1y dy = 2x dx
2 Integrate both sides
Put an integral sign on both sides.
ā« 1y dy = ā« 2x dx
On the left: ln |y|.
On the right: x².
One + C is enough: the two numbers join into one.
ln |y| = x2 + C
The integral of 1/y is the natural log of the size of y.
ā« 1y dy = ln |y|
3 Solve for y
To undo ln, use e on both sides: e to the ln of the size of y is just |y|.
|y| = e^(x² + C)
A plus in the power splits into a times: e^(x² + C) = e^C à e^(x²).
|y| = e^(C) à e^(x²)
e^(a + b) = e^(a) Ć e^(b)
Careful!
The C is not added at the end.
e^C is a number that multiplies.
Careful: not y = e^(x²) + C ā
e^C is just some number.
With the ± from |y|, call it A: any number.
y = Ae^(x²)
A = ±e^(C) (any number)
4 Use the starting value
Put in x = 0 and y = 3.
The power is 0 there, and eā° = 1.
3 = Ae^(0)
So A = 3.
A = 3
So y = 3e^(x²).
y = 3e^(x²)
5 Check
Let's check with a calculator.
At x = 1, our answer gives y ā 8.155.
x = 1: y ā 8.155
The slope between two very close points: about 16.31.
slope: y(1.001) ā y(0.999)0.002 ā 16.31
The right side at that point: about 16.31.
The same slope.
Right!
right side: 2xy ā 16.31
Let's look back.
First: separate x and y.
Then: integrate both sides.
Then: solve for y.
Then: use the starting value.
Last: check.
ā¶ Watch it solved
The question
Question: solve dy/dx = xy², with y(0) = 1.
dydx = xy2
y(0) = 1 is the starting value: when x is 0, y is 1.
y(0) = 1
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 = 1.
The x side gives 0.
ā11 = 0 + C
So C = ā1.
C = ā1
4 Solve for y
Multiply both sides by y.
ā1 = y(12x2 + ā1)
Careful!
The C stays inside the bottom: it came with ½x².
Careful: not y = ā112x2 + C ā
Divide both sides by ½x² ā 1.
y = ā112x2 ā 1
No fraction inside a fraction: times the top and the bottom by 2.
y = ā2x2 ā 2
So y = ā2/(x² ā 2).
y = ā2x2 ā 2
5 Check
Let's check with a calculator.
At x = 1, our answer gives y ā 2.
x = 1: y ā 2
The slope between two very close points: about 4.
slope: y(1.001) ā y(0.999)0.002 ā 4
The right side at that point: about 4.
The same slope.
Right!
right side: xy² ā 4
Let's look back.
First: separate x and y.
Then: integrate both sides.
Then: use the starting value.
Then: solve for y.
Last: check.
ā¶ Watch it solved
The question
Question: solve dy/dx = x/y, with y(2) = 3.
dydx = xy
y(2) = 3 is the starting value: when x is 2, y is 3.
y(2) = 3
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 = 2 and y = 3.
The x side gives 2.
322 = 2 + C
So C = 5/2.
C = 52
4 Solve for y
Multiply both sides by 2.
y2 = x2 + 5
Careful!
The square root of a sum is not the sum of the roots.
It stays as one root.
Careful: not ā(x2 + 5) = x + 5 ā
Take the square root.
y is positive, so we keep the plus root: y = ā(x² + 5).
y = āx2 + 5
5 Check
Let's check with a calculator.
At x = 1, our answer gives y ā 2.449.
x = 1: y ā 2.449
The slope between two very close points: about 0.41.
slope: y(1.001) ā y(0.999)0.002 ā 0.41
The right side at that point: about 0.41.
The same slope.
Right!
right side: x/y ā 0.41
Let's look back.
First: separate x and y.
Then: integrate both sides.
Then: use the starting value.
Then: solve for y.
Last: check.
ā¶ Watch it solved