In economics, the market equilibrium is defined as a state in a market where there is no pressure for change. That is, there is no pressure for price to move up or down. The primary forces behind this are supply and demand. As long as demand is greater than supply (or vice versa) there is pressure on the price to move up (or down). This process continues until the market reaches its equilibrium, i.e. until quantity supplied equals quantity demanded.

In the following paragraphs, we will look at how to calculate the equilibrium price and quantity mathematically. To do this, we follow a simple 5-step process: (1) calculate supply function, (2) calculate demand function, (3) set quantity supplied equal to quantity demanded and solve for equilibrium price, (4) plug equilibrium price into supply function, and (5) validate result by plugging equilibrium price into demand function (optional).

*Please note: For the sake of simplicity we use linear supply and demand functions in this article. However, although a bit more complicated, the same process can be applied to any other type of supply and demand functions. *

## 1) Calculate Supply Function

In its most basic form, a linear supply function looks as follows: *Q _{S} = mP + b*. In this equation,

*x*and

*y*represent the independent and dependent variables,

*m*shows the slope of the function and

*b*represents its y-intersect. We can use this basic form to calculate actual supply functions. All we need for this is two ordered pairs of price and quantity (e.g. at a price of

*a*demand is

*b*and at a price of

*c*demand is

*d*). With this information we can calculate the slope of the function (which is usually positive) and then solve for the y-intersect by plugging two of the initial values into the updated function. For a more detailed step-by-step guide on this, check out our article on how to calculate a linear supply function.

Let’s look at an example to illustrate this. Think of an imaginary burger restaurant (*Deli Burger*). At a price of USD 3.00 per burger, *Deli Burger* is willing and able to sell 600 burgers. If the price of a burger increases to USD 4.00, it becomes more profitable to sell them, so the restaurant expands production and sells 800 burgers. With this information we can calculate the firm’s supply function as described above. Hence, *Deli Burger’s* supply function looks like this: ** Q_{S} = 200P + 0 (i.e. Q_{S} = 200P)**.

## 2) Calculate Demand Function

Similar to the supply function, we can calculate the demand function with the help of a basic linear function *Q _{D} = mP + b *and two ordered pairs of price and quantity. As a matter of fact, the process of calculating a linear demand function is exactly the same as the process of calculating a linear supply function. However, unlike most supply functions the majority of demand functions has a negative slope. To understand why that is, make sure to read our step-by-step guide on how to calculate a linear demand function as well.

With that being said, let’s revisit our example from above. So far we already know how many burgers *Deli Burger* is willing and able to sell at different prices. Now we need to find out how many burgers the customers are actually going to buy at those prices. Let’s assume they are willing and able to buy 1000 burgers at a price of USD 2.00. Meanwhile if price increases to USD 4.00, they will only buy 800 burgers. With this information we can calculate the following market demand function: *Q _{D} = -100P + 1200.*

## 3) Set Quantity Supplied Equal to Quantity Demanded and Solve for Equilibrium Price

Once we have calculated both the supply and the demand function, we can set quantity supplied (Q_{S}) equal to quantity demanded (Q_{D}). By definition, the intersection of the supply and demand curve represents the market equilibrium. At this point quantity supplied has to be equal to quantity demanded (i.e. Q_{S }= Q_{D}). Starting from this simple equation, we can replace both sides with their corresponding functions (see section 2 and 3). This allows us to solve the resulting equation for P and find the equilibrium price.

So let’s apply this to our example. We know that according to the equilibrium condition Q_{S }= Q_{D}. Now we can simply replace *Q _{S }*with

*200P*(because Q

_{S}= 200P) and

*Q*with

_{D }*-100P + 1200*(because Q

_{D}= -100P + 1200). This results in the following equation:

*200P = -100P +1200*. If we solve this equation for P we find that P = 4. Or in other words, the market reaches its equilibrium at a price of

**USD 4.00**.

## 4) Plug Equilibrium Price into Supply Function

Now that we know equilibrium price, we can finally calculate equilibrium quantity. To do this, we simply plug the equilibrium price we just calculated (see section 3) back into the supply function (see step 1). Next, we solve the resulting equation for Q_{S} to find the equilibrium quantity. Please note that it does not matter if we use the supply function or the demand function for this step. Both functions will return the same equilibrium quantity because – as we learned above – in the equilibrium Q_{S }is always equal to Q_{D}.

In the case of our example that means we plug the equilibrium price (i.e. USD 4.00) into *Deli Burger’s* initial supply function Q_{S} = 200P. This results in the following equation Q_{S} = 200*4. Hence, the equilibrium quantity is 800 burgers.

## 5) Verify by Plugging Equilibrium Price into Demand Function (optional)

Last but not least, we can verify our result by plugging the quantity and price we just calculated into the demand function. As mentioned above, the two functions should always return the same equilibrium quantity and price. This step is optional, but it’s a great way to validate your result during exams and quizzes and make sure your calculations are correct.

Thus, to validate the result from our example, we can take the equilibrium quantity (800 burgers) and the equilibrium price (USD 4.00) and plug them back into the demand function *Q _{D} = -100P + 1200*. This leaves us with the following equation: 800 = -100*4 + 1200. Fortunately for us, the equation holds true. Therefore we can conclude that our calculations are correct.

## In a Nutshell

A market has reached its equilibrium when quantity demanded equals quantity supplied. This is the case when the demand curve and the supply curve intersect. To calculate equilibrium price and quantity mathematically, we can follow a 5-step process: (1) calculate supply function, (2) calculate demand function, (3) set quantity supplied equal to quantity demanded and solve for equilibrium price, (4) plug equilibrium price into supply function, and (5) validate result by plugging equilibrium price into the demand function (optional).