Welcome to our community

Be a part of something great, join today!

[SOLVED] make a function even and odd

dwsmith

Well-known member
Feb 1, 2012
1,673
There was a question but I figured it out.
$$
g(\theta) = \begin{cases}
\theta, & 0\leq\theta\leq\pi\\
\theta+\pi, & -\pi\leq\theta < 0
\end{cases}
$$
So $g_e=\frac{g(\theta)+g(-\theta)}{2}$ and $g_o=\frac{g(\theta)-g(-\theta)}{2}$
\begin{alignat}{3}
g_e & = & \frac{\begin{cases}
\theta, & 0\leq\theta\leq\pi\\
\theta+\pi, & -\pi\leq\theta < 0
\end{cases}+\begin{cases}
-\theta, & 0\leq -\theta\leq\pi\\
-\theta+\pi, & -\pi\leq -\theta < 0
\end{cases}}{2}\\
& = & \frac{\begin{cases}
\theta, & 0\leq\theta\leq\pi\\
\theta+\pi, & -\pi\leq\theta < 0
\end{cases}+\begin{cases}
-\theta, & 0\geq \theta\geq -\pi\\
-\theta+\pi, & \pi\geq \theta > 0
\end{cases}}{2}\\
& = & \frac{\pi}{2}
\end{alignat}
For $g_o$, we have
\begin{alignat*}{3}
g_o & = & \frac{\begin{cases}
\theta, & 0\leq\theta\leq\pi\\
\theta + \pi, & -\pi\leq\theta < 0
\end{cases} -
\begin{cases}
-\theta, & 0\leq -\theta\leq\pi\\
-\theta + \pi, & -\pi\leq -\theta < 0
\end{cases}}{2}\\
& = & \frac{\begin{cases}
\theta, & 0\leq\theta\leq\pi\\
\theta + \pi, & -\pi\leq\theta < 0
\end{cases} +
\begin{cases}
\theta, & 0\geq \theta\geq -\pi\\
\theta - \pi, & \pi\geq \theta > 0
\end{cases}}{2}\\
& = & \theta +
\begin{cases} -\frac{\pi}{2}, & 0\leq\theta\leq\pi\\
\frac{\pi}{2}, & -\pi\leq\theta < 0
\end{cases}
\end{alignat*}
 

HallsofIvy

Well-known member
MHB Math Helper
Jan 29, 2012
1,151
It should be emphasized that you are NOT "making" the function "even" or "odd", you are separating it into its "even" and "odd' parts.

For any function, f(x), [tex]f_e(x)=\frac{f(x)+ f(-x)}{2}[/tex] is an even function, [tex]f_o(x)= \frac{f(x)- f(-x)}{2}[/tex] is an odd function, and [tex]f(x)= f_e(x)+ f_o(x)[/tex]