Length of side of biggest square inscribed in a triangle

444 Views Asked by At

I have seen that the length of each side of the biggest square that can be inscribed in a right triangle is half the harmonic mean of the legs of the triangle. I have not seen a rigorous explanation for it, though. I would appreciate such an explanation. (This is intriguing - it is an optimization problem that does not require Calculus to explain.)

3

There are 3 best solutions below

3
On BEST ANSWER

Let we assume that the legs $CB$ and $CA$ of our right triangle $ACB$ have lengths $a$ and $b$.

First case: we consider the largest inscribed with a vertex at $C$. Assuming that its side length is $l$,
by triangle similarities we have $$ c = \sqrt{a^2+b^2} = l\cdot\left(\frac{c}{b}+\frac{c}{a}\right), $$ from which $l=\frac{1}{2}HM(a,b)$.

Second case: we consider the largest inscribed square with a side on $AB$.
By triangle similarities we have: $$ c = l+l\cdot\left(\frac{a}{b}+\frac{b}{a}\right)=l\cdot\frac{ab+c^2}{ab} $$ from which $l=\frac{abc}{ab+c^2}=\frac{ab\sqrt{a^2+b^2}}{a^2+ab+b^2}$. I leave to you to check if the inequality $$ \frac{ab}{a+b}\geq \frac{ab\sqrt{a^2+b^2}}{a^2+ab+b^2} $$ holds or not. Hint: $$ (a^2+ab+b^2)^2-(a+b)^2(a^2+b^2) = a^2b^2.$$

0
On

I think the point is that there are only finitely many squares that can be inscribed in a right triangle, so you just have to write them down and take the maximum area. Thus, there is no need for calculus.

How does one check the above claim? Note that two vertices of the square must lie one side of the triangle by the pigeonhole principle.

Case (1): Suppose the right triangle has legs of lengths $a$ and $b$. If two vertices lie on the leg of length $a$, then the square must share an angle with the right angle of the triangle, and an adjacent side of the square must lie on the leg of length $b$. Let the side of the square be $s$, and let $\theta$ denote the angle between the leg of length $a$ and the hypotenuse. Then $(a - s) \tan \theta = s$, and this equation has only one solution in $s$, namely $s = \frac{ab}{a+b}$.

Case (2): Otherwise, the square must have one edge lying on the hypotenuse. In that case, $\sin \theta = \frac{cs}{a(c-s)}$, which again has only one solution in $s$, namely $s = \frac{ab\sqrt{a^2+b^2}}{a^2 + ab + b^2}$.

You then need to take the maximum of these two possibilities; the answer will always be $\frac{ab}{a+b}$, which is the desired half-harmonic-mean.

0
On

Here is an explanation that is based on Jack D'Aurizio's explanation. I include some details and two diagrams using TikZ. To view the diagrams, add

\usepackage{tikz}

\usetikzlibrary{calc,intersections}

to the preamble of a LaTeX file.

Theorem

$\triangle{ABC}$ is a right triangle with legs of lengths $a$ and $b$. The edge length of the biggest square inscribed in the triangle is half the harmonic mean of $a$ and $b$: \begin{equation*} \frac{ab}{a + b} . \end{equation*}

Demonstration

$\mathit{PQRS}$ is the square inscribed in the triangle. Either one or two sides of the square are on the sides of the triangle. If only one side of the square is on the triangle, the side must be on the hypotenuse of the triangle. If two sides of the square are on the triangle, they must be on the legs of the triangle, and a vertex of the square must coincide with $C$. \vskip0.2in

\noindent One side~---~$\overline{\mathit{PQ}}$~---~of $\mathit{PQRS}$ is on the hypotenuse of the given triangle. Three smaller right triangle are inscribed in $\triangle\mathit{ABC}$, and they are all similar to each other and to $\triangle\mathit{ABC}$. In particular, if $P$ is closer to $A$ than $Q$, \begin{equation*} \triangle \mathit{APS} \sim \triangle \mathit{ACB} \sim \triangle \mathit{RQB} . \end{equation*} So, if the length of each side of the square is $s$, \begin{equation*} \frac{\big\vert \overline{\mathit{AP}} \big\vert}{s} = \frac{b}{a} = \frac{s}{\big\vert \overline{\mathit{BQ}} \big\vert} . \end{equation*} \begin{equation*} \big\vert \overline{\mathit{AP}} \big\vert = s \left(\frac{b}{a}\right) \qquad \text{and} \qquad \big\vert \overline{\mathit{BQ}} \big\vert = s \left(\frac{a}{b}\right) . \end{equation*} \begin{align*} c &= \big\vert \overline{\mathit{AB}} \big\vert \\ &= \big\vert \overline{\mathit{AP}} \big\vert + \big\vert \overline{\mathit{PQ}} \big\vert + \big\vert \overline{\mathit{QB}} \big\vert \\ &= s \left(\frac{b}{a} + 1 + \frac{a}{b}\right) \\ &= s \left(1 + \frac{a^{2} + b^{2}}{ab}\right) \\ &= s \left(1 + \frac{c^{2}}{ab}\right) \\ &= s \left(\frac{ab + c^{2}}{ab}\right) . \end{align*} Equivalently,

