How to Calculate Equilibrium Price and Quantity

Equilibrium Price and Quantity Calculator

Use this calculator to determine the equilibrium price and quantity for a given market based on linear demand and supply functions. The calculator assumes the following forms for the equations:

  • Demand Function: Qd = A - BP
  • Supply Function: Qs = C + DP

Where:

  • Qd is Quantity Demanded
  • Qs is Quantity Supplied
  • P is Price
  • A is the Demand Intercept (maximum quantity demanded when price is zero)
  • B is the absolute value of the Demand Slope (how much quantity demanded changes for a one-unit change in price)
  • C is the Supply Intercept (minimum quantity supplied when price is zero, can be negative)
  • D is the Supply Slope (how much quantity supplied changes for a one-unit change in price)
function calculateEquilibrium() { var demandIntercept = parseFloat(document.getElementById('demandIntercept').value); var demandSlope = parseFloat(document.getElementById('demandSlope').value); var supplyIntercept = parseFloat(document.getElementById('supplyIntercept').value); var supplySlope = parseFloat(document.getElementById('supplySlope').value); var resultDiv = document.getElementById('equilibriumResult'); if (isNaN(demandIntercept) || isNaN(demandSlope) || isNaN(supplyIntercept) || isNaN(supplySlope)) { resultDiv.innerHTML = 'Please enter valid numbers for all fields.'; return; } if (demandSlope <= 0) { resultDiv.innerHTML = 'Demand Slope (B) must be a positive number.'; return; } if (supplySlope <= 0) { resultDiv.innerHTML = 'Supply Slope (D) must be a positive number.'; return; } var denominator = demandSlope + supplySlope; if (denominator === 0) { resultDiv.innerHTML = 'The sum of demand and supply slopes cannot be zero. Please check your inputs.'; return; } var equilibriumPrice = (demandIntercept – supplyIntercept) / denominator; var equilibriumQuantity = demandIntercept – (demandSlope * equilibriumPrice); // Check for non-sensical results (e.g., negative price or quantity) if (equilibriumPrice < 0) { resultDiv.innerHTML = 'Equilibrium Price is negative. This may indicate that the supply curve intersects the demand curve below the quantity axis, or that there is no market equilibrium with positive price and quantity given these functions.'; return; } if (equilibriumQuantity < 0) { resultDiv.innerHTML = 'Equilibrium Quantity is negative. This may indicate that the supply curve intersects the demand curve below the quantity axis, or that there is no market equilibrium with positive price and quantity given these functions.'; return; } resultDiv.innerHTML = '

Calculation Results:

' + 'Equilibrium Price (Pe): ' + equilibriumPrice.toFixed(2) + " + 'Equilibrium Quantity (Qe): ' + equilibriumQuantity.toFixed(2) + "; } .equilibrium-calculator-container { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background-color: #f9f9f9; padding: 25px; border-radius: 10px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); max-width: 700px; margin: 20px auto; border: 1px solid #e0e0e0; } .equilibrium-calculator-container h2 { color: #2c3e50; text-align: center; margin-bottom: 20px; font-size: 1.8em; } .equilibrium-calculator-container p { color: #34495e; line-height: 1.6; margin-bottom: 10px; } .equilibrium-calculator-container ul { list-style-type: disc; margin-left: 20px; margin-bottom: 15px; color: #34495e; } .equilibrium-calculator-container ul li { margin-bottom: 5px; } .calculator-form { background-color: #ffffff; padding: 20px; border-radius: 8px; border: 1px solid #dcdcdc; margin-top: 20px; } .form-group { margin-bottom: 15px; display: flex; flex-direction: column; } .form-group label { margin-bottom: 8px; font-weight: bold; color: #34495e; font-size: 0.95em; } .form-group input[type="number"] { padding: 10px 12px; border: 1px solid #ccc; border-radius: 5px; font-size: 1em; width: 100%; box-sizing: border-box; transition: border-color 0.3s ease; } .form-group input[type="number"]:focus { border-color: #007bff; outline: none; box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25); } .calculator-form button { background-color: #28a745; color: white; padding: 12px 25px; border: none; border-radius: 5px; cursor: pointer; font-size: 1.1em; font-weight: bold; width: 100%; transition: background-color 0.3s ease, transform 0.2s ease; margin-top: 10px; } .calculator-form button:hover { background-color: #218838; transform: translateY(-2px); } .calculator-form button:active { transform: translateY(0); } .calculator-result { margin-top: 25px; padding: 20px; background-color: #e9f7ef; border: 1px solid #d4edda; border-radius: 8px; color: #155724; font-size: 1.1em; line-height: 1.8; } .calculator-result h3 { color: #155724; margin-top: 0; margin-bottom: 15px; font-size: 1.4em; } .calculator-result p { margin-bottom: 8px; } .calculator-result p.error { color: #dc3545; background-color: #f8d7da; border-color: #f5c6cb; padding: 10px; border-radius: 5px; font-weight: bold; }

Understanding Equilibrium Price and Quantity

In economics, the equilibrium price and equilibrium quantity represent the point where the quantity of a good or service demanded by consumers equals the quantity supplied by producers. At this point, the market is said to be in balance, with no surplus (excess supply) or shortage (excess demand).

The Law of Demand

The law of demand states that, all else being equal, as the price of a good or service increases, the quantity demanded will decrease, and vice versa. This inverse relationship is typically represented by a downward-sloping demand curve. Our calculator uses a linear demand function of the form Qd = A - BP, where 'A' is the quantity demanded when the price is zero (the y-intercept of the demand curve if quantity were on the y-axis), and 'B' is the absolute value of the slope, indicating how sensitive quantity demanded is to price changes.

The Law of Supply

Conversely, the law of supply states that, all else being equal, as the price of a good or service increases, the quantity supplied will also increase. This direct relationship is typically represented by an upward-sloping supply curve. Our calculator uses a linear supply function of the form Qs = C + DP, where 'C' is the quantity supplied when the price is zero (which can sometimes be negative, implying no supply below a certain price), and 'D' is the slope, indicating how sensitive quantity supplied is to price changes.

How Equilibrium is Achieved

The market naturally moves towards equilibrium. If the price is above the equilibrium price, there will be a surplus of goods, leading producers to lower prices to sell off excess inventory. If the price is below the equilibrium price, there will be a shortage, prompting consumers to bid up prices, and producers to increase supply. This dynamic adjustment continues until the market reaches equilibrium, where the quantity demanded exactly matches the quantity supplied.

Using the Calculator

To use the calculator, you need to define the parameters for your specific demand and supply functions:

  1. Demand Intercept (A): Enter the constant term from your demand equation (e.g., if Qd = 100 - 2P, A = 100).
  2. Demand Slope (B): Enter the absolute value of the coefficient of 'P' from your demand equation (e.g., if Qd = 100 - 2P, B = 2).
  3. Supply Intercept (C): Enter the constant term from your supply equation (e.g., if Qs = 10 + 3P, C = 10).
  4. Supply Slope (D): Enter the coefficient of 'P' from your supply equation (e.g., if Qs = 10 + 3P, D = 3).

Click "Calculate Equilibrium" to see the resulting equilibrium price and quantity.

Example Scenario

Imagine a market for a new gadget with the following demand and supply functions:

  • Demand: Qd = 100 - 2P (where Qd is in thousands of units, and P is in dollars)
  • Supply: Qs = 10 + 3P (where Qs is in thousands of units, and P is in dollars)

Using the calculator:

  • Demand Intercept (A) = 100
  • Demand Slope (B) = 2
  • Supply Intercept (C) = 10
  • Supply Slope (D) = 3

The calculator will determine:

  • Equilibrium Price (Pe): $18.00
  • Equilibrium Quantity (Qe): 64.00 (thousand units)

This means that at a price of $18, consumers will demand 64,000 units, and producers will supply 64,000 units, leading to a balanced market.

Leave a Comment