Start with the left-hand side: \(\frac{1 + \sin \theta}{\cos \theta} + \frac{\cos \theta}{1 + \sin \theta}\).
Combine the fractions over a common denominator:
\(\frac{(1 + \sin \theta)^2 + \cos^2 \theta}{\cos \theta (1 + \sin \theta)}\).
Expand \((1 + \sin \theta)^2\):
\(1 + 2\sin \theta + \sin^2 \theta\).
Use the identity \(\sin^2 \theta + \cos^2 \theta = 1\):
\(1 + 2\sin \theta + \sin^2 \theta + \cos^2 \theta = 2 + 2\sin \theta\).
Substitute back:
\(\frac{2 + 2\sin \theta}{\cos \theta (1 + \sin \theta)}\).
Factor out 2:
\(\frac{2(1 + \sin \theta)}{\cos \theta (1 + \sin \theta)}\).
Cancel \(1 + \sin \theta\):
\(\frac{2}{\cos \theta}\).
This matches the right-hand side, proving the identity.