eleven9Silicon  /  Differential Equations  /  Section 4.2

Cooling &
Mixing

When the environment fights back — Newton's Law of Cooling and what happens when things mix.

4.2.1 — Find decay constant k 4.2.2 — Solve cooling problems 4.2.3 — Build the mixing ODE 4.2.4 — Solve tank problems

The New Ingredient

In Section 4.1 a quantity changed based only on itself — it was alone in the universe. Now something new enters: the environment.

🌡️ The Physical Setup

A hot cup of coffee sits on a desk at room temperature. It cools fast at first, then slower and slower as it approaches room temperature. At room temperature it stops entirely.

Why does it slow down? Because the gap between the coffee and the room is what drives the cooling. Large gap → fast cooling. Small gap → slow cooling. Zero gap → no cooling.

🔑 The Key Shift From Section 4.1

Section 4.1: rate ∝ the quantity itself  →  $dy/dt = ky$
Section 4.2: rate ∝ the gap from equilibrium  →  $dT/dt = k(T - T_a)$

Nearly identical math — but richer physics. The system is trying to reach its environment.

Newton's Law of Cooling

Newton observed that the rate of heat loss is proportional to the temperature difference between the object and its surroundings:

$$\frac{dT}{dt} = k\,(T - T_a)$$
SymbolPhysical meaningSign
$T(t)$Temperature of object at time $t$Always positive
$T_a$Ambient (environment) temperature — constantFixed reference
$T - T_a$The "gap" — how far from ambient the object is+ if hot, − if cold
$k$Cooling constant — material & geometry dependentAlways negative
⚠️ Why is k always negative?

If the object is hotter than the room, $T - T_a > 0$ and temperature is falling ($dT/dt < 0$). For $k(T-T_a)$ to give a negative derivative when the gap is positive, $k$ must be negative. The same logic holds for heating — $k$ is still negative, the gap is just negative too, giving a positive derivative.

The Problem — and the Insight

We have this ODE: $\dfrac{dT}{dt} = k(T - T_a)$. The obstacle is that $T_a$ sitting inside — it makes the right side not just "$k$ times the unknown" but "$k$ times (the unknown minus a constant)." That shifts everything away from Section 4.1's clean form.

The question to ask yourself — Feynman style — is: "what if I just renamed the thing I care about?" Instead of tracking the raw temperature $T$, what if I tracked the gap? Because the gap is what the ODE is actually about.

Step 1 — Define a New Variable for the Gap

Name the gap between the object and the room:

$$u(t) \;=\; T(t) - T_a$$

This is just a label — $u$ is the number of degrees the object is above (or below) ambient at time $t$. When $u = 0$, the object is at room temperature. When $u$ is large and positive, the object is hot. When $u$ is negative, the object is colder than the room.

🔍 Why This Is a Smart Move

We're not changing the physics — we're just relabeling what we watch. Instead of watching the thermometer reading $T$, we watch how far the thermometer is from room temperature. Same physical situation, cleaner math. This is a classic substitution strategy: if something appears repeatedly in your ODE, give it a name.

Step 2 — What Does the Derivative of $u$ Look Like?

Since $u(t) = T(t) - T_a$, take $\dfrac{d}{dt}$ of both sides:

$$\frac{du}{dt} = \frac{d}{dt}\!\Big[T(t) - T_a\Big]$$

Now apply linearity of the derivative — the derivative of a difference is the difference of derivatives:

$$\frac{du}{dt} = \frac{dT}{dt} - \frac{d}{dt}[T_a]$$

Here's the key move: $T_a$ is a constant — it doesn't change with time (the room temperature stays fixed). The derivative of any constant is zero:

$$\frac{d}{dt}[T_a] = 0$$

So we get:

$$\boxed{\frac{du}{dt} = \frac{dT}{dt}}$$
💡 What This Is Saying Physically

The rate of change of the gap equals the rate of change of temperature. Of course — because the room temperature is fixed, whenever the coffee cools by 1°, the gap also shrinks by exactly 1°. The gap and the temperature move together, degree for degree. Their derivatives are identical.

Step 3 — Substitute Into the Original ODE

Start from Newton's Law: $\dfrac{dT}{dt} = k(T - T_a)$

We just showed $\dfrac{du}{dt} = \dfrac{dT}{dt}$, so we can swap the left side:

$$\frac{du}{dt} = k\underbrace{(T - T_a)}_{= \,u}$$

And by definition, $T - T_a = u$. So the right side collapses too:

$$\frac{du}{dt} = k\,u$$
✨ What Just Happened

The substitution $u = T - T_a$ simultaneously replaced both sides. Left side: $dT/dt \to du/dt$. Right side: $k(T-T_a) \to ku$. We went from a messier equation involving a constant shift, to the purest first-order linear ODE possible. That's the power of a smart variable change.

Step 4 — Solve the New ODE: General Solution First

We now have $\dfrac{du}{dt} = ku$. This says: "the rate of change of $u$ is proportional to $u$ itself." We solved this structure in Section 4.1. The general solution is:

$$u(t) = C\,e^{kt}$$

