Can I take integral of a domain my function is not well defined? Am I allowed to write the integral in the domain $(0,4)$: $\displaystyle \int_0^4 \left(\frac{2}{x^{0.5}}-1\right) \,\mathrm{d}x$ when I know the antiderivative of the function is $[4x^{0.5}-x+c]_0^4$ ? Because the antiderivative is real valued for both $4$ and $0$, but the function I am taking the integral of is not real valued at $0$.
 A: Yes, you can do this. This is what is called an improper integral. In order to viably do this, we rewrite the integral as a limit.
$$\lim_{a\to 0^+} \int_{a}^{4} \left(\frac{2}{x^{0.5}} - 1\right) ~{\rm d} x$$
Since the inside function isn't defined at $0$, we need to take the limit from the positive side of the function. Continuing this by evaluating the integral gives us
$$\lim_{a\to 0^+} \left[4\sqrt{x} - x\right]_{a}^{4} = \lim_{a\to 0^+} \left(4\sqrt{4} - 4 - 4\sqrt{a}+a\right)$$
Since this new function is defined at $0$, we may simply plug it in.
$$4\sqrt{4} - 4 - 4\sqrt{0} + 0 = 8 - 4 = 4$$
Also, improper integrals can be used with limits to infinity. For example:
$$\int_{-\infty}^x e^t ~{\rm d}t = \lim_{a\to -\infty} \int_a^x e^t ~{\rm d}t = \lim_{a\to -\infty} e^x - e^a = e^x$$
A: Yes it is possible.
Method: Limit definition of integral
Let $f(x)=2x^{-1/2}-1$. Since the interval is $[0,4]$ we can divide it into $n$ intervals, each with width $$\Delta x=\frac4n.$$ Now the right endpoint of the $i$th subinterval is $x_i^*=4i/n$ so we have that $$\sum_{i=1}^n f(x_i^*)\Delta x=\sum_{i=1}^n \left(\frac2{\sqrt{\frac{4i}n}}-1\right)\cdot\frac4n=\sum_{i=1}^n\left(\frac4{\sqrt{in}}-\frac4n\right)$$ 
Hence $$\int_0^4\left(\frac2{\sqrt x}-1\right)\,dx=\lim_{n\to\infty}\sum_{i=1}^n f(x_i^*)\Delta x=\lim_{n\to\infty}\left(4\sum_{i=1}^n\left(\frac1{\sqrt{in}}\right)-4\right)=4\cdot2-4=\color{red}4$$ using the Puiseux series. 
