Before we start listing any college-level equations or mess up your brain completely with alien equations and… This is definitely exaggerated, but the method of Lagrange Multipliers is truly not easy math and requires some knowledge from multivariable calculus. It’s a big, messy topic, and you can probably tell by the fact that I had to make the title font enormous just to match the drama. But I really hope I don’t scare anyone off, and I promise this isn’t some dry math lecture where we drown in equations and forget what happiness feels like. No, this is about something much bigger: making the most of what we’ve got. As we mentioned in our last article, it’s basically the universe’s way of saying, “Hey, you can’t have infinite tacos, but let’s figure out how to get the best taco-to-wallet ratio.” And no, not even LeBron gets infinite tacos on Taco Tuesday — budget constraints hit us all eventually.

[1]
The method I’m introducing today isn’t exactly what you’d get from high school teachers using the MIT Calculus 3 curriculum—and I know this because mine didn’t get it at first. I had to explain it to him. Which, on one hand, was mildly concerning. But on the other? This is proof that I might actually be decent at explaining this to you guys. If you didn’t like my method enough, though, it might still be interesting to know another way of solving a math problem.
1. Setup of the Utility Function
Just as we mentioned in the last post, to solve for a utility function, we need at least one utility function and one budget constraint function that comes with it. Suppose we have the utility function U(x,y) = ln(x*y) = ln(x) + ln(y), where x and y represent the quantities of two different items that provide positive utility. This simplified model captures diminishing marginal utility, as the properties of the natural logarithm dictate that additional consumption yields decreasing incremental satisfaction. The function’s concave shape reflects how the rate of utility gain declines as x and y increase, illustrating that the first unit provides the most benefit, while subsequent units contribute progressively less.
So basically, we are trying to maximize the utility function:
U(x, y) = ln(x) + ln(y)
This model represents a situation where the person’s happiness, measured in units of utility, increases with the consumption of more good x and good y, but at a diminishing rate — the more you consume, the less each additional unit brings you joy. Classic economics.
2. Adding in Constraint
An optimization problem always comes with constraints, so you must devise strategies to maximize utility within certain boundaries. For example, we can be bound by a budget constraint p₁x + p₂y = I, where p₁ and p₂ represent the prices of items x and y, respectively, and I represents the total budget available. To solve this, we use the Lagrange multiplier method, which lets us optimize a function while respecting a constraint. We define the Lagrangian function as: ℒ(x, y, λ) = ln(x) + ln(y) + λ(I – p₁x – p₂y).
So why do we add the constraint like this? Because we’re sneaky. Instead of solving the constraint separately and plugging it into the utility function (which, let’s be honest, can get messy fast), we fold it directly into the optimization process. Think of λ as a mathematical bouncer — it doesn’t do anything if you’re behaving (i.e., staying on budget), but the moment you try to sneak in extra utility by overspending, it steps in and says, “Not today.” In other words, λ tells you how much extra utility you’d gain from having one more unit of income. In econ-speak, it’s the marginal utility of income. In plain language, it tells you how happy one more dollar would make you, assuming you’re rational, logical, and not impulse-buying NFTs.
When I – p₁x – p₂y = 0, the λ-term contributes nothing — perfect. But if you go off-budget, the Lagrangian feels it. λ punishes the function for stepping outside the budget, gently guiding it back onto the constraint line. It’s optimization with boundaries — like a party where you can have fun, but not too much fun.
3. Solving the Equation
We will take partial derivatives of ℒ with respect to x, y, and λ, and set each to zero. Why? Because we’re looking for the critical points, where increasing or decreasing any variable no longer improves the result. In other words, this is where the function peaks, subject to the constraint.
So:
- ∂ℒ/∂x = 1/x – λp₁ = 0 → Solving gives λ = 1 / (p₁x)
- ∂ℒ/∂y = 1/y – λp₂ = 0 → Solving gives λ = 1 / (p₂y)
- ∂ℒ/∂λ = I – p₁x – p₂y = 0 → This is just the original budget constraint.
These equations together give us the optimal values of x and y — the point where utility is maximized, the budget is fully used, and math professors everywhere silently nod in approval.
4. Plugging back into the Constraint
Now that we know x = (p₂/p₁) * y, we plug this into the original budget constraint:
p₁x + p₂y = I
Substitute x:
p₁ * (p₂/p₁) * y + p₂y = I
→ p₂y + p₂y = I
→ 2p₂y = I
→ y = I / (2p₂)
Now solve for x using the relationship we found earlier:
x = (p₂/p₁) * y = (p₂/p₁) * (I / 2p₂) = I / (2p₁)
The optimal quantities of x and y — the combination that gives the highest possible utility within the given budget — are:
- x = I / (2p₁)
- y = I / (2p₂)
In other words, the consumer will spend half of their income on each good. The actual quantity they can buy depends on the price, but the income is evenly split. This result is symmetric because the utility function ln(x) + ln(y) treats both goods equally — there’s no built-in preference. The symmetry in the utility function, along with its logarithmic structure, naturally leads to this even 50/50 spending split.
And there you have it — a mathematical framework for maximizing happiness without maxing out your credit card. What began as a scary-looking equation turned out to be a surprisingly elegant guide to smart decision-making. The Lagrange multiplier might sound like the villain in a sci-fi movie, but it’s actually your budget’s best friend — calmly whispering, “You can’t have everything, but here’s how to get the most out of what you’ve got.” So next time someone tells you math isn’t useful in real life, just smile, nod, and ask them how they plan to optimize their next burrito run with their monthly allowance running out. Because deep down, even your lunch choices are subject to constraints. And thanks to the magic of multivariable calculus, now you know how to win at them.
5. References:
[1] https://www.pinterest.com/pin/lebron-james-taco-tuesday–59918992540629303