<s>[INST] How to choose your $u$ value properly to solve $\int\frac{1}{5+3\cos (x)} \cdot dx$. We are given the following facts:


*

*$\cos(x) = \frac{1-u^2}{1+u^2}$,

*$dx = \frac{2du}{1+u^2}$
Using 1. and 2. along with u substitution solve the following integral.
$$\int\frac{1}{5+3\cos (x)} \cdot dx$$

I re-wrote the integral in terms of $u$ and simplified it as much as possible.
$$\implies \int\frac{1}{5+3(\frac{1-u^2}{1+u^2})} \cdot \frac{2du}{1+u^2}= \int \frac{1}{5+\frac{3-3u^2}{1+u^2}} \cdot \frac{2du}{1+u^2} = \int \frac{1}{\frac{5+5u^2+3-3u^2}{1+u^2}} \cdot \frac{2du}{1+u^2}$$
$$=\int \frac{1}{\frac{8+2u^2}{1+u^2}} \cdot \frac{2du}{1+u^2}= \int \frac{1}{\frac{2(4+u^2)}{1+u^2}} \cdot \frac{2du}{1+u^2}= \int \frac{1+u^2}{2(4+u^2)} \cdot \frac{2du}{1+u^2}=\int \frac{1}{4+u^2} \cdot du$$
I know that $\int \frac{1}{1+x^2}= \text{arctan(x)}$ but in my case I have a $4$ and not a $1$. My guess is that I have to use $u$-subsitution again but I can't figure out what $v$ is going to be. I've seen a lot of videos from BlackPenRedPen about $u$-substitution and I've noticed that he's able to see what the end result should be and choose his $u$ based on that, however I have no such talent. Therefore I'm confused as to what my new $u$ which will actually be a $v$ since I've already used a $u$, will be.
 [/INST] You need a substitution such that $$ 4+u^2 = 4(1+v^2)$$
that is $u=2v$. That gives you $$ \int \frac{du}{4+u^2} = \int\frac{2 dv}{4(1+v^2)} = \frac12 \arctan v + C = \frac12 \arctan\frac u 2 + C$$
</s>