[Math] Inverse of absolute value function

absolute valuegraphing-functions

I am graphing a square with the following equation:

$$|y|=1-|x|$$

enter image description here

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[2]{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'.

enter image description here

Best 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.