Differential Equations • Applications of First-Order ODEs

Mixing Problems

Model how concentrations change in tanks where solutions flow in and out over time.

A changing curve with sigma and variable symbols for differential equations
Inside this lesson 10 sections 5 questions 8 figures

SECTION 1

Historical Context & Motivation

Humans have been mixing substances for millennia — from blending medicinal tonics to purifying drinking water. However, predicting exactly how a concentration changes over time required the language of calculus. Mixing problems are one of the earliest and most practical applications of first-order ordinary differential equations (ODEs). They model situations where a substance — like salt, a pollutant, or a chemical — enters and leaves a container at known rates, and we want to know the amount of that substance at any moment.

1687 • Newton's Principia

Isaac Newton publishes the foundations of calculus, giving scientists the tools to describe rates of change — the backbone of all differential equations.

1740s • Euler's Integrating Factor

Leonhard Euler develops systematic methods for solving first-order linear ODEs, including the integrating factor technique used in mixing problems today.

1800s • Industrial Chemistry

The rise of chemical manufacturing demands precise control of concentrations in vats and reactors, turning mixing models from academic exercises into engineering necessities.

1960s–Today • Environmental Modeling

Mixing-problem frameworks are applied to model pollutant levels in lakes, medication dosages in the bloodstream, and contaminant spread in water-treatment plants.

The central question a mixing problem answers is deceptively simple: If a solution flows into and out of a tank at known rates and concentrations, how much of the dissolved substance is in the tank at time t? Answering this question with algebra alone is impossible because the amount inside the tank is constantly changing, which in turn changes the concentration of what flows out. A differential equation captures this feedback loop perfectly.

SECTION 2

Core Principles & Definitions

Every mixing problem revolves around the same fundamental idea: the rate at which the amount of substance in a tank changes equals the rate it comes in minus the rate it goes out. Before we write any equations, let's nail down the key concepts you'll use again and again.

1

Rate In

The rate at which the dissolved substance enters the tank, calculated as (inflow rate of liquid) × (concentration of incoming solution). Units are typically grams per minute or kg per hour.
2

Rate Out

The rate at which the substance leaves the tank. This equals (outflow rate of liquid) × (concentration inside the tank at that instant). Because the tank concentration changes over time, this term involves the unknown function Q(t).
3

Well-Stirred Assumption

We assume the incoming solution is mixed instantly and uniformly throughout the tank. This means the concentration of the outflow equals the overall concentration in the tank at that moment: Q(t) ÷ V(t).
4

Volume Function V(t)

The total volume of liquid in the tank at time t. If the inflow and outflow rates are equal, V stays constant. If they differ, V changes linearly with time, and you must account for it in the ODE.
✦

KEY TAKEAWAY

Think of a mixing problem like a bathtub with the faucet running and the drain open at the same time. Imagine pouring dye into the stream of water from the faucet. The color of the water swirling down the drain depends on how much dye is in the tub right now — and that amount is always changing. A differential equation is the mathematical tool that keeps track of this moving target.

SECTION 3

Visual Explanation — The Tank Model

Classic Mixing-Problem Tank DiagramTankVolume = V(t)Substance = Q(t)INFLOWrate = rᵢₙconc = cᵢₙOUTFLOWrate = rₒᵤₜconc = Q(t)/V(t)Well-stirred: concentration is uniform everywhere inside.dQ/dt = rᵢₙ · cᵢₙ − rₒᵤₜ · Q(t)/V(t)
The tank receives a solution through the inflow pipe (green arrow) at rate rᵢₙ with incoming concentration cᵢₙ. The well-stirred mixture leaves through the outflow pipe (pink arrow) at rate rₒᵤₜ with a concentration equal to Q(t) ÷ V(t). The governing ODE is shown in the amber bar at the bottom.

The diagram above captures everything you need to set up a mixing problem. Notice that the inflow rate is entirely given information — you always know how fast liquid enters and what concentration it carries. The outflow concentration, however, depends on Q(t) and V(t), both of which can change with time. This dependency is precisely why we need a differential equation rather than a simple algebraic formula.

SECTION 4

Mathematical Framework

Let's build the governing equation step by step. We define Q(t) as the amount (in grams, kilograms, etc.) of the dissolved substance in the tank at time t. The key principle is a balance law: the rate of change of Q equals what comes in minus what goes out.

BALANCE LAW

dQ/dt=(RateIn)−(RateOut)dQ/dt = (Rate In) − (Rate Out)

This is the fundamental equation for every mixing problem. Each side has units of mass per time (e.g., g/min).

RATE IN

RateIn=rin×cinRate In = rᵢₙ × cᵢₙ

Where rᵢₙ = volumetric inflow rate (L/min) and cᵢₙ = concentration of the incoming solution (g/L).

