Evaluating an integral with a division by $0$ issue Problem:
Evaluate the following integral.
$$ \int_{0}^{4} \frac{dx}{\sqrt{4-x}} $$
Answer:
Let $u = 4 - x$. We have:
\begin{align*}
du &= -dx \\
\int_{0}^{4} \frac{dx}{\sqrt{4-x}} &= \int_{4}^{0} \frac{- du}{\sqrt{u}} \\
\int_{0}^{4} \frac{dx}{\sqrt{4-x}} &= \int_{0}^{4} \frac{- du}{\sqrt{u}} \\
\int_{0}^{4} \frac{dx}{\sqrt{4-x}} &= \int_{0}^{4}  u^{-\frac{1}{2}} \,\, du \\
\int_{0}^{4} \frac{dx}{\sqrt{4-x}} &= 2u^{ \frac{1}{2} } \Big|_0^4 = 2(4)^{ \frac{1}{2} } - 2(0)^{ \frac{1}{2} } \\
\int_{0}^{4} \frac{dx}{\sqrt{4-x}} &= 2(2) - 0 \\
\int_{0}^{4} \frac{dx}{\sqrt{4-x}} &= 4
\end{align*}
My answer matches the back of the book. However, the original function was not defined
at $x = 4$ (due to a divide by $0$ issue ) and I did not do anything special for this case. Should I have? Is my solution correct?
 A: Your solution is fine, if a little informal.
If you want to evaluate it more formally, you need to recognize the integral as an improper integral, so the first step would become $$\int_0^4 \frac{dx}{\sqrt{4-x}} := \lim_{t\to4 {}-} \int_0^t \frac{dx}{\sqrt{4-x}}$$ but then the rest of the solution is almost identical to yours (with an extra limit hanging around until the end), so it doesn't add much.
A: To be thorough for improper integrals we would need to calculate $\displaystyle \lim\limits_{\epsilon\to 0}\int_\epsilon^4 \frac{\mathrm{d}u}{\sqrt{u}}$ and find that it has effectively a limit since $2\sqrt{4}-2\sqrt{\epsilon}\to 4-0=4$.
But we generally admit a certain numbers of results as "well known", such as $\int x^{-a}\,\mathrm{d}x$ is convergent in $0$ for $a<1$ and go directly for the final result without bothering with the improper character of the integral.

Yet, it is also possible to show that the improper character is just superficial. On the considered open interval the change of variable $u=\sqrt{4-x}$ is a diffeomoprhism and the integral is reduced to $\displaystyle 2\int_0^2 \mathrm{d}u$ which is now regular.
Prove convergence of improper integral using change of variable.
A: Indeed you are correct - the function "blows up" at ${x=4}$. However - a function can blow up to infinity at one of the endpoints like this and actually have finite area. In order to rigorously calculate the integral, you should use limits:
$${\int_{0}^{4}\frac{1}{\sqrt{4-x}}dx=\lim_{t\rightarrow 4^-}\int_{0}^{t}\frac{1}{\sqrt{4-x}}dx}$$
This is how we deal with improper integrals in general (that is, integrals with a discontinuity at a point). You simply take a limit. That being said, as someone else has pointed out - your solution works fine. You can read more about them here: https://en.wikipedia.org/wiki/Improper_integral
