I am trying to find the inverse function for the given function f(x) = 3x - |x| + |x - 2|. I have already found that the inverse function can be expressed as the piecewise function f^{-1}(x) = \begin{cases} \frac{x - 2}{3} & \text{if } x < 2 \\ x - 2 & \text{if } 2 \leq x < 4 \\ \frac{x + 2}{3} & \text{if } x \geq 4 \end{cases} ] but I am struggling to see the method for writing it with absolute values instead. The answer key provides the inverse as f^{-1}(x) = 1/3(x + |x - 2| - |x - 4|). These are clearly the same, which can be seen by graphing, but I can't see a method for how one would reduce the piecewise answer to this simpler form. Is there a standard method, does it require some creativity, or do you just have to get lucky and see it?
-
I don't get it. You want a the inverse as a function that uses absolute values, and don't use piecewise functions? Or do you mean "don't use piecewise functions other than the absolute value"? – jjagmath Mar 24 '24 at 21:44
-
@jjagmath I believe they want a simple expression for the function in terms of absolute values rather than being itself expressed as a piecewise linear function. – Jam Mar 24 '24 at 21:45
-
See Piecewise linear function and absolute value – Jam Mar 24 '24 at 21:53
1 Answers
If you already know a function $g:\mathbb R\to\mathbb R$ is continuous and (finite-pieces) piecewise linear. You can always have the formula $g(x)=a_0x+\sum_{k=1}^na_k|x-b_k|+a_{n+1}$ where $b_1<\dots<b_n$ are the points where $g $ is non-differentiable. By solving a linear system $a_0,\dots,a_{n+1}$ can be determined.
Update: Although it is duplicated with this post and mvw's answer there explained how to get $a_k$. Here is my reformulation.
Notice that $g$ is completely determined by $g(b_1),\dots,g(b_n)$ and $g'(b_1-)=\lim_{x\to-\infty}\frac{g(x)}x,g'(b_n+)=\lim_{x\to+\infty}\frac{g(x)}x$. By plugging their values we get the linear system.
Alternatively, we have $g'(b_j+)-g'(b_j-)=2a_j$ for $1\le j\le n$. Note that $g'(b_1-)=a_0-a_1-\dots-a_n$ and $g'(b_n+)=a_0+\dots+a_n$ which gives $2a_n=g'(b_1-)+g'(b_n+)$. Lastly $a_{n+1}=g(0)-\sum_{k=1}^na_k|b_k|$.
Back to your case $(b_1,b_2)=(2,4)$. We have $a_0=\frac12(\frac13+\frac13)=\frac13$ since the leftmost and rightmost slope are both $0$.
We have $a_1=\frac{g'(2+)-g'(2-)}2=\frac12(1-\frac13)=\frac13$ and $a_2=\frac{g'(4-)-g'(4+)}2=\frac12(\frac13-1)=-\frac13$.
Now $g(x)=\frac13x+\frac13|x-2|-\frac13|x-4|+a_3$. Taking $x=0$ we have $-\frac23=g(0)=\frac23-\frac43+a_3$, giving $a_3=0$.

- 1,457
-
How do I go about finding the $a_k$s? How are they related to the piecewise function? – Luke Mar 24 '24 at 22:27
-
@Luke Let me think about it. It's not very hard and I'll update my answer at night. – Liding Yao Mar 24 '24 at 23:12