## Thomas' Calculus 13th Edition

$$- 2\cot x + 2\csc x - x + C$$
\eqalign{ & \int {\frac{{1 - \cos x}}{{1 + \cos x}}} dx \cr & {\text{Multiply the numerator and demoninator by }}1 - \cos x \cr & = \int {\frac{{\left( {1 - \cos x} \right)\left( {1 - \cos x} \right)}}{{\left( {1 + \cos x} \right)\left( {1 - \cos x} \right)}}} dx \cr & = \int {\frac{{{{\left( {1 - \cos x} \right)}^2}}}{{1 - {{\cos }^2}x}}} dx \cr & = \int {\frac{{1 - 2\cos x + {{\cos }^2}x}}{{1 - {{\cos }^2}x}}} dx \cr & {\text{Use the identity }}{\sin ^2}x + {\cos ^2}x = 1 \cr & = \int {\frac{{1 - 2\cos x + {{\cos }^2}x}}{{{{\sin }^2}x}}} dx \cr & {\text{Distribute}} \cr & = \int {\left( {\frac{1}{{{{\sin }^2}x}} - \frac{{2\cos x}}{{{{\sin }^2}x}} + \frac{{{{\cos }^2}x}}{{{{\sin }^2}x}}} \right)} dx \cr & = \int {\frac{1}{{{{\sin }^2}x}}} dx - 2\int {\left( {\frac{1}{{\sin x}}} \right)\left( {\frac{{\cos x}}{{\sin x}}} \right)dx} + \int {\frac{{{{\cos }^2}x}}{{{{\sin }^2}x}}} dx \cr & = \int {{{\csc }^2}x} dx - 2\int {\csc x\cot xdx} + \int {{{\cot }^2}x} dx \cr & = \int {{{\csc }^2}x} dx - 2\int {\csc x\cot xdx} + \int {\left( {{{\csc }^2}x - 1} \right)} dx \cr & = 2\int {{{\csc }^2}x} dx - 2\int {\csc x\cot xdx} - \int {dx} \cr & {\text{Integrating}} \cr & = - 2\cot x - 2\left( { - \csc x} \right) - x + C \cr & = - 2\cot x + 2\csc x - x + C \cr}