\begin{equation*} s = \frac{abc}{ab + c^{2}} = \frac{ab \sqrt{a^{2} + b^{2}}}{a^{2} + ab + b^{2}} . \end{equation*}

\begin{tikzpicture}

%A right triangle ABC is drawn with its right angle at the origin. \path (0,0) coordinate (C) (0,2.5) coordinate (A) (4,0) coordinate (B); \draw (A) -- (B) -- (C) -- cycle; % \node[anchor=south, inner sep=0] at ($(A) +(0,0.15)$){$A$}; \node[anchor=north, inner sep=0] at ($(B) +(0,-0.15)$){$B$}; \node[anchor=north, inner sep=0] at ($(C) +(0,-0.15)$){$C$};

%A square is to be inscribed in the triangle so that one of its sides is on the %hypotenuse of the right triangle. If a and b are the lengths of the legs of the %triangle, the edge length of each side of the square is %s = [ab\sqrt{a^{2} + b^{2}}]/(a^{2} + ab + b^{2}). %CR is on side BC, and CS is on side AC. If a' = |CR| and b' = |CS|, a'=a(s/c) %and b'=b(s/c). \coordinate (R) at ({(4^2*(2.5))/(4^2 + 4*(2.5) + (2.5)^2)},0); \coordinate (S) at (0,{(4*(2.5)^2)/(4^2 + 4*(2.5) + (2.5)^2)}); % %P and Q are located on the hypotenuse. \path[name path=hypotenuse] (A) -- (B); \path[name path=a_path_to_locate_P] (S) -- ($(S)!1.75cm!90:(R)$); \path[name path=a_path_to_locate_Q] (R) -- ($(R)!1.75cm!-90:(S)$); \coordinate[name intersections={of=a_path_to_locate_P and hypotenuse, by=P}]; \coordinate[name intersections={of=a_path_to_locate_Q and hypotenuse, by=Q}]; \draw (Q) -- (R) -- (S) -- (P); % \draw let \p1=($(A)-(B)$), \n1={atan(\y1/\x1)} in node[anchor=south west, inner sep=0] at ($(P) +({\n1+90}:0.15)$){$P$}; \path let \p1=($(A)-(B)$), \n1={atan(\y1/\x1)} in node[anchor=south west, inner sep=0] at ($(Q) +({\n1+90}:0.15)$){$Q$}; \node[anchor=north, inner sep=0] at ($(R) +(0,-0.15)$){$R$}; \node[anchor=east, inner sep=0] at ($(S) +(-0.15,0)$){$S$};

%A right-angle mark is drawn at C. \coordinate (U) at ($(C)!3mm!45:(B)$); \draw ($(B)!(U)!(C)$) -- (U) -- ($(A)!(U)!(C)$);

%A right-angle mark is drawn at P. \coordinate (V) at ($(P)!3mm!-45:(B)$); \draw ($(P)!(V)!(B)$) -- (V) -- ($(P)!(V)!(S)$);

%The angle mark for $\angle{ABC}$ and $\angle{ASP}$ are drawn. They are marked with "|". \draw[draw=blue] let \p1=($(A)-(B)$), \n1={atan(\y1/\x1)} in ($(B)!5mm!(C)$) arc (180:{\n1+180}:0.5); \draw[blue] let \p1=($(A)-(B)$), \n1={atan(\y1/\x1)} in ($(B) +({0.5*(180+(\n1+180))}:{0.5cm-3pt})$) -- ($(B) +({0.5*(180+(\n1+180))}:{0.5cm+3pt})$); % \draw[draw=blue] let \p1=($(P)-(S)$), \n1={atan(\y1/\x1)} in ($(S)!5mm!(P)$) arc (\n1:90:0.5); \draw[blue] let \p1=($(P)-(S)$), \n1={atan(\y1/\x1)} in ($(S) +({0.5*(\n1+90)}:{0.5cm-3pt})$) -- ($(S) +({0.5*(\n1+90)}:{0.5cm+3pt})$);

