# What is the domain and range of y = cos|x|?

Jul 13, 2016

The domain is $\left(- \infty , \infty\right)$ and the range is $\left[- 1 , 1\right]$.

#### Explanation:

This is a fun problem because we are presented with a modified version of the $\cos \left(x\right)$ function, but as we will see, it is, in fact, not in any way different from the standard version.

$\cos | x |$ is the $\cos \left(x\right)$ function with the absolute value of $x$ input into it. What this means is that if $x \ge 0$ then it is replaced with $x$. If $x < 0$ then it is replaced with $- x$.

This means that our function is actually a two part piecewise function:
$f \left(x\right) = \left\{\begin{matrix}\cos | x | = \cos \left(x\right) \mathmr{if} x \ge 0 \\ \cos | x | = \cos \left(- x\right) \mathmr{if} x < 0\end{matrix}\right.$

However, cos is also an even function. For an even function, $f \left(- x\right) = f \left(x\right)$.

This means that:
f(x) = {(cos|x| = cos(x) = cos(x) if x >= 0), (cos|x| = cos(-x) = cos(x) if x < 0) :}

So $\cos | x | = \cos \left(x\right)$.

The domain and range will be precisely the same as for the original function, that is: $x$ can be all real numbers, and $y$ will range from $- 1$ to $1$.