A pentagon is made by mounting an isosceles triangle on top of a rectangle. What dimensions minimize perimeter $P$ for a given area $K$. This was asked in a test today.
Let $x$ and $y$ denote the sides of the rectangle, and let $z$ be the height of the triangle mounted on the side with length $y$.
The perimeter is $P=2x+y+2\sqrt{0.25y^2 + z^2}$ while the area is $K = xy + 0.5yz$.
My attempt at solving it was equating dP/DK to zero. The resulting expression was extremely messy and very hard to rewrite. Is there a better, more elegant way to solve this than by forcing the answer through repeated application of chain rule.
Any answer would be appriciated.