For the purpose of efficient calculations, it is convenient to work with functions having a symmetry. Here we will discuss even functions, whose graphs are symmetric with respect to the #y#-axis, and odd functions, whose graphs are invariant under the #180# degrees rotation about the origin.
Let #f(x)# be a real valued function of a real variable.
We say #f# is even if, for each #x# in the domain of #f#, the number #-x# also belongs to the domain of #f# and
\[ f(-x)=f(x) \]
We say #f# is odd if, for each #x# in the domain of #f#, the number #-x# also belongs to the domain of #f# and
\[ f(-x)=-f(x) \]
Examples of even functions include
- constant functions
- the #\cos# function
- the absolute value #|x|#
- #p(x^2)# for any polynomial #p(x)# with real coefficients #p#
Examples of odd functions include
- the function #\sin#
- the function #\sinh#
- #x^{2n+1}# for #n \in \mathbb{N}#
The value of an odd function at the origin (if defined) is equal to #0#. After all, #f(0) = -f(0)#.
As mentioned above, the graph of an even function is symmetric with respect to the #y#-axis, while the graph of an odd function is invariant under a #180# degrees rotation about the origin. With this observation in mind we can deduce some facts about integrals of odd and even integrable functions defined on intervals like #\ivcc{-a}{a}#, with #a \in \mathbb{R}#.
- If #f# is even, then \(\displaystyle \int_{-a}^a f(x) \dd x = 2\int_{0}^a f(x) \dd x \).
- If #f# is odd, then \(\displaystyle \int_{-a}^a f(x) \dd x = 0 \).
Let #L# be a real number and #f# a real #2L#-periodic function. Then #f# is determined by its values on #\ivcc{-L}{L}#. If #f# is also even or odd, then it is already determined by its values on #\ivcc{0}{L}#.
Conversely, if #g# is given by a function rule on #\ivcc{0}{L}#, then there is a unique even #2L#-periodic extension of #g# to #\mathbb{R}#.
If, in addition, #g(0)=0#, then there also is a unique odd #2L#-periodic extension of #g# to #\mathbb{R}#.
The set of even functions on a given domain forms a real vector space and the same holds for odd functions. A real-valued function #f# need not be even or odd, but it can be decomposed as the sum of an even and an odd function.
Every real-valued function #f# of a single variable #x# can be written uniquely as the sum #f_{\text{e}}(x)+f_{\text{o}}(x)#, where
\[\begin{array}{rcl}\displaystyle f_{\text{e}}(x) &=& \displaystyle\frac{f(x)+f(-x)}{2} \\ \displaystyle f_{\text{o}}(x) &=& \displaystyle\frac{f(x)-f(-x)}{2} \end{array}\]
The fact that the function #f_e(x)# is even follows from the following calculation.
\[f_{\text{e}}(-x) = \displaystyle\frac{f(-x)+f(x)}{2}= \displaystyle\frac{f(x)+f(-x)}{2}=f_e(x)\]
Similarly, the fact that the function #f_{\text{o}}(x)# is odd follows from
\[f_{\text{o}}(-x) = \displaystyle\frac{f(-x)-f(x)}{2}= \displaystyle-\,\frac{f(x)-f(-x)}{2}=f_{\text{o}}(x)\]
As for uniqueness, we first note that the only function that is both even and odd, is the constant function #0#. After all, if #k# is such a function, we have #k(x) = k(-x) = -k(x)#, so #2k(x) = 0#, which implies #k(x)=0#. Now, suppose that #g# is an even function and #h# an odd function such that #f=g+h#. Then #g+h = f = f_{\text{e}}+f_o# implies
\[ f_{\text{e}}-g=h-f_{\text{o}}\]
This function is both even (as can be seen from the left-hand side) and odd (as can be seen from the right-hand side). Thanks to the first observation, we have #f_{\text{e}}-g = h-f_{\text{o}}=0#, and so #g=f_{\text{e}}# and #h = f_{\text{o}}#. This proves the uniqueness of the decomposition of #f# as the sum of an even and an odd function.
In terms of a vector space #P# of functions, the result can be formulated as #P# being the direct sum of #P_{\text{e}}#, the subspace of even functions of #P# and #P_{\text{o}}#, the subspace of odd functions of #P#.
Another property that will be useful in computations is the following.
- The products of two even and of two odd functions are even.
- The product of an even and an odd function is odd.
1. Assume #f=g\cdot h# with #f# and #g# both even. Then
\[ f(-x)=g(-x)\cdot h(-x)=g(x)\cdot h(x)=f(x)\]
If instead #f# and #g# are both odd, then
\[ f(-x)=g(-x)\cdot h(-x)=-g(x)\cdot (-h(x))=g(x)\cdot h(x)=f(x)\]
2. Assume that #g# is odd and #h# is even. Then
\[ f(-x)=g(-x)\cdot h(-x)=(-g(x))\cdot h(x)=-(g(x)\cdot h(x))=-f(x) \]
Consider the real function #f# that is defined by the rule #f(x) = -\sin ^2\left(x+{{\pi}\over{8}}\right)#. Its graph is drawn below.
Is the function even, odd, or periodic?
#f# is periodic
The graph shows that the function repeats itself. This means that the function is periodic.