RATE OUT

RateOut=rout×Q(t)/V(t)Rate Out = rₒᵤₜ × Q(t) / V(t)

Where rₒᵤₜ = volumetric outflow rate (L/min), Q(t) = amount of substance in the tank (g), and V(t) = volume of liquid in the tank (L). The ratio Q(t)/V(t) is the instantaneous concentration inside the tank.

FULL ODE (CONSTANT VOLUME)

dQ/dt+(rout/V)×Q=rin×cindQ/dt + (rₒᵤₜ / V) × Q = rᵢₙ × cᵢₙ

When rᵢₙ = rₒᵤₜ, the volume V stays constant. This is a first-order linear ODE in standard form: dQ/dt + P(t)·Q = f(t), which can be solved using an integrating factor.

⚠

Variable Volume Warning

If the inflow rate and outflow rate are not equal, the volume changes over time: V(t) = V₀ + (rᵢₙ − rₒᵤₜ) × t. You must substitute this expression for V(t) in the ODE. The equation is still first-order linear, but the integrating factor becomes a bit more complex.

SECTION 5

Solving with the Integrating Factor

The standard approach to solving mixing problems uses the integrating factor method. For the constant-volume case where rᵢₙ = rₒᵤₜ = r, we write the ODE in standard linear form and then multiply both sides by a carefully chosen function that makes the left side collapse into a single derivative.

Step-by-Step: Integrating Factor MethodSTEP 1 — Write in standard formdQ/dt + (r/V) · Q = r · cᵢₙSTEP 2 — Identify P(t) and compute integrating factor μP = r/V → μ(t) = e^(rt/V)STEP 3 — Multiply both sides by μ(t)d/dt [ e^(rt/V) · Q ] = r · cᵢₙ · e^(rt/V)STEP 4 — Integrate both sidese^(rt/V) · Q = V · cᵢₙ · e^(rt/V) + CSTEP 5 — Solve for Q(t) and apply initial conditionQ(t) = V · cᵢₙ + (Q₀ − V · cᵢₙ) · e^(−rt/V)Q₀ = initial amount of substance in the tank at t = 0
The flowchart shows the five key steps of the integrating factor method applied to a constant-volume mixing problem. Each colored box represents one algebraic step, culminating in the general solution Q(t) at the bottom.

The final formula tells us something powerful: as t → ∞, the exponential term e^(−rt/V) decays to zero, so Q(t) approaches V × cᵢₙ. In plain language, the tank eventually reaches the same concentration as the incoming solution — no matter what the starting concentration was. This is known as the steady-state or equilibrium value of the system.

SECTION 6

Worked Example — Salt in a Tank

A tank initially holds 100 liters of water with 50 grams of salt dissolved in it. Brine (salt water) containing 2 g/L of salt flows into the tank at 5 L/min, and the well-stirred mixture flows out at 5 L/min. Find the amount of salt Q(t) in the tank at any time t, and determine how much salt is in the tank after 20 minutes.

Salt Mixing Problem — Constant Volume

  1. 1

    Step 1 — Identify Given Values

    V = 100 L (constant, since rᵢₙ = rₒᵤₜ = 5 L/min). The incoming concentration is cᵢₙ = 2 g/L. The initial amount of salt is Q(0) = Q₀ = 50 g.
    V = 100 L, r = 5 L/min, cᵢₙ = 2 g/L, Q₀ = 50 g
  2. 2

    Step 2 — Write the ODE

    Using the balance law: dQ/dt = (Rate In) − (Rate Out) = (5)(2) − (5)(Q/100) = 10 − Q/20. Rearranging into standard linear form: dQ/dt + Q/20 = 10.
    dQ/dt + Q/20 = 10
  3. 3

    Step 3 — Find the Integrating Factor

    Here P(t) = 1/20, which is constant. The integrating factor is μ(t) = e^(∫(1/20)dt) = et/20e^{t/20}.
    μ(t) = et/20e^{t/20}
  4. 4

    Step 4 — Multiply and Integrate

    Multiply both sides of the ODE by et/20e^{t/20}: d/dt[et/20e^{t/20} × Q] = 10 × et/20e^{t/20}. Integrate both sides: et/20e^{t/20} × Q = 10 × 20 × et/20e^{t/20} + C = 200 × et/20e^{t/20} + C. Divide by et/20e^{t/20}: Q(t) = 200 + C × e−t/20e^{−t/20}.
    Q(t) = 200 + C × e−t/20e^{−t/20}
  5. 5

    Step 5 — Apply Initial Condition

    At t = 0, Q(0) = 50: 50 = 200 + C × e⁰ = 200 + C, so C = 50 − 200 = −150.
    Q(t) = 200 − 150 × e−t/20e^{−t/20}
  6. 6

    Step 6 — Evaluate at t = 20

    Q(20) = 200 − 150 × e−20/20e^{−20/20} = 200 − 150 × e⁻¹ ≈ 200 − 150 × 0.3679 ≈ 200 − 55.18 ≈ 144.82 grams.
    Q(20) ≈ 144.82 grams

