Quick question about integration of a piecewise defined function

109 Views Asked by At

I have the following "quick" question about the piecewise function integration:

Say, I have to find $\int\limits_0^{1}f(x)d x$, with $f(x)$ being piecewisely defined on $\mathbb{R}$ as follows: $$ f(x) = \left\{\begin{matrix} \; 0&,&\text{ if } x\in (-\infty; 0] \cup (1; +\infty)\\ \; p(x)&,&\text{ if } x \in (0; 1]. \\ \end{matrix}\right. $$

Then, my question is, what is the mathematically correct way to find the above interal?

Is it: $$ \int\limits_0^{1}f(x)dx = \int\limits_0^{1}p(x)d x = P(x)\huge |_{\normalsize 0}^{\normalsize 1} \normalsize = P(1) - P(0) = \mathcal{P}_0.$$ Or is it: $$\int\limits_0^{1}f(x)dx = \int\limits_0^{\bullet}0dx + \int\limits_{\bullet}^{1}p(x)dx = 0\huge|_{\normalsize 0}\normalsize + P(x)\huge |^{\normalsize 1}\normalsize = P(1) = \mathcal{P}_1.$$

I know, my question may seem a bit stupid, but yet, I'm still wondering which of the above options is correct.

Thank you in advance!