## Example

Zoe is the only lemonade seller on her street. People who drive home stop by to purchase liters of her lemonade.

The demand for lemonade is:

$$ P = 10 - 2Q $$When Zoe produces a quantity `Q` of lemonade, her revenue is

$$ R \left( Q \right) = PQ = \left( 10 - 2Q \right) Q $$Her cost follows the equation

$$ C \left( Q \right) = 2 Q $$Overall, her profit is

$$ \Pi \left( Q \right) = R \left( Q \right) - C \left( Q \right) = \left( 10 - 2Q \right) Q - 2 Q = 8Q - 2 Q^2 $$If Zoe makes 2 liters of lemonade (Q = 2), her profit is

$$ \Pi \left( 2 \right) = 8 \times 2 - 2 \times 2^2 = 8 $$She would make a profit of $8.

### Question

The inverse demand is `P = 40 - 3Q` and the costs of production are `22 Q`.

What is Zoe's profit is she produces `Q=6`L of lemonade.

The revenue is

$$ R \left( Q \right) = PQ = (40 - 3Q) Q = 40 Q - 3Q^2 $$The cost is

$$ C ( Q ) = 22 Q $$So the profit function is

$$ \begin{align*} \Pi ( Q ) &= R (Q ) - C ( Q) \\ &= 40 Q - 3Q^2 - 22 Q \\ &= 18 Q - 3 Q^2 \end{align*} $$When `Q=6`

$$ \Pi ( 6 ) = 18 \times 6 - 3 \times 6^2 = 0 $$