# 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. – David H Aug 23 '14 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 '14 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. – Ooker Sep 1 '14 at 10:20
• Because one is trying to define a metric with properties similar to those of the metric in Euclidean space. – Michael Hardy Sep 1 '14 at 17:50

Besides the complex-valued case, I suspect it also has to do with the existence of other Lp 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.

• In other words, tradition? – BCLC Aug 24 '14 at 3:56
• @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". – Steve Jessop Aug 24 '14 at 15:21