Notice that the equilibrium amount is V × cᵢₙ = 100 × 2 = 200 g. After 20 minutes the tank already holds about 145 g, well on its way toward 200 g. As time goes on, the exponential term shrinks, and Q(t) gets closer and closer to 200 g but never quite reaches it in finite time.

SECTION 7

Strengths, Limitations & Variations

FeatureStrengthsLimitations
Well-stirred assumptionGreatly simplifies the model; yields a single ODE rather than a partial differential equation.Real tanks may have dead zones or layering, making the assumption inaccurate for large or poorly mixed vessels.
Constant flow ratesKeeps the ODE linear with constant coefficients, making it solvable by hand with an integrating factor.In practice, flow rates often vary with time, requiring numerical methods or piecewise solutions.
Single tankOne ODE captures the full dynamics; the solution is a single explicit formula.Many real systems involve cascades of tanks (e.g., wastewater treatment), requiring coupled ODEs.
No reactionsIdeal for inert substances like salt or dye where the substance doesn't degrade.Fails for substances that react, decay, or are consumed (e.g., medications metabolizing in the body).

Comparing the strengths and limitations of the basic mixing-problem model

✦

KEY TAKEAWAY

The basic mixing model is like a weather forecast: remarkably accurate for straightforward situations (clear sunny day), but it struggles with complexity (chaotic storm systems). In our case, a single well-stirred tank with constant flows is the "clear day" — and the model nails it. Multi-tank cascades, variable flows, or chemical reactions are the storms that require more advanced tools.

SECTION 8

Connection to Advanced Topics

Mixing problems are a gateway to many powerful ideas in mathematics and science. Once you're comfortable with the single-tank model, you can extend the framework in several directions. The table below compares the introductory model you've learned to its more advanced counterparts.

Basic ModelAdvanced ExtensionWhat Changes
Single tank, constant volumeSingle tank, variable volumeV(t) = V₀ + (rᵢₙ − rₒᵤₜ)t replaces V; the integrating factor involves a power function instead of an exponential.
Single tankCascading tanks (systems of ODEs)The outflow of Tank 1 becomes the inflow of Tank 2. You solve a system of coupled first-order ODEs, often using matrices.
Inert substance (no reaction)Substance with decay or reactionAn additional term −kQ is added to model radioactive decay or chemical consumption, leading to a modified linear ODE.
Constant inflow concentrationTime-varying inflow (e.g., periodic dosing)cᵢₙ becomes a function of t, so the non-homogeneous term changes and may require Laplace transforms or numerical integration.

How the basic mixing model extends into more advanced differential equations topics

If you continue studying differential equations, you'll encounter systems of ODEs and Laplace transforms — both of which build directly on the skills you develop here. The mixing problem is also structurally identical to models used in pharmacokinetics (how drugs move through your body) and compartmental epidemiology (how diseases spread through populations), so mastering this framework opens the door to a wide range of applications.

SECTION 9

Practice Problems

Question 1: CONCEPTUAL

A tank starts with pure water and brine (salt water) is pumped in. Explain, without using any formulas, why the amount of salt in the tank will never exceed a certain value no matter how long you wait. What determines that maximum value?
Show answer
As salt accumulates in the tank, the concentration inside rises, which means more salt leaves per minute through the outflow. Eventually the rate of salt leaving catches up to the rate of salt entering, and the amount stops increasing. This maximum (the steady state) occurs when dQ/dt = 0, meaning Rate In = Rate Out. The equilibrium amount is determined by V × cᵢₙ — the tank eventually reaches the same concentration as the incoming solution. For example, if cᵢₙ = 3 g/L and V = 100 L, the tank will approach 300 g of salt.

Question 2: BASIC CALCULATION

A 200-liter tank is full of pure water. A solution containing 4 g/L of sugar enters at 10 L/min, and the well-stirred mixture exits at 10 L/min. Write the differential equation for Q(t), the grams of sugar in the tank at time t.
Show answer
Since rᵢₙ = rₒᵤₜ = 10 L/min, the volume stays constant at V = 200 L. Rate In = 10 × 4 = 40 g/min. Rate Out = 10 × Q(t)/200 = Q(t)/20 g/min. Therefore the ODE is dQ/dt = 40 − Q/20, or equivalently dQ/dt + Q/20 = 40. The initial condition is Q(0) = 0 since the tank starts with pure water. This is a first-order linear ODE ready to be solved with an integrating factor μ(t) = et/20e^{t/20}.

