I am reading through this physics book and have trouble understanding how they integrated one of the problems the conditions are
Conditions: // ignoring the constant for simplicity
$$r = \sqrt{x^2 + R^2}$$ $$\sin(\theta) = \dfrac{R}{\sqrt{x^2 + R^2}}$$
Integration:
$$\int \dfrac{R}{(x^2 + R^2)^{3/2}}\,\mathrm dx$$
and the result is: $$\dfrac{x}{R(x^2 + R^2)^{1/2}}$$
Could someone please explain to me how the integration part was done in more detail?
Substitute $x = R\tan \theta$ then $dx = R \sec^2 \theta d\theta$ and $x^2+R^2 = R^2(\tan^2\theta + 1) = R^2 \sec^2 \theta$. Note as well that $x = R\tan \theta$ implies that $\sin \theta = \dfrac{x}{\sqrt{x^2+R^2}}$. $$ \int \frac{Rdx}{\left(x^2+R^2\right)^{3/2}} = \int \frac{R^2 \sec^2 \theta d\theta}{\left(R^2 \sec^2 \theta\right)^{3/2}} = \int \frac{d\theta}{R \sec \theta} = \frac{1}{R} \int \cos \theta d\theta = \frac{\sin \theta}{R} = \frac{x}{R\sqrt{x^2+R^2}} $$