$C$ is an arbitrary constant — a free dial. The ODE alone can't tell you the value of $C$. Why? Because integration erases information about the starting point. The ODE only knows the shape of the curve (exponential, rate $k$), not where it starts. Different values of $C$ give you a whole family of valid solutions — every one of them satisfies $du/dt = ku$ — but they all start at different heights.

📐 Visualize the Family of Curves

Imagine an infinite stack of exponential curves, all with the same shape, all decaying at rate $k$, but shifted up or down by different amounts. $C = 50$ starts high. $C = 10$ starts low. $C = 0$ is just the flat line at zero (the equilibrium). $C = -30$ starts negative. They're all valid solutions to the ODE. The initial condition is what picks exactly one of them.

Step 4a — Pin Down $C$ Using the Initial Condition

We have a specific physical situation — the object starts at a known temperature. That's the initial condition, and it's what kills the ambiguity in $C$.

Plug $t = 0$ into the general solution. Do it mechanically, one operation at a time:

$$u(0) = C\,e^{k\,\cdot\, 0}$$

The exponent is $k \times 0 = 0$, and $e^0 = 1$ exactly — not approximately, exactly. So:

$$u(0) = C \cdot 1 = C$$

That's it. $C$ is literally just the name for the value of $u$ at time zero. We can rewrite the solution replacing the anonymous letter $C$ with the more descriptive label $u(0)$:

$$u(t) = u(0)\,e^{kt}$$
⚠️ What $u(0)$ Is — and Is Not

$u(0)$ is not a new variable. It is not a second definition of $u$. It is not a different function. It is simply the same function $u(t)$, evaluated at the specific moment $t = 0$. The parentheses $(0)$ mean "plug in zero." That's all.

Compare: if $f(t) = t^2$, then $f(3) = 9$. We wouldn't say $f(3)$ has a "different meaning" than $f(t)$ — it's just the same rule, applied at $t = 3$. Same idea here.

Step 4b — The Two Roles of $u$, and Why There's No Contradiction

Here is exactly where students hit the wall. You've seen $u$ described in two ways:

Role 1 — The Definition

$$u(t) = T(t) - T_a$$

What $u$ physically means. The gap between object and ambient at any time $t$. This is how $u$ connects back to the real-world temperature $T$.

Role 2 — The Solution

$$u(t) = u(0)\,e^{kt}$$

How $u$ mathematically behaves over time. This came from solving the ODE. It tells you the gap decays exponentially.

These look like two different things. They are not. They are two statements about the same object — like saying "that animal is a dog" (definition) and "that animal barks" (behavior). Both are true at once, neither contradicts the other.

🧠 The Clean Mental Model

Think of $u(t)$ as a single function with two descriptions:

Description 1 connects $u$ to physics: it tells you what $u$ represents at any moment. Plug in a time $t$, get the gap. This is the bridge back to the original variable $T$.

Description 2 connects $u$ to math: it tells you the shape of $u$ over time. This came from integrating the ODE. It's the answer to "how does the gap evolve?"

The key insight: both descriptions must agree at every time $t$ — including at $t = 0$. That agreement is exactly how we find $u(0)$ in the next step.

Step 4c — Evaluate $u(0)$: Use the Definition to Get a Number

We need a concrete value for $u(0)$. The solution formula tells us $u(0) = C$, but $C$ is still just a symbol. To get the actual number, we go to Role 1 — the definition — and plug in $t = 0$:

$$u(0) = T(0) - T_a$$

$T(0)$ is the temperature of the object at the starting moment — this is the initial condition given to us by the problem. We write it as $T_0$ (the subscript zero means "at time zero"):

$$u(0) = T_0 - T_a$$

This is just a number. If coffee starts at $95°$ and the room is $22°$, then $u(0) = 73°$. That's how wide the gap is at the start. Nothing more mysterious than that.

🔗 The Full Chain of Logic — Every Link Explicit

Here is the complete argument, assembled. Read each line and see exactly which prior fact justifies it:

// Solve the ODE — integration gives a family
General solution:      $u(t) = Ce^{kt}$

// Set t = 0 to connect C to something real
Plug in t = 0:         $u(0) = C\,e^{0} = C \cdot 1 = C$
Therefore:             $C = u(0)$

// Rewrite solution with descriptive label
Substitute C:          $u(t) = u(0)\,e^{kt}$

// Now find the number — use the DEFINITION of u
Definition of u:       $u(t) = T(t) - T_a$
At t = 0:              $u(0) = T(0) - T_a = T_0 - T_a$

// Plug that number back into the solution
Final solution for u:  $u(t) = (T_0 - T_a)\,e^{kt}$

Every line follows from the line before. No leaps. The "two roles" of $u$ cooperate: Role 2 (solution) tells you the shape; Role 1 (definition) gives you the number to plug in.

The final expression for the gap as a function of time:

$$u(t) = (T_0 - T_a)\,e^{kt}$$

The gap starts at $(T_0 - T_a)$ when $t = 0$, and since $k < 0$, the factor $e^{kt}$ decays toward zero — the gap closes. The object drifts toward ambient temperature, slower and slower as it gets closer.

Step 5 — Undo the Substitution (Solve for $T$)

We want $T(t)$, not $u(t)$. Go back to the definition $u = T - T_a$ and solve for $T$:

$$u = T - T_a \implies T = u + T_a$$

Plug in the expression for $u(t)$:

$$T(t) = u(t) + T_a = (T_0 - T_a)\,e^{kt} + T_a$$

Rearranging to the conventional form:

$$\boxed{T(t) = T_a + (T_0 - T_a)\,e^{kt}}$$

Step 6 — Read Every Piece of the Answer

Don't just accept the formula — interrogate each term:

🔬 Anatomy of the Solution

$T(t) = \underbrace{T_a}_{\text{where it's heading}} + \underbrace{(T_0 - T_a)}_{\text{initial gap}} \cdot \underbrace{e^{kt}}_{\text{gap's decay factor}}$

$T_a$ — the ambient temperature. This is the long-run destination. As $t \to \infty$, this is all that remains.

$(T_0 - T_a)$ — the initial gap. How far above (or below) ambient the object started. This scales the whole transient response. Big gap → big exponential amplitude.

$e^{kt}$ — the decay factor. Since $k < 0$, as $t$ grows, $e^{kt} \to 0$. This is the "forgetting" — the system progressively loses memory of where it started. At $t=0$: $e^0 = 1$, so full gap. At $t = \tau = -1/k$: $e^{-1} \approx 0.368$, gap is 36.8% of original. At $t = 5\tau$: $e^{-5} \approx 0.007$, essentially zero.

📐 Geometric Picture

Plot $T(t)$ as a curve. It starts at $T_0$. It has a horizontal asymptote at $y = T_a$ (the ambient line). The curve is always concave toward the asymptote — it decelerates as it approaches. It never crosses $T_a$ because an exponential $e^{kt}$ is always positive — it can approach zero but never pass through it. The signed gap $(T_0 - T_a)$ tells you which side of the asymptote you start on.

Alternative derivation via separation of variables (no substitution needed)

You can also solve the original ODE directly without substituting. Start from:

$$\frac{dT}{dt} = k(T - T_a)$$

Separate variables — collect all $T$ on the left, all $t$ on the right. Divide both sides by $(T - T_a)$ (valid as long as $T \neq T_a$) and multiply both sides by $dt$:

$$\frac{dT}{T - T_a} = k\,dt$$

Integrate both sides. Left side: let $w = T - T_a$, so $dw = dT$. The integral of $1/w$ is $\ln|w|$:

$$\int \frac{dT}{T - T_a} = \ln|T - T_a| + C_1$$

Right side is straightforward:

$$\int k\,dt = kt + C_2$$

Setting them equal and absorbing the constants into one constant $C = C_2 - C_1$:

$$\ln|T - T_a| = kt + C$$

Exponentiate both sides to undo the $\ln$. Use $e^{\ln|x|} = |x|$:

$$|T - T_a| = e^{kt + C} = e^C \cdot e^{kt}$$

The absolute value just means the sign is absorbed into the constant. Define $A = \pm e^C$ (any nonzero real number) and drop the absolute value:

$$T - T_a = A\,e^{kt}$$

Apply the initial condition $T(0) = T_0$. Plug in $t = 0$:

$$T_0 - T_a = A\,e^{0} = A \cdot 1 \implies A = T_0 - T_a$$

Substitute $A$ back and solve for $T$:

$$T(t) = T_a + (T_0 - T_a)\,e^{kt}$$

Same result, different path. The substitution method is faster; separation of variables is more systematic and generalizable.

Finding the Decay Constant

You're given $T_0$, $T_a$, and the temperature at one later time $T(t_1) = T_1$. Three numbers, one unknown.

  1. Write the model with the known point.
    $$T_1 = T_a + (T_0 - T_a)\,e^{k\,t_1}$$
  2. Isolate the exponential. Subtract $T_a$, then divide by $(T_0 - T_a)$:
    $$\frac{T_1 - T_a}{T_0 - T_a} = e^{k\,t_1}$$
    This ratio is the fraction of the original gap still remaining at $t_1$.
  3. Take the natural log of both sides.
    $$\ln\!\left(\frac{T_1 - T_a}{T_0 - T_a}\right) = k\,t_1$$
  4. Solve for k.
    $$\boxed{k = \frac{1}{t_1}\,\ln\!\left(\frac{T_1 - T_a}{T_0 - T_a}\right)}$$
    Since the ratio is between 0 and 1, $\ln < 0$, confirming $k < 0$. ✓
🔍 Physical Meaning of the Ratio

The ratio $\frac{T_1 - T_a}{T_0 - T_a}$ answers: "what fraction of the original temperature gap still remains at $t_1$?" If it's 0.5, half the gap closed — directly analogous to a half-life from Section 4.1.

Temperature Explorer

Drag the sliders. Notice the dashed asymptote line at $T_a$ — the curve always approaches it but never crosses. Also notice how changing $k$ affects the speed of approach, while $T_0$ and $T_a$ set the endpoints.

T(t) = Ta + (T0 - Ta) · e^(kt)

