A pentagon is formed by placing an isosceles triangle on a rectange. If the pentagon has fixed perimeter P, find the lengths of the sides of the pentagon that maximize the area of the pentagon.

Check number 4 for a picture and answers:

http://ocw.nctu.edu.tw/upload/calcul.../ca2_test5.pdf
Its how to get the answers that i need help with...

Maximize the area:

$\displaystyle A=xy+xtan(\theta)$

Constraint:

$\displaystyle P=x+2y+x^2+y^2$

using lagrange multipliers:

$\displaystyle <y+tan(\theta),x>=\lambda<1+2x,2+2y>$

$\displaystyle y+tan(\theta)=\lambda(1+2x)$

$\displaystyle x=\lambda(2+2y)$

From here i cannot solve for any one variable. Caused mainly by the $\displaystyle tan(\theta)$, which adds one too many variables. I am most likely missing some little step to get me there, or mabye lagrange multipliers are not the best method to use...Please let me know what to do. Thanks!