Consider a rectangle of dimensions $2x$ by $x$ and a square of dimensions $y$ by $y$. If the sum of the perimeters of the rectangle and square is $l$, find the value of $x$ and $y$ (in terms of $l$) that minimise the sum of areas of the rectangle and the square.
What I found on the internet are solutions where the rectangle and the square share one dimension.
$2x^2 + y^2 = A$
$6 x + 4 y = l$
so
$y = \frac{l - 6 x}{4}$
Thus $A = 2 x^2 + \left( \frac{l - 6 x}{4}\right)^2$
Expand... take the derivative with respect to $x$, set it to zero to find the minimizing (or maximizing) $x$.