Calculate the rate at which a consumer will trade one good for another.
From Two Consumption Bundles (Discrete Change)
From Marginal Utilities (MUx / MUy)
Bundle A (Initial State)
Bundle B (New State)
Enter the utility gained from the last unit of each good.
Marginal Rate of Substitution Calculation Example
The Marginal Rate of Substitution (MRS) is a core concept in microeconomics that measures the rate at which a consumer is willing to give up one good in exchange for another while maintaining the same level of satisfaction (utility). It represents the absolute slope of the indifference curve at any given point.
How to Calculate MRS
There are two primary ways to calculate the Marginal Rate of Substitution depending on the data available to you:
Method 1: Using Changes in Quantity (Arc MRS)
If you have two different bundles of goods (Bundle A and Bundle B) lying on the same indifference curve, you calculate the MRS by looking at the ratio of changes:
MRSxy = – (ΔY / ΔX) = – (Y2 – Y1) / (X2 – X1)
Ideally, this result is negative because Indifference Curves slope downward, implying a trade-off. However, economists typically report MRS as a positive absolute value.
Method 2: Using Marginal Utilities
If you know the utility function or the specific Marginal Utility (MU) derived from each good, the formula relates to the ratio of their utilities:
MRSxy = MUx / MUy
This tells us that the rate of exchange depends on how much satisfaction the last unit of X gave you compared to the last unit of Y.
Real World Calculation Example
Let's consider a consumer choosing between Coffee (Good X) and Bagels (Good Y).
Scenario: Currently, the consumer has a bundle of 5 Coffees and 10 Bagels. To get 1 more Coffee (moving to 6 Coffees), they are willing to give up 2 Bagels (dropping to 8 Bagels) to stay equally happy.
Initial State (A): X1 = 5, Y1 = 10
New State (B): X2 = 6, Y2 = 8
Calculation:
Calculate ΔY (Change in Bagels): 8 – 10 = -2
Calculate ΔX (Change in Coffee): 6 – 5 = 1
Ratio: -2 / 1 = -2
MRS = |-2| = 2
Interpretation: The Marginal Rate of Substitution is 2. This means the consumer is willing to give up 2 Bagels to obtain 1 extra Coffee.
Why does MRS Diminish?
The Law of Diminishing Marginal Rate of Substitution states that as a consumer obtains more of Good X (Coffee), the amount of Good Y (Bagels) they are willing to give up for yet another unit of X decreases. This creates the convex shape typical of indifference curves.
function toggleMethod() {
var method = document.getElementById('calcMethod').value;
var pointsDiv = document.getElementById('pointsInputs');
var utilityDiv = document.getElementById('utilityInputs');
var resultBox = document.getElementById('resultBox');
// Reset result display when switching
resultBox.style.display = 'none';
if (method === 'points') {
pointsDiv.style.display = 'block';
utilityDiv.style.display = 'none';
} else {
pointsDiv.style.display = 'none';
utilityDiv.style.display = 'block';
}
}
function calculateMRS() {
var method = document.getElementById('calcMethod').value;
var mrs = 0;
var explanationText = "";
var resultElement = document.getElementById('mrsValue');
var explanationElement = document.getElementById('mrsExplanation');
var resultBox = document.getElementById('resultBox');
if (method === 'points') {
// Get inputs for Method 1
var x1 = parseFloat(document.getElementById('x1').value);
var y1 = parseFloat(document.getElementById('y1').value);
var x2 = parseFloat(document.getElementById('x2').value);
var y2 = parseFloat(document.getElementById('y2').value);
// Validation
if (isNaN(x1) || isNaN(y1) || isNaN(x2) || isNaN(y2)) {
alert("Please enter valid numbers for all quantities.");
return;
}
var deltaY = y2 – y1;
var deltaX = x2 – x1;
if (deltaX === 0) {
alert("Change in Good X cannot be zero (division by zero).");
return;
}
// Formula: – (Delta Y / Delta X)
var slope = deltaY / deltaX;
mrs = -1 * slope;
// Formatting output
resultElement.innerHTML = "MRS = " + mrs.toFixed(2);
var tradeDirection = "";
if (deltaX > 0 && deltaY < 0) {
tradeDirection = "You are giving up " + Math.abs(deltaY) + " units of Good Y to gain " + Math.abs(deltaX) + " unit(s) of Good X.";
} else if (deltaX 0) {
tradeDirection = "You are giving up " + Math.abs(deltaX) + " units of Good X to gain " + Math.abs(deltaY) + " unit(s) of Good Y.";
} else {
tradeDirection = "The calculation involves a change of " + deltaY + " Y and " + deltaX + " X.";
}
explanationText = tradeDirection + "The rate of substitution is " + mrs.toFixed(2) + ". (Calculated as negative slope: -(" + deltaY + " / " + deltaX + "))";
} else {
// Get inputs for Method 2
var mux = parseFloat(document.getElementById('mux').value);
var muy = parseFloat(document.getElementById('muy').value);
// Validation
if (isNaN(mux) || isNaN(muy)) {
alert("Please enter valid numbers for Marginal Utilities.");
return;
}
if (muy === 0) {
alert("Marginal Utility of Good Y cannot be zero.");
return;
}
// Formula: MUx / MUy
mrs = mux / muy;
resultElement.innerHTML = "MRS = " + mrs.toFixed(2);
explanationText = "Given the Marginal Utilities, you are willing to give up " + mrs.toFixed(2) + " units of Good Y to obtain 1 additional unit of Good X while maintaining the same utility.";
}
explanationElement.innerHTML = explanationText;
resultBox.style.display = 'block';
}