Live Thermometer

The ODE runs in real time using Euler's method. Press Heat to spike the temperature — watch the gap decay exponentially toward ambient. Hit it multiple times and notice: no matter how high you push it, it always comes back to $T_a$.

Real-time T(t) — Euler simulation of dT/dt = k(T - Ta)

Worked Examples

Example 1 — The Coffee Problem

Problem Statement

Coffee starts at $95°C$. Room is $20°C$. After 10 min it's $70°C$.
(a) Find $k$.    (b) Temperature at 30 min?    (c) When does it reach $40°C$?

Full Solution — Coffee Problem

Part (a): $T_0=95$, $T_a=20$, $T(10)=70$.

$$k = \frac{1}{10}\ln\!\left(\frac{70-20}{95-20}\right) = \frac{\ln(2/3)}{10} \approx -0.0405 \ \text{min}^{-1}$$

Model: $T(t) = 20 + 75\,e^{-0.0405t}$

Part (b):

$$T(30) = 20 + 75\,e^{-1.215} \approx 20 + 22.3 \approx \mathbf{42.3°C}$$

Part (c): Set $T = 40$, isolate the exponential, take $\ln$:

$$40 = 20 + 75\,e^{-0.0405t} \implies t = \frac{\ln(20/75)}{-0.0405} \approx \mathbf{32.6 \ \text{min}}$$

Example 2 — Forensic Time of Death

Problem Statement

Body found at 9 AM: $29.5°C$. At 11 AM: $23.5°C$. Room $20°C$. Normal body temp $37°C$. Estimate time of death.

Full Solution — Time of Death

Model: $T(t) = 20 + 17e^{kt}$ where $t=0$ is time of death.

At discovery ($t_1$): $e^{kt_1} = 9.5/17$. Two hours later: $e^{k(t_1+2)} = 3.5/17$.

Divide the equations to eliminate $t_1$:

$$e^{2k} = \frac{3.5}{9.5} \approx 0.368 \implies k \approx -0.499 \ \text{hr}^{-1}$$

Find $t_1$:

$$t_1 = \frac{\ln(9.5/17)}{-0.499} \approx 1.17 \ \text{hr before 9 AM} \implies \textbf{~7:50 AM}$$

Example 3 — Oven Heating (k still negative!)

Problem Statement

Cold rod at $5°C$ placed in $200°C$ oven. After 8 min it's $80°C$. When does it reach $150°C$?

💡 Why is k still negative for heating?

Here $T_0 = 5 < T_a = 200$, so the gap $T - T_a < 0$. For the rod to heat up ($dT/dt > 0$), we need $k \times \text{(negative gap)} > 0$, which requires $k < 0$. The formula handles it automatically.

Full Solution — Oven Heating
$$k = \frac{1}{8}\ln\!\left(\frac{80-200}{5-200}\right) = \frac{\ln(120/195)}{8} \approx -0.0606 \ \text{min}^{-1}$$

Model: $T(t) = 200 - 195\,e^{-0.0606t}$

$$150 = 200 - 195\,e^{-0.0606t} \implies t = \frac{\ln(50/195)}{-0.0606} \approx \mathbf{22.5 \ \text{min}}$$

Newton's Law Solver

Enter any scenario. The solver walks through every step and plots the result.

🌡️ Cooling / Heating Calculator

Given $T_0$, $T_a$, and $T(t_1)=T_1$, find $k$ and predict at $t^*$.

The RC Analogy

Newton's Law of Cooling and RC circuit discharge are the same differential equation in different clothing.

🌡️ Thermal System

$dT/dt = k(T - T_a)$

Temperature gap drives heat flow.
$T_a$ = thermal "ground".
Time constant: $\tau = -1/k$

⚡ RC Circuit

$dV/dt = -(V-V_s)/RC$

Voltage gap drives current flow.
$V_s$ = electrical "ground".
Time constant: $\tau = RC$

⚡ Why This Matters for EE

RC discharge follows $V(t) = V_0\,e^{-t/RC}$ — gap to zero, decaying exponentially. RC charging follows $V(t) = V_s(1-e^{-t/RC})$ — gap to $V_s$, approaching asymptotically. Both are Newton's Law. The time constant $\tau = RC$ plays exactly the role of $-1/k$ in cooling. When you hit Circuits I, this clicks immediately.

ThermalElectrical equivalent
Temperature $T$Voltage $V$
Ambient $T_a$Supply/ground $V_s$
Heat flow (W)Current $I$ (A)
Thermal resistanceResistance $R$
Thermal capacitanceCapacitance $C$
$\tau = -1/k$$\tau = RC$

What Is a Mixing Problem?

Forget equations for a moment. Picture a tank of water with salt dissolved in it. Someone is pumping fresh water (or saltwater) in at the top, and the well-mixed solution drains out the bottom at the same rate. The salt concentration is constantly changing.

🧂 The Core Question

How much salt is in the tank at time $t$? This is the variable we track. Not concentration — amount of salt, $Q(t)$ (in grams, lbs, etc.).

