Skip to main content
Library homepage
 

Text Color

Text Size

 

Margin Size

 

Font Type

Enable Dyslexic Font
Mathematics LibreTexts

12.3: Separable Equations

( \newcommand{\kernel}{\mathrm{null}\,}\)

 

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.

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

dydx=f(x)g(y)

Then we rewrite the equation as

dyg(y)=f(x)dx

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

dyg(y)=f(x)dx+C

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

Example 12.3.1

Take the equation

y=xy

First note that y=0 is a solution, so assume y0 from now on, so that we can divide by y. Write the equation as dydx=xy, then

dyy=xdx+C.

We compute the antiderivatives to get

ln|y|=x22+C

Or

|y|=ex22+C=ex22eC=Dex22

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

y=Dex22

for any number D (including zero or negative).

We check:

y=Dxex22=x(Dex22)=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 seemingly did a different operation to each side. Let us work through this method more rigorously. Take

dydx=f(x)g(y)

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

1g(y)dydx=f(x)

We integrate both sides with respect to x.

1g(y)dydxdx=f(x)dx+C

We use the change of variables formula (substitution) on the left hand side:

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

And we are done.

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=xyy2+1

We separate variables,

y2+1ydy=(y+1y)dy=xdx

We integrate to get

y22+ln|y|=x22+C

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

y2+2ln|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, and remember that y is a function of x, to get

y(2y+2y)=2x

Multiply both sides by y and divide by 2(y2+1) and you will get exactly the differential equation. We leave this computation to the reader.

If you have an implicit solution, and you want to compute values for y, you might have to be tricky. You might get multiple solutions y for each x, so you have to pick one. Sometimes you can graph x as a function of y, and then flip your paper. Sometimes you have to do more.

Computers are also good at some of these tricks. More advanced mathematical software usually has some way of plotting solutions to implicit equations. For example, for C=0 if you plot all the points (x,y) that are solutions to y2+2ln|y|=x2, you find the two curves in Figure 12.3.1. This is not quite a graph of a function. For each x there are two choices of y. To find a function you would have to pick one of these two curves. You pick the one that satisfies your initial condition if you have one. For example, the top curve satisfies the condition y(1)=1. So for each C we really got two solutions. As you can see, computing values from an implicit solution can be somewhat tricky. But sometimes, an implicit solution is the best we can do.

A graph that has two pieces.  One concave up and one concave down
Figure 12.3.1: The implicit solution y2+2ln|y|=x2 to y=xyy2+1.

The equation above also has the solution y=0. So the general solution is y2+2ln|y|=x2+C,andy=0.

These outlying solutions such as y=0 are sometimes called singular solutions.

Below is a video on solving a separable differential equation.

Example 12.3.2

Solve x2y=1x2+y2x2y2, y(1)=0.

Solution

First factor the right hand side to obtain

x2y=(1x2)(1+y2)

Separate variables, integrate, and solve for y

y1+y2=1x2x2,y1+y2=1x21,arctan(y)=1x2x+C,y=tan(1xx+C)

Solve for the initial condition, 0=tan(2+C) to get C=2 (or C=2+π, or C=2+2π, etc.). The particular solution we seek is, therefore, y=tan(1xx+2).

Example 12.3.3

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

Solution

Let T be the temperature of the coffee in degrees Celsius, and let A be the ambient (room) temperature, also in degrees Celsius. 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,

dTdt=k(AT),

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)

1TAdTdt=k,ln(TA)=kt+C,(note thatTA>0)TA=Dekt,T=A+Dekt

That is, T=22+Dekt. We plug in the first condition: 89=T(0)=22+D, and hence D=67. So T=22+67ekt. The second condition says 85=T(1)=22+67ek. Solving for k we get k=ln8522670.0616. Now we solve for the time t that gives us a temperature of 60 degrees. Namely, we solve 60=22+67e0.0616t

to get t=ln6022670.06169.21 minutes. So Juan can begin to drink the coffee at just over 9 minutes from the time Juan made it. That is probably about the amount of time it took us to calculate how long it would take. See Figure 12.3.2.

The two graphs.  The left is less curvy and shows multiple vertical and horizontal lines and the right just one horizontal line.
Figure 12.3.2: Graphs of the coffee temperature function T(t). On the left, horizontal lines are drawn at temperatures 60, 85, and 89. Vertical lines are drawn at t=1 and t=9.21. Notice that the temperature of the coffee hits 85 at t=1, and 60 at t9.21. On the right, the graph is over a longer period of time, with a horizontal line at the ambient temperature 22.
Example 12.3.4

Find the general solution to y=xy23 (including singular solutions).

Solution

First note that y=0 is a solution (a singular solution). Now assume that y0. 3y2y=x,3y=x22+C,y=3x22+C=6x2+2C.

So the general solution is, y=6x2+2C,andy=0.


This page titled 12.3: Separable Equations is shared under a CC BY-SA 4.0 license and was authored, remixed, and/or curated by Jiří Lebl.

Support Center

How can we help?