# Absolute Value Function

Domain of the function $f(x)=|x|$ is the set of all real numbers, $\mathbb{R}$ and the range is the non-negative subset of $\mathbb{R}$, or the set of all real numbers greater than or equal to 0.

If $x \in\mathbb{R}$, the absolute value of $x$ is denoted by $|x|$ and defined as:

$f(x)= \begin{cases} x \textrm{, if } x>0 \\ 0 \textrm{, if } x=0 \\ -x \textrm{, if } x<0 \end{cases}$

### Graph of absolute value function

How does the graph of $\ f(x)= |x|$ look like?

Let’s take a look at what happens with numbers from $-3$ to $3$. The graph is V-shaped, with the vertex in the point $(0,0$) and is symmetric with respect to the y-axis. The axis of symmetry, in this case the line $x=0$ or y-axis, is the line that divides the graph into two congruent halves. To translate the absolute value function $f(x)= |x|$ vertically, one can use the function $g(x)=f(x)+c$, where $c$ is a constant. If $c>0$ than the graph of $f(x)$ is transleted for $c$ unites up and if $c<0$ than the graph of $f(x)$ is translated $c$ unites down, in both cases the result is the graph of $g(x)$. This translation is sometimes called the vertical shift.

For example, $f(x)=|x|$, $g(x)=|x|+3$ and $h(x)=|x|-2$. To translate the absolute value function $f(x)= |x|$ horizontally, one can use the compostion of functions $(f\circ g)(x)$ where $g(x)=x+c$, where $c$ is a constant. If $c>0$ than the graph of $f(x)$ is transleted for $c$ unites left and if $c<0$ than the graph of $f(x)$ is translated $c$ unites right, in both cases the result is the graph of $(f\circ g)(x)$. This translation is sometimes called the horizontal shift.

For example, $f(x)=|x|$, $g(x)=|x+3|$ and $h(x)=|x-2|$. The stretching or compressing of the absolute value function $f(x)=|x|$ is defined by the function $g(x)=c|x|$ where $c$ is a constant. If $c>0$ the graph opens up and if $c<0$ opens down. If $0<c<1$ then the graph is compressed, and if $c>1$ it is stretched.

For example, $f(x)=|x|$, $g(x)=-1|x|$, $h(x)=2|x|$ and $w(x)=\frac{1}{3}|x|$. In the next example we will graphically review the difference between $|a+b|$ and $\ |a| + |b|$.

We’ll compare two functions: $\ f(x) = |x – 2|$ and $\ g(x) = |x| – 2$. Parts of two different functions overlap. Why? The constant inside the absolute value moves the whole graph to the right if that constant is negative and to the left if it is positive. But a constant outside of the absolute value, such as the $-2$ in the function $g(x)$, the graph will move upward if that value is positive, and downward if it’s negative. The $x$ coordinate of the vertex (the point in which the two lines connect, the tip of the graph) is exactly the value by which the graph is shifted left or right, and the $y$ coordinate is the value by which the graph is shifted up or down. If $f(x)=a|x-b|+c$, where $x$ is the variable and $a$,$b$ and $c$ are constants, then:

• The vertex of the graph is $(b,c)$.
• The domain of the graph is set of all real numbers and the range is $f(x)≥ c$ when $a>0$.
• The domain of the graph is set of all real numbers and the range is $f(x)≤ c$ when $a<0$.
• The axis of symmetry is $x=b$.
• It opens up if $a>0$ and opens down if $a<0$.
• The graph $f(x)=|x|$ can be translated $b$ units horizontally and $c$ units vertically to get the graph of $g(x)=a|x−b|$.
• The graph $f(x)=a|x|$ is wider than the graph of $g(x)=|x|$ if  $|a|<1|$ and narrower if $|a|>1$.