# Is the square of a function always positive

1. Feb 9, 2012

### homegrown898

I'm curious, is the square of any function always positive?

It seems obvious that it's always positive because if you have a function (F), an input (x) and an output (y) then you have y = F(x)

And if you square the function then (F(x))2 = y2 which means that every value in the range is now positive.

Is this always true?

Also, if you can also answer this that would be great, if I have two positive functions and I am taking the definite integral of the product of those two functions, will I always get a number greater than or equal to 0?

2. Feb 9, 2012

### HallsofIvy

Staff Emeritus
Yes, what you said is correct if you are careful with your qualifiers. If f is a real valued function, then $f(x)^2$ is non-negative (not, strictly speaking, "always positive"). That is because, for any x, f(x) is just a real number and the square of any real number is non-negative. (Note the difference between the function "f", and the real number, "f(x)", which is a number.)

If, for all x in [a, b], both f(x) and g(x) are greater than or equal to 0, then $\int_a^b f(x)g(x)dx\ge 0$.