Here is an image of the problem...
So labeled the bottom base as $x$ and the upper base as $y$ this helped me come up with two equations, one for perimeter $P$ and one for area $A$:
$$P = 24 = x + 2\frac{(y-x)}{2cos\theta}$$
and
$$A = \frac{x+y}{2} \times \frac{y-x}{2}tan\theta$$
I did some simplifying but I am stuck on which variable I should isolate and from which equation, or if maybe I've made a mistake? Answer in the book is $\theta = \pi/3 $ and the legs of the trapezoid $= 8$ cm

Denote by $y$ the amount bended up on both sides and by $x$ the remaining base. Then $x+2y=24$ and $$A=(x+y\cos\theta) y\sin\theta=\bigl(24-y(2-\cos\theta)\bigr)y\sin\theta=: f(y,\theta)\ .$$ One computes $$\eqalign{f_y&=2\sin\theta(12-2y+y\cos\theta)\ ,\cr f_\theta&=y\bigl(2\cos^2\theta+2\cos\theta(12-y)-1\bigr)\ .\cr}$$ Put $\cos\theta=:u$. From $f_y=0$ we get $y={12\over2-u}$, and $f_\theta=0$ then leads to $u={1\over2}$. We therefore have a stationary point at $y=8$, $\theta={\pi\over3}$.
This means that the optimal gutter is half of a regular hexagon.