[Notes on Diffy Qs home] [PDF version] [Buy cheap paperback version]

[next] [prev] [prev-tail] [tail] [up]

1.3 Separable equations

Note: 1 lecture, §1.4 in [EP], §2.2 in [BD]

When a differential equation is of the form  ′ y = f(x) , we can just integrate:  ∫ y = f (x ) dx + C . Unfortunately this method no longer works for the general form of the equation  ′ y = f(x,y) . Integrating both sides yields

 ∫ y = f (x,y) dx + C.

Notice the dependence on y in the integral.

1.3.1 Separable equations

Let us suppose that the equation is separable. That is, let us consider

y′ = f(x)g(y),

for some functions f(x) and g(y) . Let us write the equation in the Leibniz notation

dy- dx = f (x)g(y).

Then we rewrite the equation as

dy ----= f (x) dx. g(y)

Now both sides look like something we can integrate. We obtain

∫ dy ∫ ----= f(x) dx + C. g(y)

If we can find closed form expressions for these two integrals, we can, perhaps, solve for y .

Example 1.3.1: Take the equation

 ′ y = xy.

First note that y = 0 is a solution, so assume y ⇔ 0 from now on. Write the equation as dy dx = xy , then

∫ ∫ dy- y = x dx + C.

We compute the antiderivatives to get

 x2 ln |y| = 2 + C.

Or

|y| = ex22 +C = e x22 eC = De x22 ,

where D > 0 is some constant. Because y = 0 is a solution and because of the absolute value we actually can write:

 x2- y = De 2 ,

for any number D (including zero or negative).

We check:

 2 ( 2) y′ = Dxe x2-= x De x2- = xy.

Yay!

We should be a little bit more careful with this method. You may be worried that we were integrating in two different variables. We seemed to be doing a different operation to each side. Let us work this method out more rigorously. Take

dy- dx = f (x)g(y).

We rewrite the equation as follows. Note that y = y(x) is a function of x and so is dy dx !

--1- dy-= f (x ). g (y) dx

We integrate both sides with respect to x .

∫ ∫ -1--dy-dx = f (x ) dx + C. g(y) dx

We can use the change of variables formula.

∫ ∫ --1- g(y) dy = f(x) dx + C.

And we are done.

1.3.2 Implicit solutions

It is clear that we might sometimes get stuck even if we can do the integration. For example, take the separable equation

y′ = -xy--. y2 + 1

We separate variables,

y2 + 1 ( 1 ) ------ dy = y + -- dy = x dx. y y

We integrate to get

y2 x2 2 + ln|y| = 2 + C,

or perhaps the easier looking expression (where D = 2C )

y2 + 2 ln |y| = x2 + D.

It is not easy to find the solution explicitly as it is hard to solve for y . We, therefore, leave the solution in this form and call it an implicit solution. It is still easy to check that an implicit solution satisfies the differential equation. In this case, we differentiate with respect to x to get

 ( ) y′ 2y + 2-= 2x. y

It is simple to see that the differential equation holds. If you want to compute values for y , you might have to be tricky. For example, you can graph x as a function of y , and then flip your paper. Computers are also good at some of these tricks.

We note that the above equation also has the solution y = 0 . The general solution is y2 + 2 ln |y| = x 2 + C together with y = 0 . These outlying solutions such as y = 0 are sometimes called singular solutions.

1.3.3 Examples

Example 1.3.2: Solve x2y′ = 1 - x2 + y2 - x 2y2 , y(1 ) = 0 .

First factor the right hand side to obtain

 2 ′ 2 2 x y = (1 - x )(1 + y ).

We separate variables, integrate, and solve for y .

 ′ 2 --y--- = 1---x-, 1 + y2 x2 y′ 1 -----2 = -2 - 1, 1 + y x arctan(y) = -1-- x + C, x (-1 ) y = tan ---- x + C . x
Now solve for the initial condition, 0 = tan (- 2 + C ) to get C = 2 (or 2 + π , etc…). The solution we are seeking is, therefore,
 ( ) y = tan -1-- x + 2 . x

