# is it technically wrong to write $(\lvert x\rvert)^2$ as $(x)^2$?

kind of a simple question , I know, but just in case I'm wrong

is writing an absolute value necessary when said absolute value is squared?

for example something like this:

$(\lvert x-3\rvert)^2 = (x-3)^2$

since absolute value functions can be written as

$\lvert x \rvert = \sqrt{(x)^2}$

I thought that maybe $(\lvert x \rvert)^2 = (\sqrt{(x)^2})^2$ and the square root cancels out ,making $(x)^2$

thanks

• For real $x$, it is absolutely fine to write $|x|^2=x^2$. For complex x, these two have different meaning. – Math Lover Aug 16 '17 at 18:46
• No, it's not wrong. – John Wayland Bales Aug 16 '17 at 18:46
• okay, thanks. I'm not dealing with complex numbers or vectors, so it works then – Dahen Aug 16 '17 at 18:47
• It is a basic result that on $\mathbf R$, $\;\lvert x\rvert^2=x^2$. Of course this is wrong on $\mathbf C$. – Bernard Aug 16 '17 at 18:47
• For vectors in $\mathbb R^n$ writing $|x|^2 = x \cdot x = x^2$ can be motivated by geometric algebra: en.wikipedia.org/wiki/Geometric_algebra – md2perpe Aug 16 '17 at 19:24

In general, it is not the case that $|A|^2 = A^2$ (for example, if $A$ is a complex number, or a vector, or some other kind of object where some notions of absolute values and squaring make sense). However, if $A$ is a real number, then you are fine.
• However for a vector you have an analog: $\lVert A\rVert^2=A\cdot A$. – Bernard Aug 16 '17 at 18:48