## Separation of Variables

### Learning Outcomes

• Use separation of variables to solve a differential equation
• Solve applications using separation of variables

### Definition

A separable differential equation is any equation that can be written in the form

$y^{\prime} =f\left(x\right)g\left(y\right)$.

The term ‘separable’ refers to the fact that the right-hand side of the equation can be separated into a function of $x$ times a function of $y$. Examples of separable differential equations include

$\begin{array}{}\\ \\ y^{\prime} =\left({x}^{2}-4\right)\left(3y+2\right)\hfill \\ y^{\prime} =6{x}^{2}+4x\hfill \\ y^{\prime} =\sec{y}+\tan{y}\hfill \\ y^{\prime} =xy+3x - 2y - 6.\hfill \end{array}$

The second equation is separable with $f\left(x\right)=6{x}^{2}+4x$ and $g\left(y\right)=1$, the third equation is separable with $f\left(x\right)=1$ and $g\left(y\right)=\sec{y}+\tan{y}$, and the right-hand side of the fourth equation can be factored as $\left(x+3\right)\left(y - 2\right)$, so it is separable as well. The third equation is also called an autonomous differential equation because the right-hand side of the equation is a function of $y$ alone. If a differential equation is separable, then it is possible to solve the equation using the method of separation of variables.

### Problem-Solving Strategy: Separation of Variables

1. Check for any values of $y$ that make $g\left(y\right)=0$. These correspond to constant solutions.
2. Rewrite the differential equation in the form $\frac{dy}{g\left(y\right)}=f\left(x\right)dx$.
3. Integrate both sides of the equation.
4. Solve the resulting equation for $y$ if possible.
5. If an initial condition exists, substitute the appropriate values for $x$ and $y$ into the equation and solve for the constant.

Note that Step 4. states “Solve the resulting equation for $y$ if possible.” It is not always possible to obtain $y$ as an explicit function of $x$. Quite often we have to be satisfied with finding $y$ as an implicit function of $x$.

### Example: Using Separation of Variables

Find a general solution to the differential equation $y^{\prime} =\left({x}^{2}-4\right)\left(3y+2\right)$ using the method of separation of variables.

Watch the following video to see the worked solution to Example: Using Separation of Variables

For closed captioning, open the video on its original page by clicking the Youtube logo in the lower right-hand corner of the video display. In YouTube, the video will begin at the same starting point as this clip, but will continue playing until the very end.

### try it

Use the method of separation of variables to find a general solution to the differential equation $y^{\prime} =2xy+3y - 4x - 6$.

### Example: Solving an Initial-Value Problem

Using the method of separation of variables, solve the initial-value problem

$y^{\prime} =\left(2x+3\right)\left({y}^{2}-4\right),y\left(0\right)=-3$.

### try it

Find the solution to the initial-value problem

$6y^{\prime} =\left(2x+1\right)\left({y}^{2}-2y - 8\right),y\left(0\right)=-3$

using the method of separation of variables.

## Applications of Separation of Variables

Many interesting problems can be described by separable equations. We illustrate two types of problems: solution concentrations and Newton’s law of cooling.

### Solution concentrations

Consider a tank being filled with a salt solution. We would like to determine the amount of salt present in the tank as a function of time. We can apply the process of separation of variables to solve this problem and similar problems involving solution concentrations.

### Example: Determining Salt Concentration over Time

A tank containing $100\text{L}$ of a brine solution initially has $4\text{kg}$ of salt dissolved in the solution. At time $t=0$, another brine solution flows into the tank at a rate of $2\text{L/min}\text{.}$ This brine solution contains a concentration of $0.5\text{kg/L}$ of salt. At the same time, a stopcock is opened at the bottom of the tank, allowing the combined solution to flow out at a rate of $2\text{L/min}$, so that the level of liquid in the tank remains constant (Figure 2). Find the amount of salt in the tank as a function of time (measured in minutes), and find the limiting amount of salt in the tank, assuming that the solution in the tank is well mixed at all times.

Watch the following video to see the worked solution to Example: Determining Salt Concentration over Time

For closed captioning, open the video on its original page by clicking the Youtube logo in the lower right-hand corner of the video display. In YouTube, the video will begin at the same starting point as this clip, but will continue playing until the very end.

### try it

A tank contains $3$ kilograms of salt dissolved in $75$ liters of water. A salt solution of $0.4\text{kg salt/L}$ is pumped into the tank at a rate of $6\text{L/min}$ and is drained at the same rate. Solve for the salt concentration at time $t$. Assume the tank is well mixed at all times.

### Newton’s law of cooling

Newton’s law of cooling states that the rate of change of an object’s temperature is proportional to the difference between its own temperature and the ambient temperature (i.e., the temperature of its surroundings). If we let $T\left(t\right)$ represent the temperature of an object as a function of time, then $\frac{dT}{dt}$ represents the rate at which that temperature changes. The temperature of the object’s surroundings can be represented by ${T}_{s}$. Then Newton’s law of cooling can be written in the form

$\frac{dT}{dt}=k\left(T\left(t\right)-{T}_{s}\right)$

or simply

$\frac{dT}{dt}=k\left(T-{T}_{s}\right)$.

The temperature of the object at the beginning of any experiment is the initial value for the initial-value problem. We call this temperature ${T}_{0}$. Therefore the initial-value problem that needs to be solved takes the form

$\frac{dT}{dt}=k\left(T-{T}_{s}\right),T\left(0\right)={T}_{0}$,

where $k$ is a constant that needs to be either given or determined in the context of the problem. We use these equations in the next example.

### Example: Waiting for a Pizza to Cool

A pizza is removed from the oven after baking thoroughly, and the temperature of the oven is $350^\circ\text{F}\text{.}$ The temperature of the kitchen is $75^\circ\text{F}$, and after $5$ minutes the temperature of the pizza is $340^\circ\text{F}\text{.}$ We would like to wait until the temperature of the pizza reaches $300^\circ\text{F}$ before cutting and serving it (Figure 3). How much longer will we have to wait?

Watch the following video to see the worked solution to Example: Waiting for a Pizza to Cool

For closed captioning, open the video on its original page by clicking the Youtube logo in the lower right-hand corner of the video display. In YouTube, the video will begin at the same starting point as this clip, but will continue playing until the very end.

### try it

A cake is removed from the oven after baking thoroughly, and the temperature of the oven is $450^\circ\text{F}\text{.}$ The temperature of the kitchen is $70^\circ\text{F}$, and after $10$ minutes the temperature of the cake is $430^\circ\text{F}\text{.}$

1. Write the appropriate initial-value problem to describe this situation.
2. Solve the initial-value problem for $T\left(t\right)$.
3. How long will it take until the temperature of the cake is within $5^\circ\text{F}$ of room temperature?