# Graphing $\sin(|x|)$?

I'm confused on how the graph is in both quadrant II and III. If $|x|$ is evaluated first wouldn't all the answers be positive, so that when the range of $|x|$ is plugged into $\sin$ wouldn't the range of $\sin$ be all positive too?

-
Is the sine of a positive number always positive? – Javier Jun 16 '13 at 21:47
You seem to be thinking about $|\sin x|$ and not $\sin |x|$. – Pedro Tamaroff Jun 16 '13 at 21:48

Just draw the graph of $y=\sin x$ for $x \ge 0$, and then reflect it about the $y$-axis. This procedure works for any function of the form $y = g(|x|)$.

-
But why does it work? – Pedro Tamaroff Jun 16 '13 at 21:37
@Peter: It's obvious, at least to you and me. Let's just wait and see whether it's obvious to the OP as well. – TonyK Jun 16 '13 at 21:39

Here's a graph generated by WolframAlpha:

-

No. $\sin(|x|)$ will be positive around zero because of the vertex there. But for $\pi < x<2\pi$, we still have $\sin|x|=\sin x<0$.

-

If |x| is evaluated first wouldn't all the answers be positive

True

so that when the range of |x| is plugged into sin wouldn't the range of sin be all positive too?

What about $x = -\frac{3\pi}{2}$? We have $|x| = \left | - \frac{3\pi}{2} \right | = \frac{3\pi}{2}$, but $\sin(\left | - \frac{3\pi}{2} \right | ) = -1$

The actual plot of both $\sin(x)$ and $\sin(|x|)$ is shown below.

The process described by TonyK works because applying the transformation $y = f(-x)$ to $f(x)$ reflects the curve about the vertical axis. Now consider what the process does to $|x|$ for $x < 0$

-

Recall that: $$|x|= \begin{cases} x & \text{if } x \ge0 \\ -x & \text{if } x < 0\\ \end{cases}$$

Hence, it follows that: $$\sin(|x|)= \begin{cases} \sin(x) & \text{if } x \ge0 \\ \sin(-x) & \text{if } x < 0\\ \end{cases}$$

In other words, the graph remains the same when $x \ge 0$; for the case when $x<0$, you must reflect the graph of the function in the $y$-axis.

-