Solve equation system with trigonometric functions I need to maximize the function $$f(x,\theta) =x\sin\theta(xcos\theta + w - 2x)$$
which defines the area enclosed by a folded plate that forms a canal, where $w$ is the length of the plate, $x$ is the length of each folded piece, $w - 2x$ is the length of the part that isn't folded and $\theta$ is the angle at which the plate is folded.
So I already found the partial derivatives of the function, which are $$
f_{x} = \sin\theta(2x\cos\theta +w- 4x)
$$ $$
f_{\theta} = x[x\cos(2\theta) + \cos\theta(w-2x)]
$$
And I have to solve the system 
$$
\sin\theta(2x\cos\theta +w- 4x) = 0 
$$ $$
[x\cos(2\theta) + \cos\theta(w-2x)] = 0
$$
but I have no idea how to start. The only solution I could find was $x = 0$ and $\sin\theta = 0$, but this solution is obviously useless because then it wouldn't be a canal but a flat unfolded plate.
 A: Since you reject $\sin\theta=0$, your first equation becomes $$2x\cos\theta+w-4x=0$$ which you can solve for $x$ in terms of $\theta$, $$x={w\over2\cos\theta-4}$$ Now put that expression for $x$ into your second equation, multiply through by the denominator, and replace $\cos2\theta$ with $2\cos^2\theta-1$, and you will have a quadratic equation for $\cos\theta$. Can you take it from there? 
A: Maybe you can use the Weierstrass substitution method. Then you can transform the variables with $$\cos(\theta)=\frac{1-t^2}{1+t^2}$$ and $$\sin(\theta)=\frac{2 t}{1+t^2}$$ to make your equations (with some simplifications)
$$ w (t^2+1)-2 x (3 t^2+1) = 0 $$
$$ x (3 t^4-6 t^2-1)-w (t^2+1) (t^2-1) = 0 $$
which is solved in term of $x$ and $t^2$ as
The second equation yeilds $ x = \frac{w (t^4-1)} { 3 t^4-6 t^2-1 } $ which is inserted into the first one as
$$ w  \frac{ (t^2+1)^2 (1-3 t^2)}{3 t^4-6 t^2-1}=0 $$ where from numerator you get the solutions $t^2=-1$ and $t^2=\frac{1}{3} $. You an guess which $t$ to use, and how to get back to $\theta$ from $t$.
