# Graphs for mod functions

Can someone please teach me how to obtain graphs for the following types of functions:

1. $2+3|x-1|$

2. $|x-1|+|x|+|x+1|$

3. $|x-1|-|x|-|x+1|$

4. $|x-1|^2$

Thanks.

• Do you want to know how to draw them with your hand or with a computer? Commented Aug 12, 2014 at 9:53
• Create a table of values Commented Aug 12, 2014 at 9:53
• Hint: keep in mind that $|f(y)|=f(y)$ if $f>0$, while $|f(y)|=-f(y)$ if $f<0$. Commented Aug 12, 2014 at 9:58
• @Alizter: well, the first three functions are piecewise linear, so that only a finite number of values are necessary to obtain an exact drawing. If the OP is asked to draw them by hand, he should argue that for the first ones he can obtain an exact graph, while he can only obtain approximations for the last one. Commented Aug 12, 2014 at 10:00

You should determine the critical points of the functions meanly values that make zero the absolute value. Then you get piecewise functions. For example for the first function $x=1$ is the critical point. Therefore your piecewise function will be as follows. $$f(x)=2+3|x-1|=\begin{cases} 2+3x-3 & \textrm{for}\: x\geq1\\ 2+3-3x & \textrm{for}\: x<1 \end{cases}$$ Now it is easy to plot the function.

Edit: For third one you have three critical points which are $-1,0,1$. So you have to investigate your function for intervals $(-\infty,-1]$, $(-1,0]$, $(0,1)$, $[1,+\infty)$, after that you can get the following piecewise function. $$f(x)=|x-1|-|x|-|x+1|=\begin{cases} -x-2 & \textrm{for}\: x\geq1\\ -3x & \textrm{for}\:0<x<1\\ -x & \textrm{for}\:-1<x\leq0\\ x+2 & \textrm{for}\: x\leq-1 \end{cases}$$

• So can you please solve the third one for me??? Commented Aug 12, 2014 at 10:22
• I Edited my post for third one.
– Ömer
Commented Aug 12, 2014 at 10:45

Well first of all determine how $|x|$ looks.

• $|x-d|$ is the same as $|x|$ but just shifted $d$ units in positive $x$-direction.
• $a|x|+b$ is the same as $|x|$ but shifted by $b$ in positive $y$-direction and streteched by factor $b$ in $y$ direction.

Using these 'rules' makes it way easier than 'stupidly' calculating values.