%The angle mark for $\angle{BAC}$ and $\angle{BQR}$ are drawn. They are marked with "||". \draw[name path=arc_to_mark_angle_at_A, draw=blue] let \p1=($(A)-(B)$), \n1={atan(\y1/\x1)} in ($(A)!3mm!(C)$) arc (-90:\n1:0.3); % \path[name path=a_ray_from_A_bisecting_BAC] let \p1=($(A)-(B)$), \n1={atan(\y1/\x1)} in (A) -- ($(A) +({0.5*(-90+\n1)}:1)$); \coordinate[name intersections={of=a_ray_from_A_bisecting_BAC and arc_to_mark_angle_at_A, by=S}]; % \coordinate (point_on_tangent_to_arc_at_A_at_S_below_S) at ($(S)!1pt!90:(A)$); \path[name path=a_path_from_A_to_a_point_on_tangent_to_arc_BAC_at_S_below_S] (A) -- (point_on_tangent_to_arc_at_A_at_S_below_S); \coordinate[name intersections={of=arc_to_mark_angle_at_A and a_path_from_A_to_a_point_on_tangent_to_arc_BAC_at_S_below_S, by={a_tick_mark_on_BAC}}]; \draw[draw=blue] ($(a_tick_mark_on_BAC)!-3pt!(A)$) -- ($(a_tick_mark_on_BAC)!3pt!(A)$); % \coordinate (point_on_tangent_to_arc_at_A_at_S_above_S) at ($(S)!1pt!-90:(A)$); \path[name path=a_path_from_A_to_a_point_on_tangent_to_arc_BAC_at_S_above_S] (A) -- (point_on_tangent_to_arc_at_A_at_S_above_S); \coordinate[name intersections={of=arc_to_mark_angle_at_A and a_path_from_A_to_a_point_on_tangent_to_arc_BAC_at_S_above_S, by={a_tick_mark_on_BAC}}]; \draw[draw=blue] ($(a_tick_mark_on_BAC)!-3pt!(A)$) -- ($(a_tick_mark_on_BAC)!3pt!(A)$); % % \draw[name path=arc_to_mark_angle_at_R, draw=blue] let \p1=($(Q)-(R)$), \n1={atan(\y1/\x1)} in ($(R)!3mm!(B)$) arc (0:\n1:0.3); % \path[name path=a_ray_from_R_bisecting_BRQ] let \p1=($(Q)-(R)$), \n1={atan(\y1/\x1)} in (R) -- ($(R) +({0.5*\n1}:1)$); \coordinate[name intersections={of=a_ray_from_R_bisecting_BRQ and arc_to_mark_angle_at_R, by=T}]; % \coordinate (point_on_tangent_to_arc_at_R_at_T_below_T) at ($(T)!1pt!90:(R)$); \path[name path=a_path_from_R_to_a_point_on_tangent_to_arc_BRQ_at_T_below_T] (R) -- (point_on_tangent_to_arc_at_R_at_T_below_T); \coordinate[name intersections={of=arc_to_mark_angle_at_R and a_path_from_R_to_a_point_on_tangent_to_arc_BRQ_at_T_below_T, by={a_tick_mark_on_BRQ}}]; \draw[draw=blue] ($(a_tick_mark_on_BRQ)!-3pt!(R)$) -- ($(a_tick_mark_on_BRQ)!3pt!(R)$); % \coordinate (point_on_tangent_to_arc_at_R_at_T_above_T) at ($(T)!1pt!-90:(R)$); \path[name path=a_path_from_R_to_a_point_on_tangent_to_arc_BRQ_at_T_above_T] (R) -- (point_on_tangent_to_arc_at_R_at_T_above_T); \coordinate[name intersections={of=arc_to_mark_angle_at_R and a_path_from_R_to_a_point_on_tangent_to_arc_BRQ_at_T_above_T, by={a_tick_mark_on_BRQ}}]; \draw[draw=blue] ($(a_tick_mark_on_BRQ)!-3pt!(R)$) -- ($(a_tick_mark_on_BRQ)!3pt!(R)$);

\end{tikzpicture}

