Separation of variables

A small percentage increase in price may produce a predictable percentage decrease in demand. That local sensitivity helps with a small adjustment, but what does it tell us about a larger change? To predict demand at other prices, we need a function that follows the rate relationship as both quantities change.
For some differential equations, algebra puts each variable with its own differential. Integration then lets us recover a relationship between the quantities, and a known starting value determines the particular solution. The same method can turn a heating rate into a temperature prediction.
By the end of this lesson, you should be able to:
- Solve separable differential equations using differential algebra, integration, and initial conditions.
- Recover a demand function from constant elasticity and use a heating or cooling model to predict temperatures and elapsed times.
- Interpret logarithmic absolute values, excluded equilibrium solutions, and solution intervals.
A seller knows that at a price of \( \$10 \), demand is \( 400 \) items per week. Suppose a small \( 1\% \) price increase is expected to reduce demand by approximately \( 2\% \), and this same relative sensitivity holds near every positive price. What would happen to demand if the seller doubled the price? We'll use the small-change relationship to build a function that can answer that question.
Let \( p \) be the price in dollars and \( q \) the demand in items per week. We'll keep other conditions fixed and let demand vary continuously in our model, with positive prices and demand. For a \( 1\% \) increase from \( \$10 \), the price increase is dollar. The predicted demand change is approximately items per week, giving a new demand of approximately items per week.
Let's compare each change with its own starting value:
\[\begin{aligned}\frac{\Delta p}{p}&=\frac{0.1}{10}=0.01,\\\frac{\Delta q}{q}&\approx\frac{-8}{400}=-0.02.\end{aligned}\]
The ratio of these relative changes is \( \displaystyle \frac{\Delta q/q}{\Delta p/p}\approx \) . Its negative sign tells us that demand and price move in opposite directions.
For infinitesimal changes, this ratio is called elasticity. We'll assume that it is exactly \( -2 \) at every positive price:
\[\frac{\dd{q}/q}{\dd{p}/p}=-2.\]
Multiplying by \( \displaystyle \frac{\dd{p}}p \) puts the demand differential on its own side:
\(\displaystyle \frac{\dd{q}}q= \)\(\displaystyle \dd{p}.\)
We've put each variable with its own differential. This is separation of variables: we can integrate the demand side with respect to \( q \) and the price side with respect to \( p \).
Both sides contain a reciprocal. We know from Section 4.4 that \( \displaystyle \dd{(\ln x)}=\frac{\dd{x}}x \), so we can reverse that rule to integrate:
\[\int\frac1q\dd{q}=-2\int\frac1p\dd{p}.\]
Price and demand are positive. Using their numerical values in the units we've chosen, the logarithmic antiderivatives give
\(\displaystyle = \)\(\displaystyle + C.\)
We have \( \ln q=-2\ln p+C \). We've combined the constants from the two integrals into one constant \( C \). To recover \( q \), we can first use the logarithm's power property:
\(\displaystyle -2\ln p=\ln\left(p^{\)\(\displaystyle }\right).\)
We now have \( \ln q=\ln(p^{-2})+C \). To recover \( q \), we apply the exponential to both sides. It undoes the logarithm on the left; on the right, the exponential of a sum becomes a product:
\[\begin{aligned}q&=\ee^{\ln(p^{-2})+C}\\&=\ee^C p^{-2}.\end{aligned}\]
The factor \( \ee^C \) is a positive constant, which we'll call \( A \). Our model now has the form
\[q=Ap^{-2},\qquad A>0.\]
We can find \( A \) using the known demand: when \( p=10 \), \( q=400 \). Substituting gives \( 400={A\cdot10^{-2}} \), so \( A= \) .
Our demand function is
\(\displaystyle q= \)
for \( p>0 \).
Let's return to the question about doubling the price. Our function predicts:
| Price in dollars | \( 10 \) | \( 20 \) | \( 40 \) |
|---|---|---|---|
| Demand in items per week | \( 400 \) |
Each doubling of price multiplies demand by .
The exponent \( -2 \) turns a price factor of \( 2 \) into a demand factor of \( 2^{-2} \), or one quarter.
For our original \( 1\% \) price increase, the function predicts approximately \( 392.118 \) items per week, close to the estimate of \( 392 \). For a larger change, we follow the full function: doubling the price reduces demand by \( 75\% \). Integration has turned a relationship between infinitesimal changes into a function we can use to predict demand at other prices.
Separable equations
Sometimes we can rearrange a differential equation so that each variable is beside its own differential. We can then integrate each side to find a relationship between the variables. Let's start with an equation that leads to a familiar curve.
This is essentially implicit differentiation in reverse. Starting with \( x^2+y^2=4 \), we would differentiate to get
\[{2x\dd{x}}+{2y\dd{y}}=0,\]
and then solve for \( \displaystyle \frac{\dd{y}}{\dd{x}}=-\frac{x}{y} \). Here we started with that rate equation and integrated to recover the circle.
Once the variables are separated, we integrate:
\[\int f(x)\dd{x}=\int g(y)\dd{y}.\]
We can combine the constants from the two antiderivatives into one constant, then use the initial condition to find it. When we solve for \( y \), the starting value helps us choose the right branch, as it did for the semicircle.
When we divide by an expression involving \( y \), we also need to check what happens where that expression is zero. In \( \displaystyle \frac{\dd{y}}{\dd{x}}=3y \), dividing by \( y \) gives \( \displaystyle 3\dd{x}=\frac{\dd{y}}y \) for nonzero \( y \). But \( y=0 \) also satisfies the original equation. We keep that equilibrium solution separately.
The semicircle example used antiderivatives of powers. To solve separated equations involving reciprocals, we can build on the logarithmic differential from Section 4.4.
Integrating reciprocals
Separation sometimes produces a reciprocal such as \( \displaystyle \frac{\dd{y}}y \). The Anti-Power Rule leaves out the exponent \( -1 \), but the logarithmic differential gives us another way to integrate. For positive \( x \),
\[\dd{(\ln x)}=\frac{\dd{x}}x.\]
What happens when \( x \) is negative? We can still integrate the reciprocal there. Since \( -x \) is positive, let's try its logarithm. The Chain Rule gives
\[\begin{aligned}\dd{(\ln(-x))}&=\frac{-\dd{x}}{-x}\\&=\frac{\dd{x}}x.\end{aligned}\]
The two minus signs cancel, giving us the reciprocal again. We can therefore use \( \ln x \) on the positive side and \( \ln(-x) \) on the negative side. We can write both cases as \( \ln|x| \): it equals \( \ln x \) when \( x>0 \) and \( \ln(-x) \) when \( x<0 \).
The absolute value makes the logarithm's input positive on either side of zero. The rule applies separately on those two sides; zero is still excluded. We'll use the negative-input case in a heating problem, where the object starts cooler than its surroundings.
The same reasoning applies to an object warming or cooling in surroundings held at a fixed temperature. This proportional-difference model is called Newton’s law of cooling, and it describes heat transfer in either direction. Let \( T(t) \) be the object's temperature at time \( t \), and let \( T_a \) be the fixed temperature of its surroundings, called the ambient temperature. The rate equation is
\[\frac{\dd{T}}{\dd{t}}=-k(T-T_a),\qquad k>0.\]
We can see both warming and cooling in this equation. Below the surrounding temperature, the quantity \( T-T_a \) is negative and the rate is positive; above it, the rate is negative. The constant \( k \) controls how quickly the temperature responds to the difference.
Separating and integrating gives a solution we can use for either warming or cooling:
At \( t=0 \), this formula gives the starting temperature \( T_0 \). As time passes, the factor \( \ee^{-kt} \) shrinks, so the difference from the surroundings shrinks as well. An object that starts warmer than its surroundings cools; one that starts cooler warms. For a process beginning at time zero, we use \( t\ge0 \).
Elasticity
We can also use separation when we know how the relative changes in two quantities are related. For positive quantities \( x \) and \( y \), their elasticity is
\[E=\frac{\dd{y}/y}{\dd{x}/x}.\]
Rearranging gives a convenient way to calculate elasticity when we know the function:
\[E=\frac{\dd{y}}{\dd{x}}\frac{x}{y}.\]
To use this form, take the derivative and multiply by the input divided by the output.
For a small \( 1\% \) increase in \( x \), elasticity \( E \) predicts approximately an \( E\% \) change in \( y \). A positive value means \( y \) increases; a negative value means it decreases.
Let's turn that question around: if we know the elasticity, can we find the function? When the elasticity is constant, the resulting differential equation separates.
The same steps work for any constant elasticity \( a \). The separated equation \( \displaystyle \frac{\dd{y}}y=a\frac{\dd{x}}x \) integrates to \( \ln y=a\ln x+C \). Exponentiating gives a power function:
Changing \( A \) scales the output, while \( a \) tells us how sensitive \( y \) is to a relative change in \( x \). For sufficiently small changes, the percentage change in \( y \) is approximately \( a \) times the percentage change in \( x \). This gives an interpretation of the exponent even when \( A=1 \), as in \( y=x^a \).
In Explore, an elasticity of \( -2 \) gave the exponent in \( q=40000p^{-2} \). Its negative sign means demand decreases as price increases. For any of these power functions, multiplying the input by \( r>0 \) multiplies the output by \( r^a \).
Evaluate each integral. In the first two parts, the arbitrary constant is already shown beside the answer.
\( \displaystyle \int\frac{${n}}x\,\dd{x}= \) \( +C \).
Solution
Multiplying the reciprocal rule by \( ${n} \) gives \( \displaystyle ${prefix}\ln|x|+C \), on either side of \( x=0 \).
\( \displaystyle \int\frac{${a}}{${a}x+${b}}\,\dd{x}= \) \( +C \).
Solution
The logarithmic differential is \( \displaystyle \dd{(\ln|${a}x+${b}|)}=\frac{${a}}{${a}x+${b}}\dd{x} \). Reversing this rule gives the antiderivative \( \ln|${a}x+${b}|+C \), on either side of \( \displaystyle x=${excluded_input} \).
\( \displaystyle \int_{${a}}^{${b}}\frac1x\,\dd{x}= \) . Give your answer to three decimal places.
Solution
Both endpoints are positive, so
\[\begin{aligned}\int_{${a}}^{${b}}\frac1x\,\dd{x}&=\eval{\ln|x|}_{${a}}^{${b}}\\&=\ln ${b}-\ln ${a}\\&=\ln ${r}\\&\approx ${fixed(ln(r),3)}.\end{aligned}\]
\( \displaystyle \int_{-${b}}^{-${a}}\frac1x\,\dd{x}= \) . Give your answer to three decimal places.
Solution
The absolute value makes the logarithms meaningful at these negative endpoints:
\[\begin{aligned}\int_{-${b}}^{-${a}}\frac1x\,\dd{x}&=\eval{\ln|x|}_{-${b}}^{-${a}}\\&=\ln ${a}-\ln ${b}\\&=-\ln ${r}\\&\approx ${fixed(-ln(r),3)}.\end{aligned}\]
The integral is negative because the reciprocal is negative throughout this interval.
Which equations can be written with all the \( x \)-dependence beside \( \dd{x} \) and all the \( y \)-dependence beside \( \dd{y} \)? For each separable equation, write a separated form.
\( \dd{y}=xy^2\dd{x} \) is .
Solution
For \( y\ne0 \), divide by \( y^2 \):
\[x\dd{x}=\frac1{y^2}\dd{y}.\]
The constant function \( y=0 \) also solves the original equation and should be retained if we go on to solve it.
\( \displaystyle \dd{y}=\frac{x+1}{y-2}\dd{x} \) is .
Solution
The original equation requires \( y\ne2 \). Multiplying by \( y-2 \) gives
\[(x+1)\dd{x}=(y-2)\dd{y}.\]
\( \dd{y}=(x+y)\dd{x} \) is .
Solution
Dividing by \( x+y \) leaves both variables together in the coefficient of \( \dd{y} \): \( \displaystyle \frac{\dd{y}}{x+y}=\dd{x} \). The sum \( x+y \) cannot be factored into an \( x \)-only factor times a \( y \)-only factor, so rearranging it won't produce the required separated form.
Solve each initial-value problem by separating and integrating. Give \( y \) as a function of \( x \).
\( \dd{y}=${2*k}xy\dd{x},\quad y(0)=${a},\qquad y= \) .
Solution
Since the starting value is positive, we use the positive solution branch. Separating and integrating gives
\[\begin{aligned}\frac{\dd{y}}y&=${2*k}x\dd{x},\\\ln|y|&=${prefix}x^2+C,\\y&=A\ee^{${prefix}x^2}.\end{aligned}\]
Substituting \( x=0 \) and \( y=${a} \) gives \( A=${a} \). Thus \( y=${a}\ee^{${prefix}x^2} \), for every real \( x \). The equilibrium \( y=0 \) doesn't meet the initial condition.
\( \dd{y}=-${2*k}xy\dd{x},\quad y(0)=-${a},\qquad y= \) .
Solution
The initial value is negative, so the solution stays on the negative branch:
\[\begin{aligned}\frac{\dd{y}}y&=-${2*k}x\dd{x},\\\ln|y|&=-${prefix}x^2+C,\\y&=A\ee^{-${prefix}x^2}.\end{aligned}\]
At \( x=0 \), we have \( A=-${a} \). Therefore \( y=-${a}\ee^{-${prefix}x^2} \), for every real \( x \). The constant \( A \) carries the negative sign; exponentiation doesn't force \( y \) to be positive.
\( \displaystyle \dd{y}=-\frac{x}{y}\dd{x},\quad y(0)=-${r},\qquad y= \) . The largest interval containing \( 0 \) on which this solves the original equation is .
Solution
Multiply by \( y \) and integrate:
\[\begin{aligned}y\dd{y}&=-x\dd{x},\\\frac{y^2}2&=-\frac{x^2}2+C,\\x^2+y^2&=${r*r}.\end{aligned}\]
We found the last constant by substituting \( (0,-${r}) \). The negative initial value chooses the lower semicircle, \( y=-\sqrt{${r*r}-x^2} \). The interval is \( -${r}<x<${r} \); at its endpoints, \( y=0 \) and the original equation's denominator vanishes.
The initial point is below the horizontal axis, selecting the lower semicircle. The endpoints where y is zero are excluded. \( \dd{y}=${prefix}y\cos x\,\dd{x},\quad y(0)=${b},\qquad y= \) .
Solution
Separating puts the reciprocal of \( y \) beside its differential:
\[\begin{aligned}\frac{\dd{y}}y&=${prefix}\cos x\,\dd{x},\\\ln|y|&=${prefix}\sin x+C,\\y&=A\ee^{${prefix}\sin x}.\end{aligned}\]
Since \( \sin0=0 \), substituting the initial value gives \( A=${b} \). The solution is \( y=${b}\ee^{${prefix}\sin x} \), for all real \( x \).
Use \( \displaystyle E=\frac{\dd{y}}{\dd{x}}\cdot\frac{x}{y} \) to find each elasticity. Then interpret its value at the specified input for a small \( 1\% \) increase in \( x \).
For \( y=x^2+${c} \), \( E(x)= \) . At \( x=${a} \), \( E= \) (three decimal places).
Solution
Since \( \dd{y}=2x\dd{x} \),
\[\begin{aligned}E(x)&=2x\frac{x}{x^2+${c}}\\&=\frac{2x^2}{x^2+${c}}.\end{aligned}\]
At \( x=${a} \), the elasticity is approximately \( ${fixed(value,3)} \). A small \( 1\% \) increase in \( x \) therefore predicts approximately a \( ${fixed(value,3)}\% \) increase in \( y \).
For \( y=\ee^{${prefix}x} \), \( E(x)= \) . At \( x=${a} \), \( E= \) .
Solution
The differential is \( \dd{y}=${prefix}\ee^{${prefix}x}\dd{x} \), giving
\[\begin{aligned}E(x)&=${prefix}\ee^{${prefix}x}\frac{x}{\ee^{${prefix}x}}\\&=${prefix}x.\end{aligned}\]
At \( x=${a} \), \( E=${k*a} \). A small \( 1\% \) increase in \( x \) predicts approximately a \( ${k*a}\% \) increase in \( y \). Here elasticity grows with \( x \), even though the relative rate \( \displaystyle \frac{\dd{y}/y}{\dd{x}}=${k} \) is constant.
A seller models demand with constant elasticity \( ${a} \). At a price of \( \$${p_start} \), demand is \( ${q_start} \) items per week. Let \( p \) be price in dollars and \( q \) demand in items per week; assume both are positive.
Use separation to recover the demand function:
\(\displaystyle q(p)=\)\(\displaystyle .\)
Solution
The relative-change equation separates directly:
\[\begin{aligned}\frac{\dd{q}}q&=${reciprocal}\dd{p},\\\ln q&=${logarithm}+C.\end{aligned}\]
Exponentiating gives a power function with a positive constant:
\[q=Ap^{${a}},\qquad A>0.\]
At the known price and demand, \( \displaystyle ${q_start}=A(${p_start})^{${a}} \), so \( \displaystyle A=${A} \). Thus \( \displaystyle q(p)=${formula} \) for \( p>0 \).
At a price of \( \$${p_new} \), the model predicts items per week. This is a \( \% \) change from the original demand.
Compare that prediction with what elasticity says about a small \( 1\% \) price increase. Why are the percentage changes different?
Solution
The price has doubled, so demand is multiplied by \( \displaystyle 2^{${a}} \). The resulting demand is \( ${q_new} \) items per week, a change of \( ${percent_exact}\% \).
The elasticity predicts approximately a \( ${percent_local}\% \) demand change for a small \( 1\% \) price increase. Doubling is a finite increase of \( 100\% \); we use the full demand function to follow the changing price and demand throughout that adjustment.
A chilled bottle starts at \( ${a} \) degrees Celsius in a room held at \( ${b} \) degrees Celsius. Its temperature \( T \) after \( t \) minutes follows
\[\dd{T}=-${k}(T-${b})\dd{t},\qquad T(0)=${a}.\]
Solve by separation. In the form \( T(t)=${b}+A\ee^{-${k}t} \), the constant is \( A= \) . Explain how the initial temperature determines its sign.
Solution
For \( T\ne${b} \), we divide by the temperature difference and integrate:
\[\begin{aligned}\frac{\dd{T}}{T-${b}}&=-${k}\dd{t},\\\ln|T-${b}|&=-${k}t+C.\end{aligned}\]
At \( t=0 \), the difference is \( -${g} \), so \( C=\ln${g} \). Exponentiating gives
\[|T-${b}|=${g}\ee^{-${k}t}.\]
The formula on the right gives the size of the remaining gap from room temperature. That gap stays positive, so the bottle stays cooler than the room. We therefore subtract it from room temperature:
\[\begin{aligned}T-${b}&=-${g}\ee^{-${k}t},\\T(t)&=${b}-${g}\ee^{-${k}t},\qquad t\ge0.\end{aligned}\]
Thus \( A=-${g} \).
Initially, \( \displaystyle \eval{\frac{\dd{T}}{\dd{t}}}_{t=0}= \) degrees Celsius per minute. Interpret its sign.
Solution
Substituting the starting temperature into the given differential relationship gives \( \displaystyle -${k}(-${g}) \), or \( ${r} \) degrees Celsius per minute. The positive rate means the bottle is warming.
The model reaches \( ${c} \) degrees Celsius after approximately minutes. Give the time to three decimal places. What fraction of the original temperature difference remains then?
The constant temperature solution excluded by division is \( T= \) .
Solution
At \( ${c} \) degrees Celsius, the difference from room temperature has magnitude \( ${g/2} \) degrees Celsius, half its starting size. Therefore
\[\begin{aligned}\ee^{-${k}t}&=\frac12,\\-${k}t&=-\ln2,\\t&=\frac{\ln2}{${k}}\\&\approx${fixed(h,3)}.\end{aligned}\]
The model takes about \( ${fixed(h,3)} \) minutes to halve the original temperature difference.
The red points mark the initial temperature and the temperature after half the original difference remains. The gray line shows room temperature. Division excluded \( T=${b} \). A bottle already at room temperature stays there in this model; that constant solution doesn't match this bottle's starting temperature.
A cup of tea cools in a room held at \( ${b} \) degrees Celsius. It starts at \( ${a} \) degrees Celsius and reaches \( ${c} \) degrees Celsius after \( ${h} \) minutes. Assume the model
\[\dd{T}=-k(T-${b})\dd{t},\qquad k>0,\]
with time measured in minutes. Give noninteger numerical answers to three decimal places, and keep unrounded values for later calculations.
Find \( k\approx \) using the two temperature measurements.
Solution
We separate and integrate the temperature relationship:
\[\begin{aligned}\frac{\dd{T}}{T-${b}}&=-k\dd{t},\\\ln|T-${b}|&=-kt+C.\end{aligned}\]
At the start the difference is \( ${g} \), so \( C=\ln${g} \). Since the tea starts hotter than the room, its temperature is the room temperature plus this shrinking gap:
\[T(t)=${b}+${g}\ee^{-kt}.\]
The later measurement determines the coefficient:
\[\begin{aligned}${c}&=${b}+${g}\ee^{-${h}k},\\\ee^{-${h}k}&=\frac12,\\k&=\frac{\ln2}{${h}}\\&\approx${fixed(k,3)}.\end{aligned}\]
The temperature difference halves in \( ${h} \) minutes. Keep the exact value of \( k \) for the remaining calculations.
The tea reaches \( ${q} \) degrees Celsius minutes after cooling begins. Explain why this is twice the time in the given measurement.
Solution
The remaining temperature difference is \( ${g/4} \) degrees Celsius, one quarter of the original difference. Thus
\[\begin{aligned}\ee^{-kt}&=\frac14,\\t&=\frac{\ln4}{k}\\&=${target_time}.\end{aligned}\]
The first \( ${h} \) minutes halve the difference, and another \( ${h} \) minutes halve it again. The model therefore reaches \( ${q} \) degrees Celsius after \( ${target_time} \) minutes.
The blue points are the two measurements. The red point shows the predicted temperature after the difference has halved a second time. At that predicted time, \( \displaystyle \frac{\dd{T}}{\dd{t}}\approx \) degrees Celsius per minute. Interpret the numerical value.
Solution
Substituting the predicted temperature into the rate equation gives
\[\begin{aligned}\frac{\dd{T}}{\dd{t}}&=-\frac{\ln2}{${h}}\left(${g/4}\right)\\&\approx${fixed(r,3)}.\end{aligned}\]
The negative sign means the tea is cooling. At that moment, its temperature is falling at about \( ${fixed(abs(r),3)} \) degrees Celsius per minute. The rate has one quarter of its initial magnitude because the temperature difference is one quarter as large.