How can $|x|= -x$, when $x<0$? Why is the following true?
$$
|x|=
\begin{cases}
x,&x\ge 0\\
-x,&x<0
\end{cases}
$$
Isn't the modulus of a number always positive? According to the above formula $|-4|=-4$ because $4<0$, which is incorrect.
Please explain this to me. Thank you.
 A: According to the above formula, $|-4| = -(-4)$, which is perfectly fine.
A: You may prefer $|x|:=\sqrt{x^2}$, hence $|-4|=\sqrt{16}=4$.
A: According to your sentence : "Isn`t the modulus of a number always positive? According to the above formula |-4|=-4 because 4<0, which is incorrect." . You have said , "4<0" ? Is it right ? infact -4 < 0 . Infact , $ |-4| = -(-4) $ which is perfectly fine.
A: No, the formula says that $|-4|=-(-4)=4$. The $x$ in this case is $-4$, and $-(-4)=4$, not $-4$. When you get the value $-4$, you’re not applying the definition correctly: you’re taking the negative of $4$, not of $-4$, but the number inside the absolute value is not $4$.
A: $\vert x\rvert\ge0$ for any $x \in \mathbb{R}$. The piecewise-defined function for $\lvert x\rvert$ is
$$
\vert x\rvert=
\begin{cases}
x& x>0\\
0& x=0\\
-x& x<0
\end{cases}
$$
We read it literally as
$$
\vert x\rvert=
\begin{cases}
x& \text{if $x$ is a positive real number}\\
0& x=0\\
-x& \text{if $x$ is a negative real number}
\end{cases}
$$
If $x$ is a negative real number then $-x$ is a positive real number. I think it is obvious!
A: The prefix unary operand - changes the sign of its operand.  So a negative number's sign is changed to positive by this operation.
