The primal problem (maximize utility subject to budget) and dual problem (minimize expenditure to achieve a utility level) yield equivalent information about consumer behavior. The expenditure function e(p,u) is the minimum cost to achieve utility u at prices p, and it contains the same information as the utility function but expressed differently. This duality allows economists to work with whichever function is more convenient.
You've studied the utility function as a way to represent preferences and the expenditure function as the minimum cost of achieving a given utility level. Duality is the formal statement that these two functions are mirror images of the same underlying preference structure — not merely related, but carrying exactly the same information in different algebraic forms.
The primal problem is what you're used to: maximize u(x) subject to p·x ≤ m. The solution gives you Marshallian (ordinary) demand functions x(p, m) — how much the consumer buys at prices p with income m. The dual problem flips the objective and constraint: minimize p·x subject to u(x) ≥ ū. The solution gives you Hicksian (compensated) demand functions h(p, ū) — how much the consumer buys to achieve utility ū at the cheapest possible cost. These look like different problems, but at the optimum they solve the same underlying tradeoff. The consumer who maximizes utility on a fixed budget is doing the same thing as the consumer who minimizes cost to hit a fixed utility level — just stated from opposite directions.
The expenditure function e(p, ū) records the value of the dual objective at its minimum: the minimum expenditure needed to achieve utility ū at prices p. Its most powerful property is Shephard's lemma: differentiating e(p, ū) with respect to any price p_i gives you the Hicksian demand for good i. This is striking — the entire demand system is encoded in the partial derivatives of a single scalar function. The same structure holds on the utility side: differentiating the indirect utility function V(p, m) with respect to income gives marginal utility of income, and Roy's identity recovers Marshallian demand from partial derivatives of V.
Duality matters practically because the expenditure function has nicer properties for welfare analysis. Marshallian demand mixes income and substitution effects; Hicksian demand isolates substitution effects by holding utility constant. When a price changes, the welfare cost is the change in e(p, ū) — the minimum expenditure needed to stay at the original utility level. This is the compensating variation, a theoretically clean welfare measure. If you want to ask "how much money would compensate this consumer for a price increase?", the expenditure function answers that directly. The duality framework is what makes this possible: because e(p, ū) and u(x) contain equivalent information, you can freely translate between the two representations to use whichever is computationally convenient or conceptually cleaner.