Cross Elasticity of Demand (XED) measures the responsiveness of the quantity demanded for one good (Product A) to a change in the price of another good (Product B). It is a vital economic metric used to understand how different products interact in a competitive market.
The XED Formula
XED = % Change in Quantity Demanded of Product A / % Change in Price of Product B
Interpreting the Results
The resulting coefficient tells us the nature of the relationship between the two goods:
Positive XED (> 0): Substitutes. As the price of Product B increases, consumers switch to Product A. (e.g., Coffee and Tea).
Negative XED (< 0): Complements. As the price of Product B increases, the demand for Product A falls because they are consumed together. (e.g., Printers and Ink Cartridges).
Zero XED (= 0): Unrelated. Changes in the price of Product B have no effect on the demand for Product A. (e.g., Bread and Car Tires).
Practical Example
Imagine the price of Organic Honey (Good B) rises from $10.00 to $12.00 (a 20% increase). Consequently, the sales of Maple Syrup (Good A) rise from 1,000 units to 1,300 units (a 30% increase).
Using the calculator: 30% / 20% = 1.5. Since 1.5 is positive, Maple Syrup and Organic Honey are substitute goods.
function calculateXED() {
var q1 = parseFloat(document.getElementById('initialQuantityA').value);
var q2 = parseFloat(document.getElementById('newQuantityA').value);
var p1 = parseFloat(document.getElementById('initialPriceB').value);
var p2 = parseFloat(document.getElementById('newPriceB').value);
var resultBox = document.getElementById('xedResultBox');
var valueDisplay = document.getElementById('xedValue');
var relationDisplay = document.getElementById('xedRelationship');
var descDisplay = document.getElementById('xedDescription');
if (isNaN(q1) || isNaN(q2) || isNaN(p1) || isNaN(p2) || q1 === 0 || p1 === 0) {
alert("Please enter valid positive numbers. Initial values cannot be zero.");
return;
}
var percentageChangeQ = ((q2 – q1) / q1);
var percentageChangeP = ((p2 – p1) / p1);
if (percentageChangeP === 0) {
alert("The change in price cannot be zero to calculate elasticity.");
return;
}
var xed = percentageChangeQ / percentageChangeP;
var roundedXED = xed.toFixed(4);
valueDisplay.innerHTML = roundedXED;
resultBox.style.display = "block";
if (xed > 0) {
relationDisplay.innerHTML = "Substitutes";
relationDisplay.style.color = "#2ecc71";
descDisplay.innerHTML = "Since the coefficient is positive, these products are substitutes. When the price of Product B increases, consumers choose more of Product A.";
} else if (xed < 0) {
relationDisplay.innerHTML = "Complements";
relationDisplay.style.color = "#e74c3c";
descDisplay.innerHTML = "Since the coefficient is negative, these products are complements. When the price of Product B increases, the demand for Product A decreases.";
} else {
relationDisplay.innerHTML = "Independent / Unrelated";
relationDisplay.style.color = "#95a5a6";
descDisplay.innerHTML = "The price change of Product B has no impact on the quantity demanded of Product A.";
}
}