Example 1.3.3: Bob made a cup of coffee, and Bob likes to drink coffee only once it will not burn him at 60 degrees. Initially at time t = 0 minutes, Bob measured the temperature and the coffee was 89 degrees Celsius. One minute later, Bob measured the coffee again and it had 85 degrees. The temperature of the room (the ambient temperature) is 22 degrees. When should Bob start drinking?

Let T be the temperature of the coffee, and let A be the ambient (room) temperature. Newton’s law of cooling states that the rate at which the temperature of the coffee is changing is proportional to the difference between the ambient temperature and the temperature of the coffee. That is,

dT ---= k(A - T), dt

for some constant k . For our setup A = 22 , T(0) = 89 , T (1 ) = 85 . We separate variables and integrate (let C and D denote arbitrary constants)

 1 dT ---------= - k, T - A dt ln(T - A) = - kt + C, (note that T - A > 0) -kt T - A = De , T = A + De -kt.
That is, T = 22 + De -kt . We plug in the first condition: 89 = T (0 ) = 22 + D , and hence D = 67 . So  -kt T = 22 + 67e . The second condition says  -k 85 = T (1) = 22 + 67e . Solving for k we get  85-22 k = - ln -67--≈ 0.0616 . Now we solve for the time t that gives us a temperature of 60 degrees. That is, we solve 60 = 22 + 67e-0.0616t to get t = - ln-60-6722-≈ 9.21 0.0616 minutes. So Bob can begin to drink the coffee at just over 9 minutes from the time Bob made it. That is probably about the amount of time it took us to calculate how long it would take.

Example 1.3.4: Find the general solution to  2 y′ = -x3y (including singular solutions).

First note that y = 0 is a solution (a singular solution). So assume that y ⇔ 0 and write

-3-y′ = x, y2 3 x 2 --= -- + C, y 2 ---3--- ---6---- y = x2∕2 + C = x 2 + 2C .

1.3.4 Exercises

Exercise 1.3.1: Solve y′ = x∕y .

Exercise 1.3.2: Solve y′ = x2y .

Exercise 1.3.3: Solve dx 2 ---= (x - 1)t dt , for x(0) = 0 .

Exercise 1.3.4: Solve dx- dt = x sin (t) , for x(0) = 1 .

Exercise 1.3.5: Solve dy- dx = xy + x + y + 1 . Hint: Factor the right hand side.

Exercise 1.3.6: Solve xy′ = y + 2x2y , where y(1) = 1 .

Exercise 1.3.7: Solve dy- y2 +-1 dx = x2 + 1 , for y(0) = 1 .

Exercise 1.3.8: Find an implicit solution for dy x2 + 1 ---= -2---- dx y + 1 , for y(0) = 1 .

Exercise 1.3.9: Find an explicit solution for  ′ -y y = xe , y(0) = 1 .

Exercise 1.3.10: Find an explicit solution for  ′ -y xy = e , for y(1) = 1 .

Exercise 1.3.11: Find an explicit solution for  2 y′ = ye-x , y(0) = 1 . It is alright to leave a definite integral in your answer.

Exercise 1.3.12: Suppose a cup of coffee is at 100 degrees Celsius at time t = 0 , it is at 70 degrees at t = 10 minutes, and it is at 50 degrees at t = 20 minutes. Compute the ambient temperature.

Exercise 1.3.101: Solve  ′ y = 2xy .

Exercise 1.3.102: Solve x′ = 3xt2 - 3t2 , x(0) = 2 .

Exercise 1.3.103: Find an implicit solution for  ′ -1-- x = 3x2+1 , x(0) = 1 .

Exercise 1.3.104: Find an explicit solution to xy′ = y2 , y(1) = 1 .

Exercise 1.3.105: Find an implicit solution to y′ = sin(x) cos(y) .

Exercise 1.3.106: Take Example 1.3.3 with the same numbers: 89 degrees at t = 0 , 85 degrees at t = 1 , and ambient temperature of 22 degrees. Suppose these temperatures were measured with precision of ± 0.5 degrees. Given this imprecision, the time it takes the coffee to cool to (exactly) 60 degrees is also only known in a certain range. Find this range. Hint: Think about what kind of error makes the cooling time longer and what shorter.