b2KIT

Utility Function Explorer

Visualize utility functions and indifference curves. Explore marginal utility, budget constraints, and optimal bundles in 2D.

Tested tool guide Tested browser tools Checked August 16, 2026

What Utility Function Explorer does, with a checked example

A two-good utility function U(x, y) defines two families of curves on the plane, and this tool draws both at once: indifference curves U(x, y) = c and the budget line p_x x + p_y y = m set by the prices and income you enter. The marked optimum is the highest indifference curve the budget line reaches, with marginal utilities reported at any point you click. The usual surprise: the textbook tangency MRS = p_x/p_y only holds for smooth, convex preferences with an interior solution - corner optima and non-convex utility break it, and the tool shows where.

Worked example

A concrete input and expected output from the current implementation.

Input

U = x^0.5 * y^0.5 with p_x = 2, p_y = 1, m = 100

Expected output

Budget line y = 100 - 2x. Optimal bundle (25, 50) at utility 35.36, on the indifference curve x*y = 1250. There MU_x = 0.71 and MU_y = 0.35, so MRS = 2 = p_x/p_y. The budget is exhausted: 2*25 + 50 = 100.

For Cobb-Douglas U = x^a * y^b the tangency MRS = (a*y)/(b*x) = p_x/p_y together with the budget gives x* = a*m/((a+b)*p_x) = 0.5*100/2 = 25 and y* = b*m/((a+b)*p_y) = 0.5*100/1 = 50.

How the result is produced

1

Indifference curves are level sets

Each indifference curve is the set of (x, y) pairs where U(x, y) equals a fixed level c, and the tool draws several of these levels together. Curves with larger c lie in the preferred region, and curves of a single function never cross. Spacing carries information: where adjacent curves pack tightly, utility changes rapidly across that region, and wide gaps mark a slower rise.

2

Budget line and the optimum

The budget line joins the intercepts m/p_x and m/p_y with slope -p_x/p_y; every point on it spends all of the income m. The tool marks the point on the line that lies on the highest reachable indifference curve. When that point is interior it satisfies the tangency condition MRS = MU_x/MU_y = p_x/p_y; otherwise the optimum is a corner on an axis.

Good uses

  • Verifying a hand-computed bundle: enter your function, prices, and income, and check whether your candidate matches the marked optimum or whether a corner beats it.
  • Exploring comparative statics: change one price or the income and watch the optimum slide along the new budget line, a quick preview of the sign of a demand response before drawing demand curves.
  • Building intuition for marginal utility: move a point along an indifference curve and watch MU_x fall as x rises while the curve's slope tracks -MRS, showing why only the ratio, not the level, governs choice.

Limits and checks

  • The tangency rule assumes an interior optimum. Perfect substitutes (linear U) put the optimum on an axis. Perfect complements (U = min(x, y)) put it at the kink of the highest reachable indifference curve: the budget line meets the ray x = y there, and MRS is undefined at that corner because the curve's two arms have different slopes.
  • Tangency is necessary but not sufficient. With non-convex preferences such as U = x^2 + y^2, the point where the budget line touches an indifference curve is the least preferred affordable point, and the true optimum is at a corner.
  • Utility numbers are ordinal. A level like 35.36 has no absolute meaning; multiplying U by 2, squaring it, or taking its log leaves the indifference map and the optimum unchanged, so do not compare utility values across functions or people.

Common questions

The tool marks a tangency, but buying only one good gives me a higher level. Am I misreading it?

No, that is a real corner solution. An interior tangency is the answer only when the touch lies on the budget line and preferences are convex. With linear utility (perfect substitutes) or a non-convex function such as U = x^2 + y^2, the maximum sits on an axis and the tangent point is either off the budget line or the worst affordable point.

What does a utility value like 35.36 mean?

Only an ordering. Utility is ordinal: 35.36 is preferred to 30, and that is the whole content of the number. Any strictly increasing transformation of the function produces identical indifference curves and the same optimal bundle, so the displayed level is not a meaningful unit of satisfaction.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools