TITLE: Smallest square to cover a right triangle
QUESTION [23 upvotes]: I believe smallest possible triangle to cover a square is well studied... But how about square covering a triangle? I read the post here, but I think that I don't want such a general question (and complicated solution), just right triangle.
I first encounter the problem, which is, find the square with minimum length that covers a triangle with sides $5,12,13$ completely. The answer is a square with length$\frac{144}{\sqrt{193}}$ and I believe so, using the method here.
But the problem is, why is it the smallest possible square covering the triangle?
My attempts:


If a square covers the triangle and at the same time they have some vertex(s) coinciding:

If it is $\angle BAC$ touching vertex of square, see here, the square covering it should have side length of at least 12.

If it is $\angle BCA$ touching the vertex of square, see here, the square covering it should also have side length of at least 12.

This leaves us to the problem of $\angle ABC$, see here or below:
It is the smallest because whatever it is rotated clockwise/anti-clockwise through the origin, the side length of square will be larger.
For every square covering a triangle, there is a smaller square covering the same triangle while touching at least a vertex using its vertex(s). But how does it implies that the side length of square is at least $\frac{144}{\sqrt{193}}$? I mean, a square which touches the triangle with its vertex may have a shorter side length, but why is there no square with side length even shorter (doesn't touch the triangle using its vertex)? Why do we need only to consider these three cases?
Any help will be appreciate! Thank you.

REPLY [4 votes]: We work with a right triangle having legs $a\geq b$ and hypotenuse $c$. Its angles then satisfy $$0<\beta\leq{\pi\over4}\leq\alpha<\pi\ .$$ We circumscribe rectangles around this triangle, starting with the black rectangle in the figure. This rectangle is either turned to the right by an angle $\psi\in[0,\beta]$ (drawn as red rectangle), or is turned to the left by an angle $\phi\in[0,\alpha]$ (drawn as blue rectangle).

These red or blue rectangles are covered by squares of side lengths
$$s(\psi)=\max\{c \cos\psi, b\cos(\beta-\psi)\}=c\max\{\cos\psi, \sin\beta\cos(\beta-\psi)\}\qquad(0\leq\psi\leq\beta)\ ,\tag{1}$$
resp.,
$$s(\phi)=\max\{c\cos\phi, a\cos(\alpha-\phi)\}=c\max\{\cos\phi,\sin\alpha\cos(\alpha-\phi)\}\qquad(0\leq\phi\leq\alpha)\ .\tag{2}$$
Since $\beta\leq{\pi\over4}$ we know that for $\psi\in[0,\beta]$ one has
$$\cos\psi\geq\cos\beta\geq\sin\beta\geq\sin\beta\cos(\beta-\psi)\ ,$$
so that $(1)$ gives $s(\psi)=c\cos\psi\geq c\cos\beta$.
Since $\alpha\geq{\pi\over4}$ the first entry $\cos\phi$ on the RHS of $(2)$ is monotonically decreasing in the interval $0\leq\phi\leq\alpha$ from $1$ to $\cos\alpha$. At the same time the second entry $\sin\alpha\cos(\alpha-\phi)$ is monotonically increasing from $\sin\alpha\cos\alpha<1$ to $\sin\alpha\geq\cos\alpha$. It follows that $s(\phi)$ is minimal at the unique point $\phi_*\in[0,\alpha]$ where these two graphs intersect: When $\phi<\phi_*$ then $s(\phi)=\cos\phi>s(\phi_*)$, and when $\phi>\phi_*$ then $s(\phi)=\sin\alpha\cos(\alpha-\phi)>s(\phi_*)$.
Solving
$$\cos\phi=\sin\alpha\cos(\alpha-\phi)\tag{3}$$
leads to
$$\tan\phi_*={1-\sin\alpha\cos\alpha\over\sin^2\alpha}\ .$$
From $(3)$ we obtain $\cos\phi_*\leq\sin\alpha=\cos\beta$. This makes sure that by choosing $\phi=\phi_*$ we obtain a smaller square than with choosing the $\psi$-side treated before. Therefore the smallest square has side length
$$s(\phi_*)=c\cos\phi_*=c{\sin^2\alpha\over\sqrt{1-2\sin\alpha\cos\alpha+\sin^2\alpha}}={a^2\over\sqrt{c^2-2ab+a^2}}\ .$$
For $(a,b,c)=(12,5,13)$ one obtains $s(\phi_*)={144\over\sqrt{193}}$.