(a) Start with the left-hand side: \(\frac{\sin \theta}{\sin \theta + \cos \theta} + \frac{\cos \theta}{\sin \theta - \cos \theta}\).
Combine the fractions: \(\frac{\sin \theta (\sin \theta - \cos \theta) + \cos \theta (\sin \theta + \cos \theta)}{(\sin \theta + \cos \theta)(\sin \theta - \cos \theta)}\).
Simplify the numerator: \(\sin^2 \theta - \sin \theta \cos \theta + \cos \theta \sin \theta + \cos^2 \theta = \sin^2 \theta + \cos^2 \theta = 1\).
The denominator becomes \(\sin^2 \theta - \cos^2 \theta\).
Thus, the expression simplifies to \(\frac{1}{\sin^2 \theta - \cos^2 \theta}\).
Using the identity \(\tan^2 \theta = \frac{\sin^2 \theta}{\cos^2 \theta}\), rewrite as \(\frac{1}{\frac{\sin^2 \theta - \cos^2 \theta}{\cos^2 \theta}} = \frac{\cos^2 \theta}{\sin^2 \theta - \cos^2 \theta}\).
Recognize \(\sin^2 \theta - \cos^2 \theta = (\tan^2 \theta + 1) - 2\), so \(\frac{\cos^2 \theta}{\sin^2 \theta - \cos^2 \theta} = \frac{\tan^2 \theta + 1}{\tan^2 \theta - 1}\).
Thus, the identity is proven.
(b) Set \(\frac{\tan^2 \theta + 1}{\tan^2 \theta - 1} = 2\).
Cross-multiply to get \(\tan^2 \theta + 1 = 2(\tan^2 \theta - 1)\).
Simplify: \(\tan^2 \theta + 1 = 2\tan^2 \theta - 2\).
Rearrange: \(\tan^2 \theta = 3\).
Thus, \(\tan \theta = \pm \sqrt{3}\).
For \(\tan \theta = \sqrt{3}\), \(\theta = \frac{\pi}{3}\).
For \(\tan \theta = -\sqrt{3}\), \(\theta = \frac{2\pi}{3}\).
Therefore, the solutions are \(\theta = \frac{1}{3} \pi, \frac{2}{3} \pi\).