<s>[INST] Need what the final answer is How do I integrate:
 $\int \frac{1}{(1+x\tan x)^2}dx$
Tried the following: substituting $\tan x = \frac{\sin x}{\cos x}$ and got stuck
Next tried $\tan x = \frac{1}{\cot x}$ ,took LCM and did substitution.
 Don't know the final answer is correct or not
 [/INST] your answer is correct 
$$\int \frac{1}{(1+x\tan x)^2}dx =\dfrac{\tan x}{x\tan x+1}+Cst $$ and Substitute $$ \tan x = \dfrac{1}{\cot x}$$
\begin{align}
\int \frac{1}{(1+x\tan x)^2}dx&=\dfrac{\tan x}{x\tan x+1}+Cst\\
&=\dfrac{\dfrac{1}{\cot x}}{x\dfrac{1}{\cot x}+1}+Cst \\
&=\dfrac{1}{x+\cot x}+Cst \\
\end{align}
</s>