# How do take the inverse of an absolute value?

## f(x)=abs(x-2

Oct 23, 2016

If you don't care if the inverse is a function, then ${f}^{- 1} \left(x\right) = 2 \pm x$, with the restriction $x \ge 0$

If you want the inverse to be a function, you must consider a restricted interval initially.

#### Explanation:

If $f$ is a function which maps $x$ to $y$, then ${f}^{- 1}$ is a function that maps $y$ to $x$. However, if $f \left(x\right)$ maps more than one $x$ value to a single $y$, then there is no way to know which $x$ ${f}^{- 1}$ should map $y$ to.

If you don't care about about the inverse being a function, then we can just consider all the cases, similar to how we invert $y = {x}^{2}$ by swapping $y$ and $x$ and then solving for $y$: $x = {y}^{2} \implies y = \pm \sqrt{x}$. Doing so for $f \left(x\right) = | 2 - x |$, we get

$x = | 2 - y |$
$\implies x = \pm \left(2 - y\right)$
$\implies \pm x = 2 - y$
$\implies y = 2 \pm x$

So the inverse is $y = 2 \pm x$. Note that as $f \left(x\right) \ge 0$ in the initial function, we must have $x \ge 0$ for the inverse. This gives us the graph which is a reflection of $y = | 2 - x |$ across the line $y = x$, as we would expect .

If we want to have the inverse as a function, then we must consider a restriction of $| x - 2 |$ to a domain in which every $x$ value is mapped to a distinct $y$ value (a function with this property is called one-to-one).

Again, this is analogous to finding the inverse of $g \left(x\right) = {x}^{2}$. If we add the initial restriction $x \le 0$, then we get $x = - \sqrt{{x}^{2}} \implies {g}^{- 1} \left(x\right) = - \sqrt{x}$. If we add the initial restriction $x \ge 0$, then we get $x = \sqrt{{x}^{2}} \implies {g}^{- 1} \left(x\right) = \sqrt{x}$. Notice that we get a different inverse function depending on how we restrict the domain of $g \left(x\right)$.

Because $f \left(x\right)$ is defined as

$f \left(x\right) = \left\{\begin{matrix}- \left(x - 2\right) \mathmr{if} x - 2 \le 0 \\ x - 2 \mathmr{if} x - 2 \ge 0\end{matrix}\right.$

$\implies f \left(x\right) = \left\{\begin{matrix}2 - x \mathmr{if} x \le 2 \\ x - 2 \mathmr{if} x \ge 2\end{matrix}\right.$

natural restrictions would be considering $f \left(x\right) = | 2 - x | , x \le 2$ or $f \left(x\right) = | 2 - x | , x \ge 2$. Then we are just finding the inverse of $2 - x$ or $x - 2$ on the restricted interval.