It is perhaps relevant to consider here the notion of Improper integral.
For the case of an open interval $(a,b)$, with $a,b \in \mathbb{R}$, consider
$$
\int_a^b {f(x)\,dx} = \mathop {\lim }\limits_{\scriptstyle c \to a^ +\atop
\scriptstyle d \to b^ -} \int_c^d {f(x)\,dx} .
$$
Example: Suppose that $f$ is defined on $(0,1)$ by
$$
f(x) = \frac{1}{{\sqrt x \sqrt {1 - x} }}.
$$
Note that $f$ is unbounded near $0^+$ and near $1^-$. Nevertheless, the integral $\int_0^1 {f(x)\,dx}$ exists as an improper integral. To evaluate it, first note that the antiderivative of $f$ is given by
$$
\int {f(x)\,dx} = - 2\arctan \bigg(\sqrt {\frac{1-x}{x}} \bigg) + C.
$$
Hence, by the fundamental theorem of calculus,
$$
\int_c^d {f(x)\,dx} = - 2\arctan \bigg(\sqrt {\frac{1-x}{x}} \bigg) \bigg|_c^d ,
$$
for any $c$ and $d$ such that $0 < c < d < 1$.
Now,
$$
\mathop {\lim }\limits_{d \to 1^ - } \bigg[ - 2\arctan \bigg(\sqrt {\frac{1-x}{x}} \bigg)\bigg] = -2 \arctan (\sqrt{0}) = 0
$$
(using that $\arctan$ is continuous at $0$)
and
$$
\mathop {\lim }\limits_{c \to 0^ + } \bigg[ - 2\arctan \bigg(\sqrt {\frac{1-x}{x}} \bigg)\bigg] = - 2\mathop {\lim }\limits_{t \to \infty } \arctan (t) = - 2\frac{\pi }{2} = - \pi
$$
(using that $t: = \sqrt {\frac{{1 - x}}{x}} \to \infty $ as $x \to 0^+$). Thus
$$
\int_0^1 {f(x)\,dx} = \mathop {\lim }\limits_{\scriptstyle c \to 0^ + \atop
\scriptstyle d \to 1^ -} \int_c^d {f(x)\,dx} = 0 - ( - \pi ) = \pi .
$$