# Inverse of absolute value function?

I am graphing a square with the following equation:

$$|y|=1-|x|$$ However, I need the equation in terms of y. That is, the form y=f(x) as opposed to the current |y|=f(x)

How do you get an equation in terms of y when absolute value is wrapping it. Is there an inverse absolute value function I can apply to both sides of the equation?

My first attempt was to use the old trick: $$|n| = \sqrt{n^2}$$

But of course that's not a real equation since roots have $$±$$.

Sure enough when applying that to try to get the equation in terms of y the graph failed to reproduce a square and ended up graphing what looked like a 'w'. • This isn't a function, so the only way to do it would be piecewise-ish. – Randall Dec 17 '18 at 18:50
• @Randall I wonder if there is a way to do it without going piecewise. I am currently experimenting with converting absolute value to this form $|y| \rightarrow y\cdot sgn(y)$ – Albert Renshaw Dec 17 '18 at 18:54
• But sgn(y) is also piecewise... run into same problem. – coffeemath Dec 17 '18 at 18:58
• @AlbertRenshaw It is not possible. A single $x$ creates two different $y$s (generally), so there is no way to make this function-like. – Randall Dec 17 '18 at 19:01
• Then the answer is no, since you have two branches. That's similar to the equation of a circle $x^2+y^2=1$ – Andrei Dec 17 '18 at 19:08

## 1 Answer

$$y = \pm |y| = \pm (1 - |x|)$$ for $$-1 \le x \le 1$$.

That is, there are two cases: $$+(1 - |x|)$$ which gives you the top half of your square, and $$-(1-|x|)$$ which gives you the bottom half.

Those inequalities are necessary, because $$|y|$$ is not allowed to be negative.

• Thanks, I was hoping for something unbounded but this will have to do for now. +1 – Albert Renshaw Dec 17 '18 at 19:23
• You cannot do any better, and this still is not of the form $y=f(x)$ that you originally asked for, because that's impossible. The answer here is the best possible, but please do not think it is a function. – Randall Dec 17 '18 at 20:43
• @randall you’re getting too caught up on the word “function”. I’m aware function isn’t the correct term, however this answer is sufficient for the use-case I have. I’m leaving the question open for now to see what else others may come up with – Albert Renshaw Dec 17 '18 at 21:26
• What do you mean "something unbounded"? The square is bounded! – Robert Israel Dec 17 '18 at 21:55