Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

For example, to solve y=xyy' = xy, separate the variables and integrate:

d ⁣yy=xd ⁣xlny=x22+c0y=ex2/2+c0y=cex22\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}

Note that here, we are being careful to denote the redefinition of the integration constant (c=ec0c = 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 ⁣cd ⁣t=kc\dd{}{c}{t} = -k c

where kk 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

1cd ⁣c=kd ⁣tlnc=kt+B\begin{align} \int \frac{1}{c} \d{c} &= \int -k \d{t} \\ \ln c &= -k t + B \end{align}

where B is an unknown integration constant. Apply the initial condition that c(0)=1c(0) = 1

ln1=k0+BB=0\ln 1 = -k \cdot 0 + B \to B = 0

Hence,

k=lnctk = -\frac{\ln c}{t}

We know that c(1)=0.70c(1) = 0.70 so

k=ln0.71h=0.36h1k = -\frac{\ln 0.7}{1\,{\rm h}} = 0.36\,{\rm 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 TT_\infty is 45°F if the T follows

d ⁣Td ⁣t=k(TT)\dd{}{T}{t} = -k(T - T_\infty)

where k=0.05h1k = 0.05\,{\rm h}^{-1}.


Separate the differential equation and integrate

1TTd ⁣T=kd ⁣tln(TT)=kt+cTT=CektT=T+Cekt\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}

Call 10 p.m. the time where t=0t = 0. Then,

70=T(0)=45+CC=2570 = T(0) = 45 + C \to C = 25

Last, evaluate the temperature at 6 a.m. when t=8t = 8:

T(8)=45+25e0.058=62T(8) = 45 + 25 e^{-0.05 \cdot 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, 2gh\sqrt{2gh} where g is the acceleration due to gravity and g is the height of water above the hole.

Tank draining through a pinhole

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 ⁣md ⁣t=m˙out\dd{}{m}{t} = -\dot m_{\rm out}

The mass of water is

m=ρV=ρπD124hm = \rho V = \rho \frac{\pi D_1^2}{4} h

where ρ\rho is the density of water, V is the volume of water in the tank, and D1D_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˙out=ρV˙=ρπD2242gh\dot m_{\rm out} = \rho \dot V = \rho \frac{\pi D_2^2}{4} \sqrt{2gh}

where V˙\dot 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 D2D_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(ρπD124h)=ρπD2242ghρπD124d ⁣hd ⁣t=ρπD2242ghdhdt=(D2D1)22gh\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}

This is a separable differential equation

1hd ⁣h=(D2D1)22gd ⁣t2h=t(D2D1)22g+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}

Find the integration constant c using the initial condition

22=c2 \sqrt{2} = c

The tank drains when h=0h = 0, so substitute this, c, and numerical values:

0=t(0.011)229.8+22t=2(10.01)2229.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}

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:

Solution to Exercise 1

Separate and integrate:

d ⁣yd ⁣x=(x+2)y2d ⁣yy2=(x+2)d ⁣x1y=(x22+2x)+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}

Apply initial condition y(1)=1y(1) = 1:

1=(12+2)+c-1 = -\left(\frac{1}{2} + 2 \right) + c

so c=3/2c = 3/2. Hence,

y=2x2+4x3y = \frac{2}{x^2+4x-3}
Solution to Exercise 2

Separate and integrate:

ydydx=4xyd ⁣y=4xd ⁣xy22=2x2+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}

Apply initial condition y(0)=3y(0) = 3:

92=c-\frac{9}{2} = c

so

y2=94x2y=±94x2\begin{align} y^2 &= 9-4x^2 \\ y &= \pm \sqrt{9-4x^2} \end{align}

The negative root does not satisfy the initial condition, so choose the positive root:

y=94x2y = \sqrt{9-4x^2}
Solution to Exercise 3

Separate and integrate:

yey2d ⁣y=(x1)d ⁣x12ey2=x22x+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}

Apply initial condition y(0)=1y(0) = 1:

12e=c\frac{1}{2} e = c

Hence,

ey2=x22x+ey2=ln(x22x+e)y=±ln(x22x+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}

The negative root again does not meet the initial condition, so choose the positive one:

y=ln(x22x+e)y = \sqrt{\ln(x^2 - 2x + e)}