A vertex~---~$S$~---~of the square coincides with $C$, and two adjacent sides~---~$\overline{\mathit{PC}}$ and $\overline{\mathit{QC}}$~---~of the square are on the legs of the given right triangle. Two smaller right triangles are inscribed in $\triangle\mathit{ABC}$, and they are both similar to each other and to $\triangle\mathit{ABC}$. In particular, \begin{equation*} \triangle \mathit{APQ} \sim \triangle \mathit{ACB} \sim \triangle \mathit{BRQ} . \end{equation*} So, if the length of each side of the square is $t$, \begin{equation*} \frac{\big\vert \overline{\mathit{AQ}} \big\vert}{t} = \frac{c}{a} \qquad \text{and} \qquad \frac{\big\vert \overline{\mathit{QB}} \big\vert}{t} = \frac{c}{b} . \end{equation*} \begin{align*} c &= \big\vert \overline{\mathit{AB}} \big\vert \\ &= \big\vert \overline{\mathit{AQ}} \big\vert + \big\vert \overline{\mathit{BQ}} \big\vert \\ &= t\left(\frac{c}{a} + \frac{c}{b}\right)\\ &= ct \left(\frac{1}{a} + \frac{1}{b}\right) . \end{align*} So, \begin{equation*} t = \frac{1}{\dfrac{1}{a} + \dfrac{1}{b}} = \frac{ab}{a + b} . \end{equation*}

\begin{tikzpicture}

%A right triangle ABC is drawn with its right angle at the origin. \path (0,0) coordinate (C) (0,2.5) coordinate (A) (4,0) coordinate (B); \draw (A) -- (B) -- (C) -- cycle; % \node[anchor=south, inner sep=0] at ($(A) +(0,0.15)$){$A$}; \node[anchor=north, inner sep=0] at ($(B) +(0,-0.15)$){$B$}; \node[anchor=north, inner sep=0] at ($(C) +(0,-0.15)$){$C$};

%A square is to be inscribed in the triangle so that two of its adjacent sides are %aligned with the legs of the right triangle. The length of each side of the square %is half the harmonic mean of the legs of the right triangle. \path (0,{(2.5*4)/(2.5+4)}) coordinate (P) ({(2.5*4)/(2.5+4)},{(2.5*4)/(2.5+4)}) coordinate (Q) ({(2.5*4)/(2.5+4)},0) coordinate (R); \draw (P) -- (Q) -- (R); % \node[anchor=east, inner sep=0] at ($(P) +(-0.15,0)$){$P$}; \path let \p1=($(A)-(B)$), \n1={atan(\y1/\x1)} in node[anchor=south west, inner sep=0] at ($(Q) +({\n1+90}:0.15)$){$Q$}; \node[anchor=north, inner sep=0] at ($(R) +(0,-0.15)$){$R$};

%A right-angle mark is drawn at C. \coordinate (U) at ($(C)!3mm!45:(B)$); \draw ($(B)!(U)!(C)$) -- (U) -- ($(A)!(U)!(C)$);

%The angle mark for $\angle{ABC}$ and $\angle{AQP}$ are drawn. They are marked with "|". \draw[draw=blue] let \p1=($(A)-(B)$), \n1={atan(\y1/\x1)} in ($(B)!5mm!(C)$) arc (180:{\n1+180}:0.5); \draw[blue] let \p1=($(A)-(B)$), \n1={atan(\y1/\x1)} in ($(B) +({0.5*(180+(\n1+180))}:{0.5cm-3pt})$) -- ($(B) +({0.5*(180+(\n1+180))}:{0.5cm+3pt})$);

\draw[draw=blue] let \p1=($(A)-(B)$), \n1={atan(\y1/\x1)} in ($(Q)!5mm!(P)$) arc (180:{\n1+180}:0.5); \draw[blue] let \p1=($(A)-(B)$), \n1={atan(\y1/\x1)} in ($(Q) +({0.5*(180+(\n1+180))}:{0.5cm-3pt})$) -- ($(Q) +({0.5*(180+(\n1+180))}:{0.5cm+3pt})$);