Here's the deep connection to cooling: in cooling, the gap from ambient drives change. In mixing, the concentration inside the tank determines how fast salt leaves. The more salt inside, the faster it drains. As salt leaves, there's less to lose — the rate slows. Sound familiar?

🔗 The Structural Parallel

Cooling: rate of change = (rate in) − (rate out) = $k(T - T_a)$ — the gap.
Mixing: rate of change = (salt in per time) − (salt out per time). Same structure: balance what enters against what leaves.

Building the Mixing ODE

Every mixing problem uses one master principle. Say it, internalize it, tattoo it on your brain:

The Conservation Law
$$\frac{dQ}{dt} = \underbrace{\text{Rate}_{\text{in}}}_{\text{salt entering}} - \underbrace{\text{Rate}_{\text{out}}}_{\text{salt leaving}}$$

Nothing clever here — it's just bookkeeping. Salt that enters increases $Q$. Salt that leaves decreases $Q$. The derivative tracks the net.

The Tank Setup

Inflow
$r_{in}$ L/min
$c_{in}$ g/L
Q(t) grams
Volume = V liters
Outflow
$r_{out}$ L/min
conc. $= Q/V$

Step 1 — Rate In: Easy

Inflow brings fluid at rate $r_{in}$ liters per minute, and each liter contains $c_{in}$ grams of salt. So:

$$\text{Rate}_{\text{in}} = r_{in} \cdot c_{in} \quad \left[\frac{\text{L}}{\text{min}} \cdot \frac{\text{g}}{\text{L}} = \frac{\text{g}}{\text{min}}\right]$$

This is a constant — as long as the inflow concentration is constant, salt enters at a steady rate. No mystery here.

Step 2 — Rate Out: Where the ODE Lives

Outflow removes fluid at rate $r_{out}$ liters per minute. But what concentration is leaving? The tank is well-mixed, so the concentration everywhere in the tank equals:

$$c_{\text{tank}}(t) = \frac{Q(t)}{V(t)} \quad \left[\frac{\text{g}}{\text{L}}\right]$$

This is the key step. The concentration isn't fixed — it depends on how much salt is in the tank right now, divided by the current volume. So:

$$\text{Rate}_{\text{out}} = r_{out} \cdot \frac{Q(t)}{V(t)} \quad \left[\frac{\text{L}}{\text{min}} \cdot \frac{\text{g}}{\text{L}} = \frac{\text{g}}{\text{min}}\right]$$
⚠️ This Is Why Q Appears in Its Own Derivative

Rate out depends on $Q(t)$ — the thing we're solving for. That's what makes this a differential equation and not just a calculation. The current amount of salt determines how fast it leaves, which determines the future amount. It's self-referential — the classic fingerprint of a first-order linear ODE.

Step 3 — The General ODE

Plug rate in and rate out into the conservation law:

$$\boxed{\frac{dQ}{dt} = r_{in}\,c_{in} - r_{out}\,\frac{Q(t)}{V(t)}}$$

The Constant-Volume Case (Equal Flow Rates)

The most common exam setup: $r_{in} = r_{out} = r$. This means volume $V$ stays constant forever. The ODE becomes:

$$\frac{dQ}{dt} = r\,c_{in} - \frac{r}{V}\,Q$$

Let's name the coefficient of $Q$ as $\lambda = r/V$ (drain rate per unit volume). Rewrite:

$$\frac{dQ}{dt} = r\,c_{in} - \lambda\,Q \quad \text{where} \quad \lambda = \frac{r}{V}$$
📐 Geometric Intuition: What Does This ODE Want?

The ODE is saying: "salt comes in at a constant rate, but leaves at a rate proportional to how much salt is currently there." If $Q$ is large, salt leaves fast. If $Q$ is small, it leaves slowly. There's a magic equilibrium $Q^*$ where what comes in equals what goes out — and the system always drifts toward it. Sound like cooling? It should.

The Solution — Two Methods

We have the linear ODE $\dfrac{dQ}{dt} + \lambda Q = r\,c_{in}$. Two clean ways to crack it.

Method A: Integrating Factor

Write it in standard form: $Q' + \lambda Q = r\,c_{in}$. The integrating factor is $\mu = e^{\int \lambda\,dt} = e^{\lambda t}$. Multiply both sides:

$$e^{\lambda t}\,Q' + \lambda\,e^{\lambda t}\,Q = r\,c_{in}\,e^{\lambda t}$$

The left side is exactly $\dfrac{d}{dt}\!\left[e^{\lambda t} Q\right]$ by the product rule. So:

$$\frac{d}{dt}\!\left[e^{\lambda t} Q\right] = r\,c_{in}\,e^{\lambda t}$$

Integrate both sides with respect to $t$:

$$e^{\lambda t} Q = \frac{r\,c_{in}}{\lambda}\,e^{\lambda t} + C$$

Divide through by $e^{\lambda t}$:

$$Q(t) = \frac{r\,c_{in}}{\lambda} + C\,e^{-\lambda t}$$

Apply $Q(0) = Q_0$ to find $C = Q_0 - \dfrac{r\,c_{in}}{\lambda}$:

