I've tried to evaluate $\displaystyle\int_{-r}^r \sqrt{1 + \frac{x^2}{r^2 - x^2}} \; dx$ on my own, but I have encountered a problem I cannot get around.
The indefinite integral $\sqrt{\frac{r^2}{r^2-x^2}} \sqrt{r^2-x^2} \tan ^{-1}\left(\frac{x}{\sqrt{r^2-x^2}}\right) + C$ is undefined at both limits of integration
(the fractions $\frac{r^2}{r^2-r^2} = \frac{r^2}0 = \text{indetermined}$ and $\frac{({-r})^2}{r^2-r^2} = \frac{r^2}0 = \text{indetermined}$)
so I really don't know what to do. Apparently, the value of this integral should be $\pi r.$ Any help would be appreciated.
$$\displaystyle\int_{-r}^r \sqrt{1 + \frac{x^2}{r^2 - x^2}} \; dx=2r\int_{0}^r \frac{1}{\sqrt{r^2-x^2}}dx=2r\,\left. {{\sin }^{-1}}\left( \frac{x}{r} \right) \right|_{0}^{r}=r\pi$$