Help with $\int \frac{\sqrt{x^2 + 1}}{x}\:dx$

The first problem is where you took $1-\sin^2 s=(1+\sin s)(1+\sin s).$ I believe this is just a slip and you know the right factorization.

The second one is that the decomposition into partial fractions is incorrect. We have that $$\frac1z-\frac12\left(\frac{1}{1+z}+\frac{1}{1-z}\right)\ne\frac{1}{z(1-z^2)}.$$


And to evaluate the $$\int\frac{\sec s}{\tan s}\sec^2s\mathrm ds,$$ you don't need to go to all this trouble. A little rewriting of the integrand helps, as follows: $$\frac{\sec s}{\tan s}\sec^2s=\frac{\sec s}{\tan s}(1+\tan^2s)=\frac{\sec s}{\tan s}+\sec s\tan s=\csc s+\sec s\tan s.$$


In some cases trigonometric substitution should be avoided

$$\displaystyle I=\int\dfrac{\sqrt{1+x^2}}xdx=\int x\cdot\dfrac{\sqrt{1+x^2}}{x^2}dx$$

Let $\sqrt{1+x^2}=u\implies1+x^2=u^2,x\ dx=u \ du$

$$I=\int\dfrac u{u^2-1}udu=1+\dfrac1{u^2-1}=1+\dfrac{1+u+1-u}{(1+u)(1-u)}=?$$