$$\boxed{Q(t) = \underbrace{\frac{r\,c_{in}}{\lambda}}_{\text{equilibrium } Q^*} + \underbrace{\left(Q_0 - \frac{r\,c_{in}}{\lambda}\right)}_{\text{initial gap}}\,e^{-\lambda t}}$$
🔑 Recognize the Pattern — Same as Cooling!

Compare: $T(t) = T_a + (T_0 - T_a)e^{kt}$ vs $Q(t) = Q^* + (Q_0 - Q^*)e^{-\lambda t}$. Structurally identical. The equilibrium plays the role of $T_a$, the initial gap decays exponentially, and the time constant is now $\tau = 1/\lambda = V/r$.

Method B: Equilibrium + Homogeneous Decomposition

This is the intuitive Feynman approach. First, ask: "what is the long-run equilibrium $Q^*$?" Set $dQ/dt = 0$:

$$0 = r\,c_{in} - \lambda\,Q^* \implies Q^* = \frac{r\,c_{in}}{\lambda}$$

Now define $u(t) = Q(t) - Q^*$ — the deviation from equilibrium. Since $Q^*$ is constant:

$$\frac{du}{dt} = \frac{dQ}{dt} = r\,c_{in} - \lambda(u + Q^*) = r\,c_{in} - \lambda\,u - \lambda\,Q^* = -\lambda\,u$$

Exactly Section 4.1 again. Solution: $u = u_0\,e^{-\lambda t} = (Q_0 - Q^*)e^{-\lambda t}$. So:

$$Q(t) = Q^* + (Q_0 - Q^*)\,e^{-\lambda t}$$

Same result, zero integration needed. The deviation from equilibrium decays exponentially — that's the core structure.

The Equilibrium $Q^*$ in Plain English

🧂 What Is Q* Physically?

$Q^* = \frac{r\,c_{in}}{\lambda} = \frac{r\,c_{in}}{r/V} = V\,c_{in}$. The equilibrium is simply: volume of tank × concentration of inflow. Makes perfect sense — eventually the tank reaches the same concentration as what's being pumped in. If you're pumping in freshwater ($c_{in}=0$), all the salt eventually flushes out, $Q^* = 0$.

What if inflow ≠ outflow? (Variable volume)

If $r_{in} \neq r_{out}$, the volume changes: $V(t) = V_0 + (r_{in} - r_{out})\,t$. The ODE becomes:

$$\frac{dQ}{dt} = r_{in}\,c_{in} - \frac{r_{out}}{V_0 + (r_{in} - r_{out})\,t}\,Q$$

This is still linear but now has a variable coefficient. You solve it with an integrating factor that depends on $t$. The tank will eventually overflow (if $r_{in}>r_{out}$) or empty (if $r_{out}>r_{in}$), so you also need to watch for physical blow-up times.

The strategy:

  1. Write in standard form $Q' + P(t)Q = f(t)$ where $P(t) = r_{out}/V(t)$.
  2. Compute $\mu(t) = e^{\int P(t)\,dt}$ — usually involves $\ln(V(t))$.
  3. Multiply, recognize left side as $(\mu Q)'$, integrate, apply IC.

Symbol Guide for Mixing

SymbolMeaningUnitsRole in Solution
$Q(t)$Amount of substance (salt) in tankgrams, lbs, kgThe unknown we solve for
$Q_0 = Q(0)$Initial amount of substancegramsSets the initial condition
$V$Volume of liquid in tankliters, gallonsConstant when $r_{in}=r_{out}$
$r$Flow rate (in = out)L/minSets the time scale
$c_{in}$Concentration of incoming solutiong/LDrives the forcing term
$\lambda = r/V$Drain rate coefficientmin$^{-1}$Decay rate of transient
$\tau = V/r$Time constant — one "tank-flush"minTime to reach ~63% of $Q^*$
$Q^* = V\,c_{in}$Equilibrium amountgramsLong-run steady state

The Time Constant $\tau = V/r$

Think about what $V/r$ means dimensionally: volume of tank divided by flow rate. It's the time it takes to completely flush the tank's volume once. After one time constant $\tau$, the gap $(Q - Q^*)$ has shrunk by a factor of $1/e \approx 63\%$. After $5\tau$, you're within 1% of equilibrium.

⚡ EE Connection: $\tau = RC$ Again

In an RC circuit, $\tau = RC$. In mixing, $\tau = V/r$. Both describe: "how long before the transient dies out?" In both cases, the answer is about $5\tau$ to reach practical equilibrium. Capacitance stores charge; the tank stores solute. Resistance limits current; $1/r$ limits flow. The math is the same equation wearing different clothes.

Mixing Explorer

Drag the sliders and watch $Q(t)$ evolve in real time. Notice: $Q$ always approaches $Q^* = V \cdot c_{in}$, the dashed violet asymptote. Try setting $c_{in} = 0$ (freshwater flush) — all the salt drains out. Try $Q_0 = Q^*$ — nothing changes. Try large $r$ — the system reaches equilibrium faster.

Q(t) = Q* + (Q₀ − Q*) · e^(−λt) where λ = r/V, Q* = V·cᵢₙ

