# How to Calculate Marginal Utility

Imagine a scenario where an agent is faced with two purchasing options, each with an individual utility function. Let us say option $A$ offers $m$ units of $P$ per £, and option $B$ offers $n$ units of $Q$ per pound. Additionally, utility is linear with respect to $P$, but not so for $Q$. How do I find out when the marginal utility of $A$ is greater than $B$?

Let's assume our agent purchases positive quantities of $x$ and $y$. The utility maximization problem (without constraints on purchasing non-negative quantities) is:

$$\begin{array}{*2{>{\displaystyle}r}} \mbox{maximize (over x, y)} & u(x,y) \\ \mbox{subject to} & p_x x + p_y y \leq w \end{array}$$

The Lagrangian is:

$$\mathcal{L}(x, y, \lambda) = u(x,y) - \lambda(p_x x + p_yy - w)$$

Assuming $u$ is concave and differentiable, the problem is a convex optimization problem (in the jargon of optimization problems), and Slater's condition holds, hence the first order conditions are necessary and sufficient for an optimum. The first order conditions are: $$\frac{\partial \mathcal{L}}{ \partial x} = \frac{\partial u}{\partial x} - \lambda p_x \quad \quad \frac{\partial \mathcal{L}}{ \partial y} = \frac{\partial u}{\partial y} - \lambda p_x = 0$$

Combining both equations (taking out lambda) we have:

$$\frac{\partial u / \partial x}{p_x} = \frac{\partial u / \partial y}{p_y}$$

This gives you the classic microeconomic theory result that the marginal rate of substitution is the ratio of prices. From here can you answer the question?

(Note: as you may have noticed, I slipped into your question a few more assumptions: eg. an assumption that the agent actually buys positive quantities of Option A and Option B.)