The condition for market equilibrium is: Qd = Qs

This implies that

40 - 2P - P^2 = 13 + 4P

Subtracting both sides by 13 + 4P

40 – 2P – P^2 – (13 + 4P) = (13 + 4P) – (13 + 4P)

40 – 13 – 2P – 4P – P^2 = 0

27 – 6P – P^2 = 0

Re-arranging the equation will give us

-P^2 – 6P + 27 = 0

Taking -1 common from the above equation

-1(p^2 + 6P - 27) = 0

This results in the following

P^2 + 6P – 27 = 0

The above quadratic equation can be solved either through factorization of by the formula. We will use the factorization method.

From the above equation, let a = 1, b = 6 and c = - 27

Step 1: Multiply a with c

Therefore

ac = 1 * (-27) = -27

Step 2: Split ac so that the sum of the factors equals the value of b. In this case, the factors would be 9 and -3.

Therefore

b = 9 – 3

Replacing the values of a, b and c in the quadratic equation above.

P^2 + (9 - 3) P – 27 = 0

P^2 + 9P – 3P – 27 = 0

P (P + 9) - 3(P + 9) = 0

(P + 9) (P – 3) = 0

Therefore, the two values of P will -9 and 3.

Since price cannot be negative. The value of the equilibrium price would be 3

To calculate the equilibrium quantity, substitute the value of P in the given equations of demand and supply.

Thus Qd = 40 – 2(3) – 3^2 = 25

Qs = 13 + 4(3) = 25

This implies that

40 - 2P - P^2 = 13 + 4P

Subtracting both sides by 13 + 4P

40 – 2P – P^2 – (13 + 4P) = (13 + 4P) – (13 + 4P)

40 – 13 – 2P – 4P – P^2 = 0

27 – 6P – P^2 = 0

Re-arranging the equation will give us

-P^2 – 6P + 27 = 0

Taking -1 common from the above equation

-1(p^2 + 6P - 27) = 0

This results in the following

P^2 + 6P – 27 = 0

The above quadratic equation can be solved either through factorization of by the formula. We will use the factorization method.

From the above equation, let a = 1, b = 6 and c = - 27

Step 1: Multiply a with c

Therefore

ac = 1 * (-27) = -27

Step 2: Split ac so that the sum of the factors equals the value of b. In this case, the factors would be 9 and -3.

Therefore

b = 9 – 3

Replacing the values of a, b and c in the quadratic equation above.

P^2 + (9 - 3) P – 27 = 0

P^2 + 9P – 3P – 27 = 0

P (P + 9) - 3(P + 9) = 0

(P + 9) (P – 3) = 0

Therefore, the two values of P will -9 and 3.

Since price cannot be negative. The value of the equilibrium price would be 3

To calculate the equilibrium quantity, substitute the value of P in the given equations of demand and supply.

Thus Qd = 40 – 2(3) – 3^2 = 25

Qs = 13 + 4(3) = 25