5.2 Separable differential equations
Separable first-order ODEs
If a first-order ODE can be separated so that y and x are on each side, it
can be solved by integration:
y ′ = f ( x ) g ( y ) ∫ g ( y ) d y = ∫ f ( x ) d x + c \begin{align}
y' &= \frac{f(x)}{g(y)} \\
\int g(y)\d{y} &= \int f(x) \d{x} + c
\end{align} y ′ ∫ g ( y ) d y = g ( y ) f ( x ) = ∫ f ( x ) d x + c For example, to solve y ′ = x y y' = xy y ′ = x y , separate the variables and integrate:
∫ d y y = ∫ x d x ln y = x 2 2 + c 0 y = e x 2 / 2 + c 0 y = c e x 2 2 \begin{align}
\int \frac{\d{y}}{y} &= \int x \d{x} \\
\ln y &= \frac{x^2}{2} + c_0 \\
y &= e^{x^2/2 + c_0} \\
y &= c e^\frac{x^2}{2}
\end{align} ∫ y d y ln y y y = ∫ x d x = 2 x 2 + c 0 = e x 2 /2 + c 0 = c e 2 x 2 Note that here, we are being careful to denote the redefinition of the
integration constant (c = e c 0 c = e^{c_0} c = e c 0 ). This detail may be glossed over at times.
Example: Chemical reaction kinetics ¶ A substance is disappearing according to a first-order reaction, so its
concentration follows
d c d t = − k c \dd{}{c}{t} = -k c d t d c = − k c where k k k is the reaction rate constant. If the initial concentration of the
reactant was 1.0 M and the concentration after 1 hour has passed is 0.70 M,
what is the reaction rate constant?
First, solve the differential equation using separation of variables
∫ 1 c d c = ∫ − k d t ln c = − k t + B \begin{align}
\int \frac{1}{c} \d{c} &= \int -k \d{t} \\
\ln c &= -k t + B
\end{align} ∫ c 1 d c ln c = ∫ − k d t = − k t + B where B is an unknown integration constant. Apply the initial condition that
c ( 0 ) = 1 c(0) = 1 c ( 0 ) = 1
ln 1 = − k ⋅ 0 + B → B = 0 \ln 1 = -k \cdot 0 + B \to B = 0 ln 1 = − k ⋅ 0 + B → B = 0 Hence,
k = − ln c t k = -\frac{\ln c}{t} k = − t ln c We know that c ( 1 ) = 0.70 c(1) = 0.70 c ( 1 ) = 0.70 so
k = − ln 0.7 1 h = 0.36 h − 1 k = -\frac{\ln 0.7}{1\,{\rm h}} = 0.36\,{\rm h}^{-1} k = − 1 h ln 0.7 = 0.36 h − 1 Example: Newton’s law of cooling ¶ Estimate the temperature T in an office building at 6 a.m. if the heat goes
off at 10 p.m. when the building is 70°F and the outside temperature T ∞ T_\infty T ∞
is 45°F if the T follows
d T d t = − k ( T − T ∞ ) \dd{}{T}{t} = -k(T - T_\infty) d t d T = − k ( T − T ∞ ) where k = 0.05 h − 1 k = 0.05\,{\rm h}^{-1} k = 0.05 h − 1 .
Separate the differential equation and integrate
∫ 1 T − T ∞ d T = ∫ − k d t ln ( T − T ∞ ) = − k t + c T − T ∞ = C e − k t T = T ∞ + C e − k t \begin{align}
\int \frac{1}{T - T_\infty} \d{T} &= \int -k \d{t} \\
\ln(T - T_\infty) &= -kt + c \\
T - T_\infty &= C e^{-kt} \\
T &= T_\infty + C e^{-kt}
\end{align} ∫ T − T ∞ 1 d T ln ( T − T ∞ ) T − T ∞ T = ∫ − k d t = − k t + c = C e − k t = T ∞ + C e − k t Call 10 p.m. the time where t = 0 t = 0 t = 0 . Then,
70 = T ( 0 ) = 45 + C → C = 25 70 = T(0) = 45 + C \to C = 25 70 = T ( 0 ) = 45 + C → C = 25 Last, evaluate the temperature at 6 a.m. when t = 8 t = 8 t = 8 :
T ( 8 ) = 45 + 25 e − 0.05 ⋅ 8 = 62 T(8) = 45 + 25 e^{-0.05 \cdot 8} = 62 T ( 8 ) = 45 + 25 e − 0.05 ⋅ 8 = 62 The temperature is approximately 62°F.
Example: Toricelli’s Law ¶ A 1 cm hole opens at the bottom of a 1 m cylindrical tank. Water exits the
hole with velocity that follows Toricelli’s, 2 g h \sqrt{2gh} 2 g h where g is the
acceleration due to gravity and g is the height of water above the hole.
If there is 2 m of water in the tank initially, when does it drain?
Start from the unsteady balance on the mass of water m in the tank
d m d t = − m ˙ o u t \dd{}{m}{t} = -\dot m_{\rm out} d t d m = − m ˙ out The mass of water is
m = ρ V = ρ π D 1 2 4 h m = \rho V = \rho \frac{\pi D_1^2}{4} h m = ρ V = ρ 4 π D 1 2 h where ρ \rho ρ is the density of water, V is the volume of water in the tank,
and D 1 D_1 D 1 = 1 m is the diameter of the tank. V is replaced using the volume of
a cylinder.
The mass flow rate out is
m ˙ o u t = ρ V ˙ = ρ π D 2 2 4 2 g h \dot m_{\rm out} = \rho \dot V = \rho \frac{\pi D_2^2}{4} \sqrt{2gh} m ˙ out = ρ V ˙ = ρ 4 π D 2 2 2 g h where V ˙ \dot V V ˙ is the volumetric flow rate out of the hole, which we compute
from the cross-sectional area of the hole (a circle with diameter D 2 D_2 D 2
= 0.01 m) and the model for the velocity leaving it.
Inserting both into the unsteady balance, applying rules of differentiation, and
simplifying gives
d d t ( ρ π D 1 2 4 h ) = − ρ π D 2 2 4 2 g h ρ π D 1 2 4 d h d t = − ρ π D 2 2 4 2 g h d h d t = − ( D 2 D 1 ) 2 2 g h \begin{align}
\dd{}{}{t}\left(\rho \frac{\pi D_1^2}{4} h\right)
&= -\rho \frac{\pi D_2^2}{4} \sqrt{2gh} \\
\rho \frac{\pi D_1^2}{4} \dd{}{h}{t} &= -\rho \frac{\pi D_2^2}{4} \sqrt{2gh} \\
\frac{dh}{dt} &= -\left(\frac{D_2}{D_1}\right)^2 \sqrt{2gh}
\end{align} d t d ( ρ 4 π D 1 2 h ) ρ 4 π D 1 2 d t d h d t d h = − ρ 4 π D 2 2 2 g h = − ρ 4 π D 2 2 2 g h = − ( D 1 D 2 ) 2 2 g h This is a separable differential equation
∫ 1 h d h = ∫ − ( D 2 D 1 ) 2 2 g d t 2 h = − t ( D 2 D 1 ) 2 2 g + c \begin{align}
\int \frac{1}{\sqrt{h}} \d{h}
&= \int -\left(\frac{D_2}{D_1}\right)^2 \sqrt{2g} \d{t} \\
2\sqrt{h} &= -t \left(\frac{D_2}{D_1}\right)^2 \sqrt{2g} + c
\end{align} ∫ h 1 d h 2 h = ∫ − ( D 1 D 2 ) 2 2 g d t = − t ( D 1 D 2 ) 2 2 g + c Find the integration constant c using the initial condition
The tank drains when h = 0 h = 0 h = 0 , so substitute this, c , and numerical values:
0 = − t ( 0.01 1 ) 2 2 ⋅ 9.8 + 2 2 t = 2 ( 1 0.01 ) 2 2 2 ⋅ 9.8 = 6400 \begin{align}
0 &= -t \left(\frac{0.01}{1}\right)^2 \sqrt{2 \cdot 9.8} + 2 \sqrt{2} \\
t &= 2 \left(\frac{1}{0.01}\right)^2 \sqrt{\frac{2}{2 \cdot 9.8}} = 6400
\end{align} 0 t = − t ( 1 0.01 ) 2 2 ⋅ 9.8 + 2 2 = 2 ( 0.01 1 ) 2 2 ⋅ 9.8 2 = 6400 This time is in seconds because all units are SI, so the tank drains in about
1.8 hours.
Skill builder problems ¶ Solve the following:
Separate and integrate:
d y d x = − ( x + 2 ) y 2 ∫ d y y 2 = − ∫ ( x + 2 ) d x − 1 y = − ( x 2 2 + 2 x ) + c \begin{align}
\dd{}{y}{x} &= -(x+2)y^2 \\
\int\frac{\d{y}}{y^2} &= -\int (x+2) \d{x} \\
-\frac{1}{y} &= -\left(\frac{x^2}{2} + 2x\right) + c
\end{align} d x d y ∫ y 2 d y − y 1 = − ( x + 2 ) y 2 = − ∫ ( x + 2 ) d x = − ( 2 x 2 + 2 x ) + c Apply initial condition y ( 1 ) = 1 y(1) = 1 y ( 1 ) = 1 :
− 1 = − ( 1 2 + 2 ) + c -1 = -\left(\frac{1}{2} + 2 \right) + c − 1 = − ( 2 1 + 2 ) + c so c = 3 / 2 c = 3/2 c = 3/2 . Hence,
y = 2 x 2 + 4 x − 3 y = \frac{2}{x^2+4x-3} y = x 2 + 4 x − 3 2 Separate and integrate:
y d y d x = − 4 x ∫ y d y = ∫ − 4 x d x − y 2 2 = − 2 x 2 + c \begin{align}
y \frac{dy}{dx} &= -4x \\
\int y \d{y} &= \int-4x \d{x} \\
-\frac{y^2}{2} &= -2x^2 + c \\
\end{align} y d x d y ∫ y d y − 2 y 2 = − 4 x = ∫ − 4 x d x = − 2 x 2 + c Apply initial condition y ( 0 ) = 3 y(0) = 3 y ( 0 ) = 3 :
− 9 2 = c -\frac{9}{2} = c − 2 9 = c so
y 2 = 9 − 4 x 2 y = ± 9 − 4 x 2 \begin{align}
y^2 &= 9-4x^2 \\
y &= \pm \sqrt{9-4x^2}
\end{align} y 2 y = 9 − 4 x 2 = ± 9 − 4 x 2 The negative root does not satisfy the initial condition, so choose the
positive root:
y = 9 − 4 x 2 y = \sqrt{9-4x^2} y = 9 − 4 x 2 Separate and integrate:
∫ y e y 2 d y = ∫ ( x − 1 ) d x 1 2 e y 2 = x 2 2 − x + c \begin{align}
\int y e^{y^2} \d{y} &= \int (x-1) \d{x} \\
\frac{1}{2} e^{y^2} &= \frac{x^2}{2} - x + c
\end{align} ∫ y e y 2 d y 2 1 e y 2 = ∫ ( x − 1 ) d x = 2 x 2 − x + c Apply initial condition y ( 0 ) = 1 y(0) = 1 y ( 0 ) = 1 :
1 2 e = c \frac{1}{2} e = c 2 1 e = c Hence,
e y 2 = x 2 − 2 x + e y 2 = ln ( x 2 − 2 x + e ) y = ± ln ( x 2 − 2 x + e ) \begin{align}
e^{y^2} &= x^2 - 2x + e \\
y^2 &= \ln(x^2 - 2x + e) \\
y &= \pm \sqrt{\ln(x^2 - 2x + e)}
\end{align} e y 2 y 2 y = x 2 − 2 x + e = ln ( x 2 − 2 x + e ) = ± ln ( x 2 − 2 x + e ) The negative root again does not meet the initial condition, so choose the
positive one:
y = ln ( x 2 − 2 x + e ) y = \sqrt{\ln(x^2 - 2x + e)} y = ln ( x 2 − 2 x + e )