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!
 A: i think it must be $A_T=\left(2+\sqrt{\frac{12-k}{3}}\right)k$
A: The formula for the area should read
$$A_{T} = \frac{(B+b) \cdot h}{2} = \frac{\left(4+2 \cdot \sqrt{\frac{12-k}{3}}\right) \cdot k}{2}=\left(2+\sqrt{\frac{12-k}{3}}\right) \cdot k.$$
Now do the same you have done with this function.
A: 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}$$
A: The trapezoid area is
$$A_{T} = \frac{(B+b) \cdot h}{2} = \frac{\left(4+2 \cdot \sqrt{\frac{12-k}{3}} \right)\cdot k}{2}$$
$$A_{T}' = 0 $$ 
$$ 2 + \frac{\sqrt{12-k}}{\sqrt{3}} - \frac{k}{\sqrt{3} \cdot 2 \cdot \sqrt{12-k}} = 0$$
$$4 \sqrt{3 \cdot (12-k)} + 24 - 3k = 0$$
$$4 \sqrt{3 \cdot (12-k)} = 3k - 24$$
Squaring both sides we get
$$16 \cdot 3 \cdot (12-k) = 9k^2-6 \cdot 24 \cdot k + 24^2 \therefore k = \frac{32}{3}$$
