Marginal Rate of Substitution Calculation

Marginal Rate of Substitution Calculator body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; line-height: 1.6; color: #333; max-width: 800px; margin: 0 auto; padding: 20px; } .mrs-calculator-container { background-color: #f8f9fa; border: 1px solid #e9ecef; border-radius: 8px; padding: 25px; margin-bottom: 30px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); } .mrs-header { text-align: center; margin-bottom: 25px; color: #2c3e50; } .form-group { margin-bottom: 15px; } .form-group label { display: block; margin-bottom: 5px; font-weight: 600; color: #495057; } .form-control { width: 100%; padding: 10px; border: 1px solid #ced4da; border-radius: 4px; font-size: 16px; box-sizing: border-box; } .form-control:focus { border-color: #4dabf7; outline: none; box-shadow: 0 0 0 3px rgba(77, 171, 247, 0.25); } .calc-btn { display: block; width: 100%; padding: 12px; background-color: #0056b3; color: white; border: none; border-radius: 4px; font-size: 18px; font-weight: bold; cursor: pointer; transition: background-color 0.2s; margin-top: 20px; } .calc-btn:hover { background-color: #004494; } .result-box { margin-top: 25px; padding: 20px; background-color: #fff; border-left: 5px solid #0056b3; border-radius: 4px; display: none; } .result-title { font-size: 14px; text-transform: uppercase; letter-spacing: 1px; color: #6c757d; margin-bottom: 5px; } .result-value { font-size: 32px; font-weight: 700; color: #2c3e50; } .result-interpretation { margin-top: 10px; font-size: 15px; color: #555; background: #eef7ff; padding: 10px; border-radius: 4px; } .calc-mode-selector { display: flex; gap: 20px; margin-bottom: 20px; justify-content: center; background: #fff; padding: 10px; border-radius: 4px; border: 1px solid #dee2e6; } .radio-label { display: flex; align-items: center; cursor: pointer; font-weight: 500; } .radio-label input { margin-right: 8px; } .content-section { background: #fff; padding: 0 10px; } .content-section h2 { color: #2c3e50; margin-top: 30px; } .content-section h3 { color: #34495e; } .formula-box { background: #f1f3f5; padding: 15px; font-family: monospace; border-radius: 4px; margin: 10px 0; text-align: center; font-size: 1.1em; }

Marginal Rate of Substitution (MRS)

Calculate the rate at which a consumer is willing to trade one good for another.

Good X (The good being acquired)

Good Y (The good being given up)

The satisfaction gained from one additional unit of X.
The satisfaction gained from one additional unit of Y.
Marginal Rate of Substitution (MRSxy)
0.00

What is Marginal Rate of Substitution (MRS)?

The Marginal Rate of Substitution (MRS) is a core concept in microeconomics representing the rate at which a consumer is willing to give up one good in exchange for another while maintaining the same level of utility (satisfaction). It corresponds to the slope of the indifference curve at any given point.

In simpler terms, it answers the question: "How much of Good Y must I sacrifice to get one more unit of Good X?"

MRS Formulas

There are two primary ways to calculate MRS depending on the data available:

1. Using Changes in Quantity (Discrete)

If you are observing a consumer moving along an indifference curve from one bundle to another, the formula is:

MRSxy = – (ΔY / ΔX)

Where ΔY is the change in quantity of Good Y, and ΔX is the change in quantity of Good X. Since the slope of an indifference curve is negative (you must give up something to get something), the result is often expressed as a positive magnitude.

2. Using Marginal Utilities (Calculus/Utility Function)

If you know the Marginal Utility (MU) derived from each good, the MRS equals the ratio of the marginal utilities:

MRSxy = MUx / MUy

This relationship holds because, along an indifference curve, the total utility remains constant. The loss in utility from giving up Y must exactly equal the gain in utility from acquiring X.

Example Calculation

Imagine a student choosing between Pizza (Good X) and Soda (Good Y).

  • Scenario: The student is willing to give up 4 Sodas to get 1 extra slice of Pizza.
  • Calculation: ΔY = -4, ΔX = +1.
  • MRS: -(-4 / 1) = 4.
  • Meaning: The MRS is 4. The student values that next slice of pizza four times as much as a single soda.

Diminishing Marginal Rate of Substitution

In standard economic theory (convex indifference curves), the MRS decreases as you acquire more of Good X. This is known as the Law of Diminishing Marginal Rate of Substitution. It implies that as a consumer obtains more of a good, they are willing to give up less of the other good to acquire yet another unit.

function toggleMode() { var mode = document.querySelector('input[name="calcMode"]:checked').value; var discreteSection = document.getElementById('discrete-section'); var utilitySection = document.getElementById('utility-section'); if (mode === 'discrete') { discreteSection.style.display = 'block'; utilitySection.style.display = 'none'; } else { discreteSection.style.display = 'none'; utilitySection.style.display = 'block'; } // Hide result when switching modes document.getElementById('result-box').style.display = 'none'; } function calculateMRS() { var mode = document.querySelector('input[name="calcMode"]:checked').value; var resultBox = document.getElementById('result-box'); var resultValue = document.getElementById('mrs-result'); var interpretation = document.getElementById('mrs-interpretation'); var mrs = 0; var text = ""; if (mode === 'discrete') { var x1 = parseFloat(document.getElementById('x1').value); var x2 = parseFloat(document.getElementById('x2').value); var y1 = parseFloat(document.getElementById('y1').value); var y2 = parseFloat(document.getElementById('y2').value); if (isNaN(x1) || isNaN(x2) || isNaN(y1) || isNaN(y2)) { alert("Please enter valid quantities for all fields."); return; } var deltaX = x2 – x1; var deltaY = y2 – y1; if (deltaX === 0) { alert("The change in Good X cannot be zero (division by zero error)."); return; } // MRS formula: – (Delta Y / Delta X) // If deltaX is positive (gaining X), deltaY should usually be negative (losing Y) mrs = -1 * (deltaY / deltaX); } else { var muX = parseFloat(document.getElementById('mu_x').value); var muY = parseFloat(document.getElementById('mu_y').value); if (isNaN(muX) || isNaN(muY)) { alert("Please enter valid Marginal Utility values."); return; } if (muY === 0) { alert("Marginal Utility of Good Y cannot be zero."); return; } // MRS formula: MUx / MUy mrs = muX / muY; } // Display results resultBox.style.display = 'block'; // Handle negative MRS logic (though typically expressed as absolute value in textbooks) // We will show the absolute magnitude but explain the trade-off. var displayMRS = Math.abs(mrs).toFixed(2); resultValue.innerHTML = displayMRS; if (mrs < 0 && mode === 'utility') { // Rare case where MUs have different signs text = "Result: Negative. One good is a 'bad' (reduces utility)."; } else { text = "Interpretation: To acquire 1 additional unit of Good X, the consumer is willing to give up " + displayMRS + " units of Good Y."; } // Add specific context based on magnitude if (displayMRS > 1) { text += "The consumer currently values Good X significantly more than Good Y."; } else if (displayMRS 0) { text += "The consumer currently values Good Y more than Good X."; } else if (displayMRS == 1) { text += "The consumer views the goods as perfect 1-to-1 substitutes at this margin."; } interpretation.innerHTML = text; }

Leave a Comment