How do I calculate consumer surplus and producer surplus from this? Calculate the consumer surplus, producer surplus and total surplus in the market equilibrium.


Market for beef and home demand and home supply:

$$ Q_d(p) = 50 - p $$

and

$$ Q_s(p) = p $$

With $p$ representing the price of 1 kg of beef

I understand that consumer surplus is consumer's willingness amount to pay minus consumer actual paying price.

But how do I derive from only information from above?
In equilibrium, we have supply equal to demand. So $Q_{s} = Q_{d} \implies 50 = 2p$, so $p^{*} = 25$ is the equilibrium price. Consumer surplus is defined as:

$$\int_{p^{*}}^{p_{max}} Q_{d}(p) dp$$

Here, $p_{max} = 50$, as $Q_{s} = 0$ when $p = 50$. So evaluate the integral. 

Producer surplus is similarly defined as:

$$\int_{0}^{p^{*}} Q_{s}(p) dp$$