Mixing Examples

Example 1 — The Classic Salt Flush

Problem Statement

A 200-liter tank initially contains 50 grams of salt dissolved in water. Fresh water (no salt) flows in at 4 L/min, and the well-mixed solution drains out at the same rate. How much salt is in the tank after 30 minutes? When does the tank contain only 5 grams?

Full Solution — Step by Step

Identify everything: $V = 200$ L, $Q_0 = 50$ g, $r = 4$ L/min, $c_{in} = 0$ g/L (freshwater).

Compute parameters:

$$\lambda = \frac{r}{V} = \frac{4}{200} = 0.02 \text{ min}^{-1}, \qquad Q^* = V\,c_{in} = 200 \times 0 = 0$$

Equilibrium is zero — all the salt eventually flushes out. The solution is:

$$Q(t) = 0 + (50 - 0)\,e^{-0.02t} = 50\,e^{-0.02t}$$

Part (a) — Salt at $t = 30$ min:

$$Q(30) = 50\,e^{-0.02 \times 30} = 50\,e^{-0.6} \approx 50 \times 0.5488 \approx \mathbf{27.44 \text{ g}}$$

Part (b) — When does $Q = 5$ g? Isolate the exponential, take $\ln$:

$$5 = 50\,e^{-0.02t} \implies e^{-0.02t} = 0.1 \implies -0.02t = \ln(0.1) \implies t = \frac{-\ln(0.1)}{0.02} = \frac{2.3026}{0.02} \approx \mathbf{115.1 \text{ min}}$$

Physical check: $\tau = V/r = 50$ min. At $t = 115$ min, we're about $2.3$ time constants in. Makes sense — $e^{-2.3} \approx 0.1$. ✓

Example 2 — Building Up Salt (Inflow with Solute)

Problem Statement

A 500-liter tank starts with pure water. A brine solution of $0.5$ g/L flows in at 10 L/min; the well-mixed solution drains at the same rate. Find $Q(t)$ and the long-run equilibrium amount of salt.

Full Solution — Salt Building Up

Identify: $V = 500$ L, $Q_0 = 0$ g, $r = 10$ L/min, $c_{in} = 0.5$ g/L.

Compute:

$$\lambda = \frac{r}{V} = \frac{10}{500} = 0.02 \text{ min}^{-1}, \qquad Q^* = V\,c_{in} = 500 \times 0.5 = 250 \text{ g}$$

The tank is heading toward 250 g of salt. Solution:

$$Q(t) = 250 + (0 - 250)\,e^{-0.02t} = 250\left(1 - e^{-0.02t}\right)$$

As $t \to \infty$, $Q \to 250$ g — the tank matches the inflow concentration. This is the building up case (compare to RC charging: $V(t) = V_s(1 - e^{-t/RC})$).

When does $Q$ reach 200 g?

$$200 = 250\left(1-e^{-0.02t}\right) \implies e^{-0.02t} = \frac{50}{250} = 0.2 \implies t = \frac{-\ln(0.2)}{0.02} \approx \frac{1.609}{0.02} \approx \mathbf{80.5 \text{ min}}$$

Example 3 — Non-Trivial Initial Condition

Problem Statement

A 100-L tank has 80 g of salt dissolved in it. Brine of $1$ g/L flows in at 2 L/min, and the mixture drains at 2 L/min. Find $Q(t)$. How long until the salt level passes through the equilibrium for the first time?

Full Solution — Starting Above Equilibrium

Identify: $V = 100$ L, $Q_0 = 80$ g, $r = 2$ L/min, $c_{in} = 1$ g/L.

$$\lambda = \frac{2}{100} = 0.02 \text{ min}^{-1}, \qquad Q^* = 100 \times 1 = 100 \text{ g}$$

Wait — $Q_0 = 80$ g but $Q^* = 100$ g. The tank starts below equilibrium, so salt builds up.

$$Q(t) = 100 + (80 - 100)\,e^{-0.02t} = 100 - 20\,e^{-0.02t}$$

This rises from 80 toward 100. It approaches 100 asymptotically — it never actually reaches $Q^*$ in finite time, only gets arbitrarily close. That's the asymptotic nature of exponential decay.

Practical: when is $Q = 99$ g?

$$99 = 100 - 20\,e^{-0.02t} \implies e^{-0.02t} = \frac{1}{20} \implies t = \frac{-\ln(0.05)}{0.02} = \frac{2.996}{0.02} \approx \mathbf{149.8 \text{ min}}$$

Example 4 — Variable Volume (Unequal Flow Rates)

Problem Statement

A 100-L tank starts with 10 g of salt. Brine ($2$ g/L) flows in at 5 L/min, but the mixture drains at only 3 L/min. Find $Q(t)$ and note when the tank overflows at $V = 200$ L.

Full Solution — Variable Volume (Integrating Factor)

Volume as a function of time: Net inflow = 5 − 3 = 2 L/min, so $V(t) = 100 + 2t$.

The ODE:

$$\frac{dQ}{dt} = 5 \times 2 - 3 \cdot \frac{Q}{100+2t} = 10 - \frac{3Q}{100+2t}$$

