As in this question, where putting in the value of infinity makes it unsolvable.
$$\int_0^\infty \frac{1}{\sqrt{x} (x+1)} \, dx$$
so I wrote this integral as an integral with limits 0 to t where t tends to infinity after that I substituted, put x= k^2 and thus the integral became (integral from 0 to infinity of)2/(1+k^2) which came out to be arctan(k) where limits are 0 to infinity. So then it should be arctanx - arctan0 where x tends to infinity?
Yes: the limit of $\arctan{a}$ as $a \to \infty$ is $\pi/2$.
There are lots of ways to evaluate the integral, but we can immediately see that it is convergent because $x^{-1/2}$ is an integrable singularity at $x=0$ and the integrand behaves as $x^{-3/2}$ as $x \to \infty$.
The value of the integral is $\pi$ because
$$\int_0^{\infty} \frac{dx}{\sqrt{x}(x+1)} = 2 \int_0^{\infty} \frac{du}{1+u^2} = 2 \lim_{a \to \infty} \left [\arctan{a}-\arctan{0} \right ] = 2 \frac{\pi}{2} = \pi$$
There are other ways to show this, i.e., residue theorem.