# Simplify x from x |x|

I have that

$$x |x| = -y,$$ Clearly the sign of x is determined by the sign of y. But then how to write what x is?What happens if y is discontinuous at 0?

Is it $$x = sgn(x) \sqrt{ |y|} ?$$ or doesn't it make any sense?there is something I probably don't understand.

silly example $$5 |5| = - (-25)$$ x is positive when y negative and $$- 5 |-5| = - (25)$$ x is negative when y positive.

• We can go at this by analyzing two cases (if we exclude $x=0$ as we just get the origin there): either $x>0$ or $x<0$. Try graphing it by plotting each individual case and seeing how it all comes together. May 19, 2021 at 0:27
• When $x\geq 0$, $x^2=-y$, and when $x<0$, $-x^2=-y$, i.e. $x^2=y$. So it looks like $x^2=-\text{sgn}(x)y$. May 19, 2021 at 0:31

I'm assuming you're asking this question in the case where $$x$$ and $$y$$ are real numbers rather than complex numbers.

It looks to me as if $$x = -\operatorname{sgn}(y) \sqrt{|y|}$$ where you might have to do something when $$y = 0$$, depending on the definition of "sgn".

There are four solutions:

$$x = \pm \sqrt{y}$$ and $$\pm i \sqrt{y}$$.

• But some of those are spurious: if $y=+4$ then $x=+2$ is not a solution May 19, 2021 at 0:26
• thanks for the answer, I should have mentioned x and y are real.
– Geo
May 19, 2021 at 0:38

$$y = \begin{cases}x^2 & x\le 0\\-x^2 & x>0 \end{cases}$$

and to invert this.

$$x = \begin{cases} \sqrt {-y} & y\le 0\\ -\sqrt{y} & y> 0\end {cases}$$

or $$x = -\text{sgn}(y)\sqrt{|y|}$$

• I guess(typo) in the first is $$x >0.$$ Shouldn't be minus sign in the end as in the other comment? The signs were from beginning what was confusing to me.
– Geo
May 19, 2021 at 0:40