Consider the diagram below.

In \( \triangle AEF \), \( \angle EAF = \beta \) so \( \angle AFE = \dfrac{\pi}{2}-\beta \).
Since \( \sin(\beta) = \dfrac{EF}{1} \), then \( EF = \sin{(\beta)} \). Similarly, \( AE = \cos{(\beta)} \).
In \( \triangle ABE \), \( \angle BAE = \theta \) so \( \angle AEB = \dfrac{\pi}{2}-\theta \).
Since \( \sin{(\theta)} = \dfrac{BE}{AE} = \dfrac{BE}{\cos(\beta)} \), then \( BE = \sin{(\theta)}\cos{(\beta)} \). Similarly, \( AB = \cos{(\theta)}\cos{(\beta)} \).
In \( \triangle ADF \), \( \angle DAF = \dfrac{\pi}{2} - \theta - \beta \) and \( \angle AFD = \pi - \dfrac{\pi}{2}-\left(\dfrac{\pi}{2} - \theta - \beta \right) = \theta + \beta \).
Since \( \sin{(\theta + \beta)} = \dfrac{AD}{AF} = \dfrac{AD}{1} \), then \( AD = \sin{(\theta+\beta)} \). Similarly, we get \( DF = \cos{(\theta + \beta)} \).
In \( \triangle CEF \), \( \angle CEF = \pi - \dfrac{\pi}{2} - \left(\dfrac{\pi}{2}-\theta\right)= \theta \). Thus, \( \angle CFE = \dfrac{\pi}{2}-\theta \)
Since \( \sin{(\theta)} = \dfrac{CF}{EF} = \dfrac{BE}{\sin{(\beta)}} \), then \( CF = \sin{(\theta)}\sin{(\beta)} \). Similarly, \( CE = \cos{(\theta)}\sin{(\beta)} \).
In rectangle \( ABCD \), \( AD = BC = BE+CE \), \( \therefore \sin{(\theta + \beta)} = \sin{(\theta)}\cos{(\beta)} + \cos{(\theta)}\sin{(\beta)} \).
Also, \( AB = CD = CF + DF \), so
\[ \cos{(\theta)}\cos{(\beta)} = \cos{(\theta + \beta)} + \sin{(\theta)}\cos{(\beta)} \]
Therefore, \( \cos{(\theta + \beta)} = \cos{(\theta)}\cos{(\beta)} - \sin{(\theta)}\cos{(\beta)}\).