![]() |
Separation of Variables |
PPLATO @ | ||||
PPLATO / Tutorials / Differential Equations |
||||||
|
![]() |
If one can re-arrange an ordinary differential equation into the following standard form:
then the solution may be found by the technique of separation of variables.
This result is obtained by dividing the standard form by g(y), and then integrating both sides with respect to x.
Click on questions to reveal their solutions
Exercise 1:
Find the general solution of dydx = 3x2e−y and the particular solution that satisfies the condition y(0) = 1
Solution:
The equation is of the form dydx = ƒ(x) g(y), where ƒ(x) = 3x2 and g(x) = e−y, so we can separate the variables and then integrate:
General solution: y = ln (x3 + A)
Particular solution: y(x) = 1 when x = 0, i.e. e1 = 03 + A
Exercise 2:
Find the general solution of dydx = yx
Solution:
The equation is of the form dydx = ƒ(x) g(y), where ƒ(x) = 1x and g(x) = y, so we can separate the variables and then integrate:
i.e. ln y | = | ln x + C |
= | ln x + ln k (ln k = C = constant) | |
i.e. ln y − ln x | = | ln k |
i.e. ln (y⁄x) | = | ln k |
i.e. y | = | kx |
Exercise 3:
Solve the equation dydx = y + 1x − 1 given the boundary condition: y = 1 at x = 0
Solution:
Find the general solution first. Then aply the boundary condition to get the particular solution.
The equation is of the form dydx = ƒ(x) g(y), where ƒ(x) = 1x − 1 and g(x) = y + 1, so separate the variables and integrate:
i.e. ln (y + 1) | = | ln (x − 1) + C |
= | ln (x − 1) + ln k (k = arbitrary constant) | |
i.e. ln (y + 1) − ln (x − 1) | = | ln k |
i.e. ln ( y + 1x − 1 ) | = | ln k |
i.e. y + 1x − 1 | = | k |
i.e. y + 1 | = | k(x − 1) ⇐ general solution |
Now determine k for particular solution with y(0) = 1:
1 + 1 | = | k(0 − 1) |
i.e. 2 | = | −k |
∴ k | = | −2 |
so: y + 1 | = | −2 (x − 1) |
∴ y | = | −2x + 1 ⇐ particular solution |
Exercise 4:
Solve y2dydx = x and find the particular solution when y(0) = 1
Solution:
Use separation of variables to find the general solution first:
Particular solution: with y = 1, x = 0, i.e. 1⁄3 = 0 + C, i.e. C = 1⁄3
Exercise 5:
Find the solution of dydx = e2x+y that has y = 0 when x = 0
Solution:
Find the general solution first, then find the particular solution.
Write equation as dydx = e2x ey ( ≡ ƒ(x) g(y))
Separate variables and integrate:
∫ dyey | = | ∫e2x dx |
i.e. −e−y | = | 12 e2x + C |
i.e. e−y | = | − 12 e2x − C |
i.e. −y | = | ln (− 12 e2x − C) |
i.e. y | = | − ln (− 12 e2x − C) ⇐ general solution |
Particular solution with y = 0, x = 0 gives:
0 | = | − ln (− 12 − C) |
i.e. − 12 − C | = | 1 |
i.e. C | = | − 32 |
∴ y | = | −ln ( 3 − e2x2 ) |
Exercise 6:
Find the general solution of xyx + 1 = dydx
Solution:
Separate variables and integrate:
Numerator and denominator of LHS are same degree in x: reduce degree of numerator using long division:
i.e. ∫ (1 − 1x + 1 ) dx | = | ∫ dyy |
i.e. x − ln (x + 1) | = | ln y + ln k (ln k = constant of integration) |
i.e. x | = | ln (x + 1) + ln y + ln k |
= | ln [ky(x + 1)] | |
i.e. ex | = | ky(x + 1) ⇐ general solution |
Exercise 7:
Find the general solution of x sin 2y⋅dydx = (x + 1)2
Solution:
Separate variables and integrate:
i.e. ∫sin2y dy | = | ∫ (x + 1)2x dx |
i.e. ∫ 12 (1 − cos 2y) dy | = | ∫ x2 + 2x + 1x dx |
i.e. 12 ∫dy − 12 ∫ cos 2y dy | = | ∫ ( x + 2 + 1x ) dx |
i.e. 12 y − 12 ⋅12 sin 2y | = | 12x2 + 2x + ln x + C |
Exercise 8:
Solve dydx = −2x tan y
Solution:
Find general solution first.
Separate variables: dytan y | = | −2x dx |
Integrate: i.e. ∫ cot y dy | = | −2∫x dx |
i.e. ln (sin y) | = | −2⋅ x22 + A |
i.e. sin y | = | e−x2 + A |
Particular solution: y = π2 when x = 0
gives: sin π2 | = | eA |
i.e. 1 | = | eA |
i.e. A | = | 0 |
∴ sin y | = | e−x2 |
Exercise 9:
Solve (1 + x2)dydx + xy = 0 and find the particular solution when y(0) = 2
Solution:
Separate variables and integrate:
(1 + x2)dydx | = | −xy |
∫ dyy | = | −∫ x1 + x2 dx |
∫ dyy | = | − 12 ∫ 2x1 + x2 dx |
{ Note: compare with ∫ ƒ′(x)ƒ(x) } | ||
i.e. ln y | = | − 12 ln (1 + x2) + ln k (ln k = constant) |
i.e. ln y + ln (1 + x2)½ | = | ln k |
i.e. ln [y(1 + x2)½] | = | ln k |
∴ y(1 + x2)½ | = | k ⇐ general solution |
Particular solution with y(0) = 2:
i.e. y(x) | = | 2 when x = 0 |
i.e. 2(1 + 0)½ | = | k |
i.e. k | = | 2 |
∴ y(1 + x)½ | = | 2 |
Exercise 10:
Solve xdydx = y2 + 1 and find the particular solution when y(1) = 1
Solution:
∫ dyy2 + 1 | = | ∫ dxx |
{ Use standard integral: ∫ dy1 + y2 = tan−1 y + C } | ||
i.e. tan−1 y | = | ln x + C ⇐ general solution |
Particular solution with y = 1 when x = 1:
tan π4 = 1 ∴ tan−1(1) = π4 | while ln (1) = 0 (i.e. 1 = e0) | |
∴ π4 | = | 0 + C |
i.e. C | = | π4 |
∴ tan−1 y | = | ln x + π4 ⇐ particular solution |
Exercise 11:
Find the general solution of xdydx = y2 − 1
Solution:
∫ dyy2 − 1 | = | ∫ dxx |
Use partial fractions: 1y2 − 1 = Ay − 1 + By + 1 | = | A(y + 1) + B(y − 1)(y − 1)(y + 1) |
= | A(y + 1) + B(y − 1)y2 − 1 |
Compare numerators: 1 = (A + B)y + (A − B) [true for all y]
A + B | = | 0 | |
A − B | = | 1 | |
2A | = | 1 | |
∴ A = 12, B = −12 |
i.e. ∫ Ay − 1 + By + 1 dy | = | ∫ dxx |
i.e. 12 ∫ 1y − 1 − 1y + 1 dy | = | ∫ dxx |
i.e. 12 [ln (y − 1) − ln (y + 1)] | = | ln x + ln k |
i.e. ln (y − 1) − ln (y + 1) − 2 ln x | = | ln k |
i.e. ln [ y − 1(y + 1)x2] | = | 2 ln k |
∴ y − 1 | = | k'x2(y + 1) (k' = k2 = constant) |
Exercise 12:
Find the general solution of 1y dydx = xx2 + 1
Solution:
∫ dyy | = | ∫xx2 + 1 dx = 12 ∫2xx2 + 1 dx |
{ Note: ∫ ƒ′(x)ƒ(x) dx | = | ln [ƒ(x)] + A } |
i.e. ln y | = | 12 ln (x2 + 1) + C |
i.e. 12 ln y2 | = | 12 ln (x2 + 1) + C (modify LHS to allow log manipulations) |
i.e. 12 ln [ y2x2 + 1 ] | = | C |
i.e. y2x2 + 1 | = | e2C |
i.e. y2 | = | k(x2 + 1) (where k = e2C = constant) |
Exercise 13:
Solve dydx = yx(x + 1)
Solution:
∫ dyy | = | ∫ dxx(x + 1) |
Use partial fractions: 1x(x + 1) = Ax + Bx + 1 | = | A(x + 1) + Bxx(x + 1) |
= | (A + B)x + Ax(x + 1) |
Compare numerators: 1 = (A + B)x + A [true for all x]
i.e. A + B = 0 and A = 1, ∴ B = −1
i.e. ∫ dyy | = | ∫ ( 1x − 1x + 1 ) dx |
i.e. ln y | = | ln x − ln (x + 1) + C |
i.e. ln y − ln x + ln (x + 1) | = | ln k (ln k = C = constant) |
i.e. ln [ y(x + 1)x ] | = | ln k |
i.e. y(x + 1)x | = | k |
∴ y | = | kxx + 1 ⇐ general solution |
Particular solution with y(1) = 3:
i.e. 3 | = | k1 + 1 |
i.e. k | = | 6 |
∴ y | = | 6xx + 1 |
Exercise 14:
Find the general solution of sec x⋅dydx = sec2y
Solution:
i.e. ∫ dysec2 y | = | ∫ dxsec x |
i.e. ∫ cos2 y dy | = | cos x dx |
i.e. ∫ 1 + cos 2y2 | = | cos x dx |
y2 + 12 ⋅ 12sin 2y | = | sin x + C |
∴ 2y + sin 2y | = | 4 sin x + C' (where C' = 4C = constant) |
Exercise 15:
Find the general solution of cosec3 x⋅dydx = cos2y
Solution:
i.e. ∫ dycos2 y | = | ∫ dxcosec3 x |
= | ∫sin3 x dx | |
= | ∫sin2 x ⋅sin x dx | |
= | ∫(1 − cos2 x ⋅sin x dx | |
= | ∫ sin x dx − ∫cos2 x ⋅sin x dx | |
Set u = cos x in 2nd term, so dudx = −sin x | ||
→ cos2 x sin x = −u2 du | ||
LHS is standard integral: ∫ sec2 dy = tan y + A | ||
i.e. tan y | = | −cos x + cos3 x3 + C ⇐ general solution |
Exercise 16:
Find the general solution of (1 − x2)dydx + x(y − a) = 0
Solution:
Rewrite equation: (1 − x2) dydx | = | −x(y − a) |
i.e. ∫ dyy − a | = | −∫ x1 − x2 dx |
i.e. ∫ dyy − a | = | + 12 ∫ −2x1 − x2 dx [compare RHS with ∫ ƒ′(x)ƒ(x) dx] |
i.e. ln (y − a) | = | 12 ln (1 − x2) + ln k |
i.e. ln (y − a) − ln (1 − x2)½ | = | ln k |
∴ y − a | = | k(1 − x2)½ |
ƒ(x) | ∫ƒ(x) dx | ƒ(x) | ∫ƒ(x) dx | |
---|---|---|---|---|
xn | xn+1 n+1 (n ≠ −1) | [g(x)]n g'(x) | [g(x)]n+1 n+1 (n ≠ −1) | |
1x | ln x | g'(x)g(x) | ln g(x) | |
ex | ex | ax | axln a (a > 0) | |
sin x | −cos x | sinh x | cosh x | |
cos x | sin x | cosh x | sinh x | |
tan x | − ln cosx | tanh x | ln cosh x | |
cosec x | ln tan x2 | cosech x | ln tanh x2 | |
sec x | ln sec x + tan x | sec x | 2 tan−1ex | |
sec2 x | tan x | sec2 x | tanh x | |
cot x | ln sin x | cot x | ln sinh x | |
sin2 x | x2 − sin 2x4 | sinh2 x | sinh 2x4 − x2 | |
cos2 x | x2 + sin 2x4 | cosh2 x | sinh 2x4 + x2 | |
1a2 + x2 | 1a tan −1 xa (a > 0) | √a2 + x2 | a22 [ sinh−1( xa ) + x √a2−x2 a2 ] | |
1a2 − x2 | 12a ln a + xa − x (0 < x < a) | √a2−x2 | a22 [ sin−1( xa ) + x √a2−x2 a2 ] | |
1x2 − a2 | 12a ln x − ax + a (x > a > 0) | √x2 − a2 | a22 [−cosh−1( xa ) + x √x2−a2 a2 ] | |
1 √ a2 + x2 | ln x + √a2 + x2 a (a > 0) | |||
1 √ a2 − x2 | sin−1 xa (−a < x < a) | 1 √ x2 − a2 | ln x + √x2 − a2 a (x > a > 0) |