<s>[INST] Optimization problem - Trapezoid under a parabola recently I've been working on a problem from a textbook about Optimization. The result that I get is $k = 8$, even thought the answer from the textbook is $k = \frac{32}{3}$
The problem follows:
--
The x axis interepts the parabola $12-3x^2$ at the points $A$ and $B$, and also the line $y = k$ (for $0 < k < 12$) at the points C and D. Determine $k$ in a way that the trapezoid $ABCD$ has a maximum area.
--
My solution was this
--
The trapezoid area is
$$A_{T} = \frac{(B+b) \cdot h}{2} = \frac{4+2 \cdot \sqrt{\frac{12-k}{3}} \cdot k}{2}$$
$$A_{T}' = 0 \therefore \frac{\sqrt{12-k}}{\sqrt{3}} - \frac{k}{\sqrt{3} \cdot 2 \cdot \sqrt{12-k}} = 0$$
$$2(12-k)-k=0 \therefore k = 8$$
--
Where did I go wrong on?
Thank you guys!
 [/INST] An alternative method:
Once you get to expressing $A$ in terms of $k$, substitute $k=12\sin^2\theta$ to help avoid messy surds. 
$$\begin{align}\\
A&=k(2+\sqrt{4-\frac k3})\\
&=12\sin^2\theta(2+\sqrt{4-4\sin^2\theta})\\
&=24\sin^2\theta(1+\cos\theta) \\
\frac{dA}{d\theta}&=24[2\sin\theta\cos\theta(1+\cos\theta)+\sin^2\theta(\sin\theta)]\\
&=24\sin\theta (\cos\theta+1)(3\cos\theta-1)=0\;\text{when}\\
\cos\theta&=\frac 13\Rightarrow \cos^2\theta=\frac19\Rightarrow \sin^2\theta=\frac89\qquad \text{(NB: $\theta\neq0$ as $k\neq0$)}\\
\Rightarrow k&=\frac{32}3\qquad \blacksquare\end{align}$$
</s>