Surface Area of cylinder based upon improper integral $4 \int_{0}^{r} \int_{0}^{h} \frac{r}{\sqrt{r^2-x^2}} dy \ dx $ For some reason, I keep on messing up this integral although it should be easy:
$$4 \int_{0}^{r} \int_{0}^{h} \frac{r}{\sqrt{r^2-x^2}} dy \ dx $$
The inside of the iterated integral just becomes $h$ since there are no $y$'s and it's just evaluated from $y=h$ and $h=0$.
And so we'd get $ 4 h \int_{0}^{r} \frac{r}{\sqrt{r^2-x^2}} dx$ and here it's an improper integral because when $x=r$ we'd have division by zero.
From this integral, I know there should be an $\tan^{-1}\left(x\right)$ somewhere but keep on losing my place between all the variables
 A: Are you trying to calculate the curved surface area? Because your formula is dimensionally wrong if it's meant to calculate the volume. As for the integral,
Substitute $x = r\sin\theta \implies \mathrm dx = r\cos\theta ~\mathrm d\theta$
$$\begin{align} \int_0^r \frac{r}{\sqrt{r^2-x^2}}\mathrm dx &\ = r\int_0^{\frac{\pi}{2}} \frac{1}{\sqrt{r^2-r^2\sin^2\theta}}r\cos\theta ~\mathrm d\theta \\
&\ = r^2 \int_0^{\frac{\pi}{2}} \frac{\cos\theta}{|r\cos\theta|} \mathrm d\theta\end{align} $$
In $(0, \frac{\pi}{2})$, $\cos\theta$ is always positive
$$ \int_0^r \frac{r}{\sqrt{r^2-x^2}}\mathrm dx = r\int_0^{\frac{\pi}{2}} \mathrm d\theta = \frac{\pi r}{2}$$

EDIT: The more rigorous way to calculate the improper integral
The function $ f(x) = \dfrac{r}{\sqrt{r^2-x^2}}$ approaches infinity as $x$ approaches $r$
$$ \int_0^r f(x)~\mathrm dx = \int_{0\le x<r}f(x)~\mathrm dx = \lim_{t \to r^-} \int_0^t f(x)~\mathrm dx$$
Now, calculate the definite integral for a general $t$ using an approach similar to the previous one, and find the limit of the integral as $t$ approaches $r$ from the left, i.e. $t \to r^-$
$$\int_0^t f(x)~\mathrm dx = r \sin^{-1} \frac{t}{r} $$
$$\lim_{t \to r^-} \int_0^t f(x)~\mathrm dx = \lim_{t \to r^-}r \sin^{-1} \frac{t}{r} = r \lim_{t \to r^-} \sin^{-1} \frac{t}{r} = \frac{\pi r}{2} $$
This gives us the same answer as before. When the integrand becomes unbounded near the limits of integration but is bounded everywhere within  the interval, the first method (direct substitution of limits) usually works. The second method is a more general way to evaluate an improper integral.