Standard form: $Q' + \dfrac{3}{100+2t}\,Q = 10$

Integrating factor:

$$\mu = e^{\int \frac{3}{100+2t}\,dt} = e^{\frac{3}{2}\ln(100+2t)} = (100+2t)^{3/2}$$

Multiply both sides:

$$\frac{d}{dt}\!\left[(100+2t)^{3/2}\,Q\right] = 10\,(100+2t)^{3/2}$$

Integrate the right side (let $u = 100+2t$, $du = 2\,dt$):

$$\int 10\,(100+2t)^{3/2}\,dt = 10 \cdot \frac{(100+2t)^{5/2}}{5/2 \cdot 2} = 2(100+2t)^{5/2} + C$$

So: $(100+2t)^{3/2}\,Q = 2(100+2t)^{5/2} + C$. Divide through:

$$Q(t) = 2(100+2t) + C\,(100+2t)^{-3/2}$$

Apply $Q(0) = 10$: $10 = 2(100) + C \cdot 100^{-3/2} = 200 + C/1000 \implies C = -190000$

$$\boxed{Q(t) = 2(100+2t) - \frac{190000}{(100+2t)^{3/2}}}$$

When does the tank overflow? $V(t) = 200 \implies 100 + 2t = 200 \implies t = 50$ min.

$$Q(50) = 2(200) - \frac{190000}{(200)^{3/2}} = 400 - \frac{190000}{2828.4} \approx 400 - 67.2 \approx \mathbf{332.8 \text{ g}}$$

Mixing Solver

Enter your tank parameters. The solver computes $\lambda$, $Q^*$, the full solution, and predicts $Q$ at any time $t^*$. Works for both the flushing and building-up cases.

🧂 Tank Mixing Calculator

Equal inflow/outflow (constant volume). Given $Q_0$, $V$, $r$, $c_{in}$, solve and predict.

The Algorithm

Every mixing problem on every exam follows the same logical chain. Here it is, locked in:

  1. Read the setup — extract the four numbers: $V$ (volume), $r_{in}$, $r_{out}$, $c_{in}$, and $Q_0$.
    If $r_{in} = r_{out}$, constant volume. If not, volume changes with time.
  2. Write the conservation equation: $\dfrac{dQ}{dt} = r_{in}\,c_{in} - r_{out}\,\dfrac{Q}{V(t)}$
    This is always the correct starting ODE. Don't memorize a formula — derive it from the principle.
  3. Find equilibrium $Q^*$: Set $dQ/dt = 0$, solve. For constant $V$: $Q^* = V\,c_{in}$.
    This tells you where the system is headed and whether $Q$ is rising or falling.
  4. Solve the ODE: For constant volume, plug into the formula directly. For variable volume, use integrating factor.
    $$Q(t) = Q^* + (Q_0 - Q^*)\,e^{-\lambda t}, \quad \lambda = r/V$$
  5. Answer the specific question:
    • "Find $Q$ at time $t$" → plug $t$ into the solution.
    • "When does $Q$ reach value $X$?" → set $Q(t) = X$, isolate exponential, take $\ln$, divide by $-\lambda$.
    • "Long-run amount?" → $Q^*$.
  6. Physical sanity check: Does $Q(t)$ approach $Q^*$? Is $Q$ monotone (no overshoot possible with this model)? Does the answer have correct units?
⚠️ The Most Common Mistake

Confusing concentration and amount. The ODE tracks $Q$ (grams, lbs) — not concentration. If a problem asks for concentration at time $t$, compute $Q(t)$ first, then divide by $V$. Don't put concentration directly into the ODE.


The Core Framework

Newton's Law of Cooling

  1. Physical law: rate ∝ gap from ambient  →  $dT/dt = k(T - T_a)$
  2. Solution: $T(t) = T_a + (T_0 - T_a)\,e^{kt}$ — gap decays exponentially to zero
  3. Find k: $k = \frac{1}{t_1}\ln\!\left(\frac{T_1-T_a}{T_0-T_a}\right)$ — always negative
  4. Predict forward: plug $k$, $T_0$, $T_a$, $t$ into the model
  5. Solve for time: isolate the exponential → $\ln$ both sides → divide by $k$

Mixing Problems

  1. Conservation: $dQ/dt = \text{rate in} - \text{rate out}$
  2. Rate out: always $= r_{out} \cdot Q/V(t)$ — concentration times flow rate
  3. Equilibrium: $Q^* = V\,c_{in}$ (when volume is constant)
  4. Solution: $Q(t) = Q^* + (Q_0 - Q^*)\,e^{-\lambda t}$ where $\lambda = r/V$
  5. Time constant: $\tau = V/r$ — one full tank-flush, analogous to $RC$
  6. Variable volume: use integrating factor with $V(t) = V_0 + (r_{in}-r_{out})t$
🔗 The Unifying Idea

Every model in this section — cooling, mixing, RC circuits — is the same ODE: rate of change = constant forcing − (something) × current state. The solution is always: equilibrium + (initial gap) × decaying exponential. Learn this one structure; apply it everywhere.