<s>[INST] Two right triangles of equal perimeter share a side. Given an acute angle of one triangle, find the acute angles of the other. 
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^\circ $, what are the angles of the green triangle? 


Please help me. I didn't get any idea. 
 [/INST] I'll work through a slightly-more-general problem, replacing $20^\circ$ with $\alpha$. Writing $d$ for the hypotenuse of the lower triangle, and $\beta$ for the angle shown in the upper triangle ...

... the equal perimeters condition tells us:
$$d + d \sin\alpha + d \cos\alpha = d + d\tan\beta + d\sec\beta \tag{1}$$
That is,
$$\sin\alpha + \cos\alpha - \tan\beta = \sec\beta \tag{2}$$
Squaring both sides of (2), and noting the $\sec^2\theta = \tan^2\theta + 1$, we have
$$( \sin\alpha + \cos\alpha )^2 - 2 \tan\beta ( \sin\alpha + \cos\alpha ) + \tan^2\beta = \tan^2\beta + 1 \tag{3}$$
so that
$$\begin{align}
2\tan\beta (\sin\alpha + \cos\alpha) &= ( \sin\alpha + \cos\alpha )^2 - 1 \tag{4}\\
&= \sin^2\alpha + \cos^2\alpha + 2 \sin\alpha \cos\alpha - 1 \tag{5}\\
&= 1 + 2\sin\alpha\cos\alpha - 1 \tag{6}\\
&= 2\sin\alpha\cos\alpha \tag{7}
\end{align}$$
Therefore,

$$\tan\beta = \frac{\sin\alpha\cos\alpha}{\sin\alpha + \cos\alpha} \tag{$\star$}$$

In the particular case that $\alpha = 20^\circ$, we have
$$\tan\beta = 0.250753\ldots \quad\to\quad \beta = \operatorname{atan} 0.25073\ldots = 14.0769\ldots^\circ$$
I don't believe there's a "nice" form for this angle.
</s>