By setting supply price and demand price equal to each other we find an equilibrium quantity of 34 and an equilibrium price of 38. The formulas for the consumer and producer surpluses become:
\begin{equation*}
\text{consumer surplus}= \int_0^{34} ((106-2q)-38)\, dq
\end{equation*}
\begin{equation*}
\text{producer surplus}= \int_0^{34} ( 38-(4+q)) \, dq
\end{equation*}
To evaluate the integrals we can notice that each is a triangle of base 34. One has height of 34 and the other has a height of 68. Using geometry, the consumer surplus is $1,156 and the producer surplus is $578.
To find the maximum producer surplus, we need to turn the endpoint into a variable. If the producers act as a cartel,
\begin{equation*}
\text{producer surplus}= \int_0^x ( (106-2x)-(4+q))\, dq=\int_0^x ( 102-2x-q)\, dq
\end{equation*}
\begin{equation*}
=\left.\left((102-2x)q-\frac{q^2}{2}\right) \right|_0^x=((102-2x)x-\frac{x^2}{2}=102x-\frac{5x^2}{2}
\end{equation*}
We can find the maximum of this by taking its derivative and setting it equal to 0. The maximum occurs when
\(x=\frac{102}{5}=20.4\text{.}\) At that point the producer surplus is $1,040.40.