Question 3: INTERMEDIATE

Using the ODE from Problem 2, solve for Q(t) and determine how many grams of sugar are in the tank after 30 minutes.
Show answer
The ODE dQ/dt + Q/20 = 40 has integrating factor μ = et/20e^{t/20}. Multiplying: d/dt[et/20e^{t/20} · Q] = 40et/2040e^{t/20}. Integrating: et/20e^{t/20} · Q = 40 × 20 × et/20e^{t/20} + C = 800et/20800e^{t/20} + C. Dividing by et/20e^{t/20}: Q(t) = 800 + Ce−t/20Ce^{−t/20}. Applying Q(0) = 0: 0 = 800 + C, so C = −800. Thus Q(t) = 800(1 − e−t/20e^{−t/20}). At t = 30: Q(30) = 800(1 − e−1.5e^{−1.5}) = 800(1 − 0.2231) ≈ 800 × 0.7769 ≈ 621.5 grams. The equilibrium value is 800 g, and after 30 minutes the tank is about 78% of the way there.

Question 4: APPLIED

A water treatment plant has a 5000-liter holding tank currently containing 100 g of a pollutant. Clean water (0 g/L of pollutant) is pumped in at 25 L/min while the well-stirred mixture drains at 25 L/min. Environmental regulations require the pollutant level to drop below 5 g. How many minutes must the plant run the flushing process?
Show answer
With cᵢₙ = 0 (clean water), the ODE simplifies to dQ/dt = −(25/5000)Q = −Q/200. This is a separable ODE with solution Q(t) = Q₀ · e−t/200e^{−t/200} = 100e−t/200100e^{−t/200}. We need Q(t) < 5: 100e−t/200100e^{−t/200} < 5 → e−t/200e^{−t/200} < 0.05 → −t/200 < ln(0.05) → t > −200 × ln(0.05) = −200 × (−2.996) ≈ 599.1 minutes. The plant must run the flushing process for at least about 600 minutes (10 hours) to meet the regulation. This shows that diluting a pollutant can take a surprisingly long time even with a decent flow rate.

Question 5: CRITICAL THINKING

A 500-liter tank initially contains 200 L of water with 10 g of dye dissolved in it. A dye solution of 0.5 g/L flows in at 8 L/min, and the well-stirred mixture flows out at 6 L/min. Set up the ODE for Q(t), identify V(t), and explain what happens physically when the tank fills up. (You do not need to solve the ODE completely.)
Show answer
Since rᵢₙ = 8 L/min and rₒᵤₜ = 6 L/min, the volume increases: V(t) = 200 + (8 − 6)t = 200 + 2t liters. Rate In = 8 × 0.5 = 4 g/min. Rate Out = 6 × Q(t)/V(t) = 6Q/(200 + 2t). The ODE is dQ/dt = 4 − 6Q/(200 + 2t), or equivalently dQ/dt + [3/(100 + t)]Q = 4, with Q(0) = 10. This is still a first-order linear ODE but with a time-dependent coefficient P(t) = 3/(100 + t), so the integrating factor becomes μ(t) = e3ln∣100+t∣e^{3 ln|100+t|} = (100 + t)³. Physically, the tank fills at 2 L/min and reaches its 500-liter capacity at t = (500 − 200)/2 = 150 minutes. After that, the model must change — perhaps overflow begins or the outflow rate adjusts to match the inflow. The ODE above is only valid for 0 ≤ t ≤ 150 minutes.

SUMMARY

Summary — Mixing Problems

Summary

Mixing problems model how the amount of a dissolved substance changes inside a tank when solution flows in and out continuously. The governing equation is built from a simple balance law: dQ/dt = (Rate In) − (Rate Out), where Rate In = rᵢₙ × cᵢₙ and Rate Out = rₒᵤₜ × Q(t)/V(t). The well-stirred assumption ensures the outflow concentration equals the uniform concentration inside the tank. When inflow and outflow rates are equal, the volume stays constant and the ODE is a standard first-order linear ODE solvable with an integrating factor.

The general solution for a constant-volume tank is Q(t) = V × cᵢₙ + (Q₀ − V × cᵢₙ) × e−rt/Ve^{−rt/V}, revealing that Q(t) always approaches the steady-state value V × cᵢₙ as time increases. When flow rates differ, V(t) changes linearly, producing a variable-coefficient ODE. The mixing-problem framework extends naturally to cascading tanks, pharmacokinetics, and environmental modeling, making it one of the most versatile applications of first-order ODEs.

Varsity Tutors • Differential Equations • Mixing Problems