I was wondering what the graph of the following function is:
f(x) = 1(x+pi) -2*1(x)+1(x-pi)
where 1(x)=0 if x < 0
and 1(x)=1 if x >= 0
it's really easy using the definition of the step function we can deduce that:
$\displaystyle
\begin{gathered}
1\left( {x + \pi } \right) = \left\{ \begin{gathered}
0\quad x < - \pi \hfill \\
1\quad x \geqslant - \pi \hfill \\
\end{gathered} \right. \hfill \\
1\left( {x - \pi } \right) = \left\{ \begin{gathered}
0\quad x < \pi \hfill \\
1\quad x \geqslant \pi \hfill \\
\end{gathered} \right. \hfill \\
\end{gathered}
$
now all you have to do is combine the functions on each segment and you'll get:
$\displaystyle
f(x) = \left\{ \begin{gathered}
0\quad \;x \notin \left( { - \pi ,\pi } \right] \hfill \\
1\quad \; - \pi \leqslant x < 0 \hfill \\
- 1\quad 0 \leqslant x < \pi \hfill \\
\end{gathered} \right.$