%The angle mark for $\angle{BAC}$ and $\angle{BQR}$ are drawn. They are marked with "||". \draw[name path=arc_to_mark_angle_at_A, draw=blue] let \p1=($(A)-(B)$), \n1={atan(\y1/\x1)} in ($(A)!3mm!(C)$) arc (-90:\n1:0.3); % \path[name path=a_ray_from_A_bisecting_BAC] let \p1=($(A)-(B)$), \n1={atan(\y1/\x1)} in (A) -- ($(A) +({0.5*(-90+\n1)}:1)$); \coordinate[name intersections={of=a_ray_from_A_bisecting_BAC and arc_to_mark_angle_at_A, by=S}]; % \coordinate (point_on_tangent_to_arc_at_A_at_S_below_S) at ($(S)!1pt!90:(A)$); \path[name path=a_path_from_A_to_a_point_on_tangent_to_arc_BAC_at_S_below_S] (A) -- (point_on_tangent_to_arc_at_A_at_S_below_S); \coordinate[name intersections={of=arc_to_mark_angle_at_A and a_path_from_A_to_a_point_on_tangent_to_arc_BAC_at_S_below_S, by={a_tick_mark_on_BAC}}]; \draw[draw=blue] ($(a_tick_mark_on_BAC)!-3pt!(A)$) -- ($(a_tick_mark_on_BAC)!3pt!(A)$); % \coordinate (point_on_tangent_to_arc_at_A_at_S_above_S) at ($(S)!1pt!-90:(A)$); \path[name path=a_path_from_A_to_a_point_on_tangent_to_arc_BAC_at_S_above_S] (A) -- (point_on_tangent_to_arc_at_A_at_S_above_S); \coordinate[name intersections={of=arc_to_mark_angle_at_A and a_path_from_A_to_a_point_on_tangent_to_arc_BAC_at_S_above_S, by={a_tick_mark_on_BAC}}]; \draw[draw=blue] ($(a_tick_mark_on_BAC)!-3pt!(A)$) -- ($(a_tick_mark_on_BAC)!3pt!(A)$); % % \draw[name path=arc_to_mark_angle_at_Q, draw=blue] let \p1=($(A)-(B)$), \n1={atan(\y1/\x1)} in ($(Q)!3mm!(R)$) arc (-90:\n1:0.3); % \path[name path=a_ray_from_Q_bisecting_BQR] let \p1=($(A)-(B)$), \n1={atan(\y1/\x1)} in (Q) -- ($(Q) +({0.5*(-90+\n1)}:1)$); \coordinate[name intersections={of=a_ray_from_Q_bisecting_BQR and arc_to_mark_angle_at_Q, by=T}]; % \coordinate (point_on_tangent_to_arc_at_Q_at_T_below_T) at ($(T)!1pt!90:(Q)$); \path[name path=a_path_from_Q_to_a_point_on_tangent_to_arc_BQR_at_T_below_T] (Q) -- (point_on_tangent_to_arc_at_Q_at_T_below_T); \coordinate[name intersections={of=arc_to_mark_angle_at_Q and a_path_from_Q_to_a_point_on_tangent_to_arc_BQR_at_T_below_T, by={a_tick_mark_on_BQR}}]; \draw[draw=blue] ($(a_tick_mark_on_BQR)!-3pt!(Q)$) -- ($(a_tick_mark_on_BQR)!3pt!(Q)$); % \coordinate (point_on_tangent_to_arc_at_Q_at_T_above_T) at ($(T)!1pt!-90:(Q)$); \path[name path=a_path_from_Q_to_a_point_on_tangent_to_arc_BQR_at_T_above_T] (Q) -- (point_on_tangent_to_arc_at_Q_at_T_above_T); \coordinate[name intersections={of=arc_to_mark_angle_at_Q and a_path_from_Q_to_a_point_on_tangent_to_arc_BQR_at_T_above_T, by={a_tick_mark_on_BQR}}]; \draw[draw=blue] ($(a_tick_mark_on_BQR)!-3pt!(Q)$) -- ($(a_tick_mark_on_BQR)!3pt!(Q)$);

\end{tikzpicture}

Only two squares are inscribed in the given triangle. The edge length in one square is $s$, and the edge length in another square is $t$. \begin{align*} &(a^{2} + ab + b^{2}){\vphantom{b^{2}}}^{2} - (a + b)^{2}(a^{2} + b^{2}) \\ &\qquad = \bigl[a^{4} + a^{2}b^{2} + b^{4} + 2(a^{3}b + a^{2}b^{2} + ab^{3})\bigr] - (a^{4} + 2a^{3}b + 2a^{2}b^{2} + 2ab^{3} + b^{4}) \\ &\qquad = a^{2}b^{2} , \end{align*} and so, \begin{equation*} t^{2} - s^{2} = \left(\frac{ab}{a + b}\right)^{2} - \left(\frac{ab \sqrt{a^{2} + b^{2}}}{a^{2} + ab + b^{2}}\right)^{2} = \frac{a^{4}b^{4}}{(a + b)^{2}(a^{2} + ab + b^{2}){\vphantom{b^{2}}}^{2}} > 0 . \end{equation*} $s < t$. \rule{1.5ex}{1.5ex}