Final Answer
Step-by-step Solution
Specify the solving method
We can solve the integral $\int\frac{1}{\cos\left(x\right)-1}dx$ by applying the method Weierstrass substitution (also known as tangent half-angle substitution) which converts an integral of trigonometric functions into a rational function of $t$ by setting the substitution
Hence
Substituting in the original integral we get
Simplifying
Take the constant $\frac{1}{-1}$ out of the integral
Rewrite the exponent using the power rule $\frac{a^m}{a^n}=a^{m-n}$, where in this case $m=0$
Apply the power rule for integration, $\displaystyle\int x^n dx=\frac{x^{n+1}}{n+1}$, where $n$ represents a number or constant function, such as $-2$
Simplify the fraction $\frac{-t^{-1}}{-1}$ by $-1$
Replace $t$ with the value that we assigned to it in the beginning: $\tan\left(\frac{x}{2}\right)$
As the integral that we are solving is an indefinite integral, when we finish integrating we must add the constant of integration $C$