Tags Math

A function that satisfies f(-x)=f(x) for its entire domain is called an even function (also sometimes referred to as symmetric). Its graph is symmetric w.r.t. the y axis. Some examples of even functions are f(x)=x^2 and f(x)=cos(x):

Example graphs of some even functions

A function that satisfies f(-x)=-f(x) for its entire domain is called an odd function (also sometimes referred to as anti-symmetric). Its graph is flipped to negative across the y axis. Note that all odd functions must have f(0)=0. Some examples of odd functions are f(x)=x^3 and f(x)=sin(x):

Example graphs of some odd functions

Sums of odd and even functions

The sum of two even functions is even. This is trivial to show: say ee(x)=e_1(x)+e_2(x) and both e_1(x) and e_2(x) are even. Then:

\[ee(-x)=e_1(-x)+e_2(-x)=e_1(x)+e_2(x)=ee(x)\]

So ee(x) is also even.

Similarly, the sum of two odd functions is odd. If o_1(x) and o_2(x) are odd, then for oo(x)=o_1(x)+o_2(x):

\[oo(-x)=o_1(-x)+o_2(-x)=-o_1(x)-o_2(x)=-oo(x)\]

Note, however, that we can’t say much about the sum of and odd and an even function. It can be neither even or odd. Consider h(x)=x^2+x^3, for example. Even though it’s a sum of an even function and an odd function, when we check its own property we get:

\[h(-x)=x^2-x^3\]

This certainly isn’t equal to either h(x) or h(-x). Such sums do play a fascinating role later in the post, however.

Products of odd and even functions

It’s similarly easy to show that:

  • The product of two even functions is even
  • The product of two odd functions is odd
  • The product of an odd function and an even function is odd

Let’s prove the last statement as an example. We have oe(x)=o(x)e(x) where e(x) is even and o(x) is odd.

\[oe(-x)=o(-x)e(-x)=\left ( -o(x)\right )e(x)=-o(x)e(x)=-oe(x)\]

Integrating even and odd functions over symmetric intervals

Suppose we’re integrating an even function f(x) over a symmetric interval [-a,a]:

\[\int_{-a}^{a}f(x)dx\]

We can split the integral into two parts:

\[\int_{-a}^{a}f(x)dx=\int_{-a}^{0}f(x)dx+\int_{0}^{a}f(x)dx\]

Let’s focus on the first part, and rewrite it using the fact that f(x) is even, meaning that f(-x)=f(x):

\[\int_{-a}^{0}f(x)dx=\int_{-a}^{0}f(-x)dx\]

Now let’s do a variable substitution, u=-x. We then have to change the integration bounds and also remember to change dx to -du:

\[\int_{-a}^{0}f(x)dx=\int_{-a}^{0}f(-x)dx=\int_{a}^{0}-f(u)du\]

We can now reverse the bounds of the last integral, going from 0 to a instead of from a to 0. Reversing the bounds of a definite integral flips its result, so we get:

\[\int_{-a}^{0}f(x)dx=\int_{0}^{a}f(u)du\]

But u is just a dummy integration variable [1], so we can rename it to x:

\[\int_{-a}^{0}f(x)dx=\int_{0}^{a}f(x)dx\]

In conclusion:

\[\int_{-a}^{a}f(x)dx=\int_{0}^{a}f(x)dx+\int_{0}^{a}f(x)dx=2\int_{0}^{a}f(x)dx\]

Similarly, we can show that for an odd function g(x):

\[\int_{-a}^{a}g(x)dx=0\]

The process is analogous, except that the first half of the integral ends up being the negative of the second half (because g(x) is odd).

These make total sense if we think of definite integrals as the area under the curve of the functions being integrated (and allow for negative areas!)

Every function as a sum of odd and even functions

It turns out that any arbitrary function can be expressed as a sum of an odd function and an even function! While this may initially be surprising, it’s easy to to prove.

Let’s assume that the statement is true, i.e.:

\[f(x)=e(x)+o(x)\]

Where f(x) is an arbitrary function, e(x) is an even function and o(x) is an odd function. We can now manipulate this expression to find out what e(x) and o(x) should be to make it true.

We’ll start by considering f(-x) and using the even-ness and odd-ness of the addends:

\[f(-x)=e(-x)+o(-x)=e(x)-o(x)\]

So:

\[f(x)+f(-x)=e(x)+o(x)+e(x)-o(x)=2e(x)\]

And therefore:

\[e(x)=\frac{f(x)+f(-x)}{2}\]

Note that e(x) is indeed even for any arbitrary f(x).

Similarly:

\[f(x)-f(-x)=e(x)+o(x)-\left ( e(x)-o(x) \right )=2o(x)\]

And therefore:

\[o(x)=\frac{f(x)-f(-x)}{2}\]

This concludes the proof - we’ve found e(x) and o(x) that add up to f(x) \blacksquare.


[1]The notion of a dummy or bound variable in Math is very similar to the one in programming languages. See also alpha-conversion in the context of Lambda Calculus.