<s>[INST] Calculus Question: $\int\frac{\sqrt{x^2-1}+x}{\sqrt{x^2-1}+x-1}dx$ How to evaluate integral $$\int\frac{\sqrt{x^2-1}+x}{\sqrt{x^2-1}+x-1}dx?$$
I tried substitution $u^2=x^2-1$ and $u=\sqrt{x^2-1}+x$ but it turns out too complicated. Could anyone here help me to evaluate the integral? Thanks in advance.
 [/INST] An other solution is to substitute x=sin(u), and then to use the well known relations $cos(u)=\frac{1-t^2}{1+t^2}$ and $sin(u)=\frac{2t}{1+t^2}$ with $t=tan(\frac{u}{2})$ to simplify the problem.
More detailed :
$\int\frac{\sqrt{x^2-1}+x}{\sqrt{x^2-1}+x-1}dx = x + \int\frac{1}{\sqrt{x^2-1}+x-1}dx$
$\int^y \frac{1}{\sqrt{x^2-1}+x-1}dx=\int^{arcsin(y)} \frac{cos(x)}{\cos{x}+\sin{x}-1}dx$
With the two relations I gave above, we have $\frac{\cos{x}}{\cos{x}+\sin{x}-1}=1+\frac{\frac{1-t^2}{1+t^2}}{\frac{2t+1-t^2-1-t^2}{1+t^2}}=\frac{1-t^2}{t-t^2}=\frac{1+t}{t}=1+\frac{1}{t}=1+\frac{1}{\tan{\frac{u}{2}}}$
</s>