Angles between lateral faces of any rectangular-based pyramid I was just wondering if anyone had any idea how to solve this problem:
What is the angle between lateral faces of a rectangular-based pyramid with length a, width b, and height h, in terms of a, b and h?
Any responses are much appreciated.

@Aretino's coordinate/vector approach might be the most accessible, but it's worth mentioning a couple of others.

Given any three-faced "corner", one can determine the dihedral angles from the face angles (or vice-versa) using an appropriate Spherical Law of Cosines. For the problem at hand, with this configuration ...

... we can write ...

$$\cos\angle APB = \cos\angle APC \cos \angle BPC + \sin\angle APC \sin\angle BPC \cos\angle PC \tag{$\star$}$$

where "$\angle PC$" indicates the dihedral angle along $\overline{PC}$. In our rectangular pyramid, $\angle APB$ is a right angle, so that $(\star)$ reduces to

$$\cos\angle PC = -\cot\angle APC \cot\angle BPC \tag{1}$$

Labeling a few distances, including $m$ and $n$ as altitudes of faces $\triangle CPA$ and $\triangle CPB$, ...

... we have ...
$$\cos \angle PC = -\frac{a/2}{m} \cdot \frac{b/2}{n} = -\frac{ab}{4mn} \tag{2}$$
Invoking Pythagoras,
$$m^2 = \left(\frac{b}{2}\right)^2 + h^2 = \frac{1}{4}\left( b^2 + 4 h^2 \right) \qquad\qquad n^2 = \frac{1}{4}\left( a^2 + 4 h^2 \right)$$
we have

$$\cos\angle PC = -\frac{ab}{\sqrt{(a^2 + 4 h^2 )(b^2 + 4 h^2 )}} \tag{3}$$


I would be remiss not to also mention a solution using a hedronometric ("area-based") Law of Cosines for Tetrahedra. In particular:

$$\begin{align}
&|\triangle PAC|^2 + |\triangle PBC|^2 - 2 |\triangle PAC||\triangle PBC|\cos\angle PC \\
= &|\triangle ACB|^2 + |\triangle APB|^2 - 2|\triangle ACB||\triangle APB|\cos\angle AB
\end{align} \tag{$\star\star$}$$

As dihedral $\angle AB$ is a right angle, isolating $\cos \angle PC$ gives:
$$\cos\angle PC = \frac{|\triangle PAC|^2 + |\triangle PBC|^2 - |\triangle ACB|^2 - |\triangle APB|^2}{2|\triangle PAC||\triangle PBC|} \tag{4}$$
Then, since ...
$$
|\triangle PAC| = \frac12 a m = \frac14 a \sqrt{b^2 + 4 h^2} \qquad\qquad
|\triangle PBC| = \frac12 b n = \frac14 b \sqrt{a^2 + 4 h^2 }$$
$$
|\triangle ACB| = \frac12 h |\overline{AB}| = \frac12 h \sqrt{a^2+b^2} \qquad\qquad |\triangle APB| = \frac12 ab$$
... we find that $(4)$ ultimately reduces to $(3)$. $\square$
