# Why do we need the absolute value signs when integrating the square of a function?

Why do we need the absolute value signs in the definition of square-integrable function? As seen below:

$$\int_{-\infty}^{\infty} \lvert f(x) \rvert^2 \, dx < \infty$$

• The absolute value signs ensure that the integrand is a non-negative real function. Aug 23, 2014 at 23:22
• The other answers are right, but I'll add that it also looks best (to me) among the options $$\int (f(x))^2\,dx\quad \int |f(x)|^2\,dx\quad \int f(x)^2\,dx\quad \int f^2(x)\,dx$$
– user147263
Aug 23, 2014 at 23:42

Because complex-valued functions are used. The square of a complex number need not be non-negative.

• Why do it need to be non-negative? Just simply a subtraction on the integration, I think. Sep 1, 2014 at 10:20
• Because one is trying to define a metric with properties similar to those of the metric in Euclidean space. Sep 1, 2014 at 17:50

Besides the complex-valued case, I suspect it also has to do with the existence of other $$L^p$$ spaces; Wikipedia gives the general definition as

$$\|f\|_p = \left(\int_S |f|^p \,d\mu\right)^{1/p}$$

Since the absolute value symbols are redundant only for even integral $$p$$, omitting them disrupts the uniformity of the notation without buying a whole lot.

• @BCLC: not really. Tradition would be "we write it that way because we always have". Which might be true, but it's not an alternative way of phrasing this explanation, which is "we write it that way because we consider $2$ to be a special case of $p$, and it would be weird to write the special case differently". Aug 24, 2014 at 15:21