# How to write $\space f(x)=\frac{|2-x|+x}{|x|} \space$ by pieces?

Let $\space f(x)=\frac{|2-x|+x}{|x|} \space$. How can it be written by pieces?

I've tried to find the zeros of $f$, by solving $f(x)=0$. But it seems that the function don't have real zeros. I stayed without knowing what is the transition point in the piecewise function.

Even without the transition poin, I tried to figure it out the two pieces.

In the original expression, I put the minus signal in evidence, and the expression of $f$ stayed like this:

$\space f(x)=\frac{|-(x-2)|+x}{|x|} \space$

To the right of the transition point would be like this $\frac{-(x-2)+x}{x}=\frac{2}{x} \space$.To the left would be like this $\frac{x-2+x}{-x}=\frac{2x-2}{-x}$.

But the graphs don't seem to be like the original one.

Can you explain me how to write in pieces this function?

-
What you want to check is not whether $f(x)=0$ but rather when the terms inside the $|\cdot|$ become zero. So in this case $|x|=0$ and $|2-x|=0$ will give you the points that are non-continuous. See anons answer for the actual piecewise function. – example May 1 '12 at 9:51
There was an edition mistake.That is already correct – João May 1 '12 at 9:54

First, split into two cases: $x<0$ and $x>0$. We get

$$f(x)=\begin{cases} \frac{|2-x|+x}{x} & x> 0 \\ \\ \frac{|2-x|+x}{-x} & x<0. \end{cases}$$

For $x<0$, note $2-x$ is always positive. Otherwise, for $x\in(0,\infty)$, $2-x$ is nonnegative for $x\le 2$ and negative for $x>2$. So we can split our first case into $x>2$ and $0< x\le 2$. We obtain

$$f(x)=\begin{cases} \frac{(x-2)+x}{x} & x>2 \\ \\ \\ \frac{(2-x)+x}{x} & 0< x\le 2 \\ \\ \\ \frac{(2-x)+x}{-x} & x<0. \end{cases}$$

-
i think that,this function has not such x value ,for wich it is equal to 0 right yes? – dato datuashvili May 1 '12 at 9:50
@dato: That is correct, $f$ has no zeros. Though $y=0$ is a horizontal asymptote on the left. – anon May 1 '12 at 9:52
yes that is right – dato datuashvili May 1 '12 at 9:53
Thanks for the detail explanation. – João May 1 '12 at 10:06
you are welcome @João good lucks – dato datuashvili May 1 '12 at 11:01

from this, it is clear that x=0 is not defined point of this function,also you should consider different situations, for example recall that for |x|,if x<0 then $|x]=-x$ ,so you need consider

1.x<0

2. x>2
3 0<=x<=2


for each values of x,function will have different forms

-