# We have just started studying functions of several variables and their derivatives and our professor suggested the following problem as food for thought. Two squares, both with length l=1 intersect in a rectangle that has an area equal with 1/8 . Find the minimum and maximum distance between the centers of the squares.

We have just started studying functions of several variables and their derivatives and our professor suggested the following problem as food for thought.
Two squares, both with length l=1 intersect in a rectangle that has an area equal with 1/8 . Find the minimum and maximum distance between the centers of the squares.
You can still ask an expert for help

• Questions are typically answered in as fast as 30 minutes

Solve your problem for the price of one coffee

• Math expert for every subject
• Pay only if we can solve it

omeopata25
You need to introduce some coordinates in there to transform that geometry problem into an algebra one.
So let's fix the first square between $\left(0,0\right)$ and $\left(1,1\right)$, so with center $\left(1/2,1/2\right)$. Next, you have $\left(x,y\right)$ the coordinates of one edge of the other square, which defines that square up to 4 cases. We will focus on $\left(x,y\right)$ being the top right corner.
The center of that second square is then $\left(x-1/2,y-1/2\right)$. The distance between the 2 centers is then $d\left(x,y\right)=\sqrt{\left(x-1{\right)}^{2}+\left(y-1{\right)}^{2}}$
So now the problem is to find the extremum of $d\left(x,y\right)$ (or better ${d}^{2}$) subject to $xy=1/8$.
With Lagrange multipliers, that's finding the extremum of $\varphi \left(x,y,\lambda \right)=\left(x-1{\right)}^{2}+\left(y-1{\right)}^{2}-\lambda \left(xy-1/8\right)$ such that $\frac{\mathrm{\partial }\varphi }{\mathrm{\partial }x}=\frac{\mathrm{\partial }\varphi }{\mathrm{\partial }y}=0=2\left(x-1\right)-\lambda y=2\left(y-1\right)-\lambda x$
that implies $x=y=\frac{1}{2\sqrt{2}}$ (easy to verify it's a minimum by looking at the 2nd derivative).
As for the maximum, it's obviously not a critical point, so has to be on the border. For instance $x=1$ and $y=1/8$.