Start with the left-hand side (LHS):
\(\frac{1 + \sin x}{\cos x} + \frac{\cos x}{1 + \sin x}.\)
Combine the fractions over a common denominator:
\(\frac{(1 + \sin x)^2 + \cos^2 x}{\cos x (1 + \sin x)}.\)
Expand the numerator:
\((1 + \sin x)^2 = 1 + 2\sin x + \sin^2 x.\)
Thus, the numerator becomes:
\(1 + 2\sin x + \sin^2 x + \cos^2 x.\)
Using the identity \(\sin^2 x + \cos^2 x = 1\), the numerator simplifies to:
\(2 + 2\sin x.\)
So the expression becomes:
\(\frac{2 + 2\sin x}{\cos x (1 + \sin x)}.\)
Factor out 2 from the numerator:
\(\frac{2(1 + \sin x)}{\cos x (1 + \sin x)}.\)
Cancel \(1 + \sin x\) from the numerator and denominator:
\(\frac{2}{\cos x}.\)
This matches the right-hand side (RHS), proving the identity.