12.3: Separable Equations
- Last updated
- May 12, 2023
- Save as PDF
- Page ID
- 128055
( \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 y≠0 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.

The equation above also has the solution y=0. So the general solution is y2+2ln|y|=x2+C,andy=0.
Below is a video on solving a separable differential equation.
Example 12.3.2
Solve x2y′=1−x2+y2−x2y2, y(1)=0.
Solution
First factor the right hand side to obtain
x2y′=(1−x2)(1+y2)
Separate variables, integrate, and solve for y
y′1+y2=1−x2x2,y′1+y2=1x2−1,arctan(y)=−1x2−x+C,y=tan(−1x−x+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(−1x−x+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(A−T),
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)
1T−AdTdt=−k,ln(T−A)=−kt+C,(note thatT−A>0)T−A=De−kt,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 T=22+67e−kt. The second condition says 85=T(1)=22+67e−k. Solving for k we get k=−ln85−2267≈0.0616. Now we solve for the time t that gives us a temperature of 60 degrees. Namely, we solve 60=22+67e−0.0616t

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 y≠0. −3y2y′=x,3y=x22+C,y=3x22+C=6x2+2C.