<s>[INST] Finding Angles Given Two Triangles with Equal Perimeters The two right triangles shown below have equal perimeters 
The hypotenuse of
the orange triangle is one leg of the green triangle stacked on top of it. If the smallest angle of the orange triangle is 20 degrees, what are the angles of the green right triangle?
 [/INST] I think I have a solution but it will be difficult to explain. I will use the following variables:
$$
\begin{split} a&=\text{base of orange triangle} \\ b&=\text{height of orange triangle} \\ c&= \text{"left" side of green triangle} \end{split}
$$
Then the hypotenuse of the orange triangle is $\sqrt{a^2+b^2}$ and the hypotenuse of the green triangle is $\sqrt{a^2+b^2+c^2}$. Since the perimeters of both triangles are equal we must have:
$$
\begin{split} &&a+b=c+\sqrt{a^2+b^2+c^2} \\ &\implies& a+b-c=\sqrt{a^2+b^2+c^2} \\ &\implies& (a+b-c)^2=a^2+b^2+c^2 \\ &\implies& a^2+b^2+c^2+2ab-2ac-2bc=a^2+b^2+c^2 \\ &\implies& ab=ac+bc \\ &\implies& c=\frac{ab}{a+b} \end{split}
$$
So now we have all sides in terms of $a$ and $b$. But we can relate $a$ and $b$ using the angle we are given. So:
$$
\tan(20)=\frac{b}{a} \implies b=a\tan(20)
$$
Using this we get:
$$
\begin{split} a^2+b^2=a^2+a^2\tan^2(20)=a^2(1+\tan^2(20))=\frac{a^2}{\sin^2(20)}  \end{split}
$$
Now we can get an expression for $a^2+b^2+c^2$ purely in terms of $a$:
$$
\begin{split} a^2+b^2+c^2&= \frac{a^2}{\sin^2(20)}+\frac{a^2b^2}{\frac{a^2}{\sin^2(20)}+2ab}\\ &=\frac{a^2}{\sin^2(20)}+\frac{a^4\tan^2(20)}{\frac{a^2}{\sin^2(20)}+2a^2\tan(20)} \\ &=\frac{a^2}{\sin^2(20)}+\frac{a^4\tan^2(20)\sin^2(20)}{a^2+2a^2\tan(20)\sin^2(20)} \\ &=\frac{a^2}{\sin^2(20)}+\frac{a^2\tan^2(20)\sin^2(20)}{1+2\tan(20)\sin^2(20)} \\ &=a^2\left[ \frac{1}{\sin^2(20)}+\frac{\tan^2(20)\sin^2(20)}{1+2\tan(20)\sin^2(20)} \right] \\ &= a^2K^2 \end{split}
$$
where $K^2$ is just the number in the square brackets (the only reason I made it $K^2$ instead of $K$ is because we will need to take square roots). Finally, letting $\theta$ be the smallest angle of the green triangle, we get:
$$
\begin{split} \cos(\theta)&=\frac{\sqrt{a^2+b^2}}{\sqrt{a^2+b^2+c^2}} \\ &=\frac{\frac{a}{\sin(20)}}{aK} \\ &=\frac{1}{K\sin(20)} \end{split}
$$
You can work out that $K\approx 2.9262$ and then plugging this in gives us $\theta\approx 2.34^{\circ}$.
</s>