Two days ago, I asked a question about consumer surplus. I asked if $$\text{CS at }p_0 = \int_{0}^{q_0} [p(q) - p_0] \ dq = \int_{p_0}^{p_\max} q(p) \ dp$$ holds when $p_\max$ exists and $D(p_\max) = 0$.
I was verifying with an example today and it doesn't seem like that. Consider $Q_d = 20 - P_d$ and $Q_s = P_s - 5$. Suppose the government enforces a price of $p_0 = 8$. Then
$$\int_{0}^{q_0} [p(q) - p_0] \ dq = 31.5 \neq 72 = \int_{p_0}^{p_\max} q(p) \ dp$$
seems to be the case here. I have graphically explained every calculation here, thanks to Desmos, so the work becomes easier for you: https://www.desmos.com/calculator/hnjtruvfyj.
Please explain the inconsistency and if I am missing something.