Integrating $\frac{1}{\sqrt{x^2+1}}$ with the help of a variable change The question I am faced with is as follows:

With the help of a variable change $\sqrt{x^2+1}=x+t$, demonstrate that over $\mathbb{R}$, with $k\in \mathbb{R}$
$$\int{\frac{1}{\sqrt{x^2+1}} \ \mathrm{d}}x=\ln(x+\sqrt{x^2+1})+k$$

Now what I did was something different, I built a right triangle with an angle $\alpha$ (its adjacent side being $1$ and opposite side being $x$), and with a hypotenuse of $\sqrt{x^2+1}$.
Thus, $x=\tan{\alpha}$ and $\mathrm{d}x=\sec^2{\alpha} \ \mathrm{d}\alpha$. So we have:
$$\int{\frac{1}{\sqrt{x^2+1}} \ \mathrm{d}}x=\int{\cos{\alpha} \ \mathrm{d}x}=\int{\frac{\sec^2{\alpha}}{\sec{\alpha}}  \ \mathrm{d}\alpha}=\int{\sec{\alpha}  \ \mathrm{d}\alpha}$$
I know how to integrate $\sec{\alpha} \ \mathrm{d}\alpha$, and after replacing $\alpha$ with the initial value of $x$, I indeed end up with the result $\ln(x+\sqrt{x^2+1})+k$.
But how would one end up with the same result using the given hint? Can someone help me out? Thanks.

With $\sqrt{x^2+1}=t-x$ (slightly better) you have $x^2+1=t^2-2tx+x^2$, so
$$
x=\frac{t^2-1}{2t}=\frac{t}{2}-\frac{1}{2t}
$$
so also
$$
dx=\frac{1}{2}\left(1+\frac{1}{t^2}\right)\,dt=\frac{t^2+1}{2t^2}\,dt
$$
and
$$
\sqrt{x^2+1}=t-x=t-\frac{t}{2}+\frac{1}{2t}=\frac{t^2+1}{2t}
$$
Then the integral becomes
$$
\int\frac{2t}{t^2+1}\frac{t^2+1}{2t^2}\,dt
$$
