## Wednesday, May 25, 2016

### Absolute Value: Does |x|^2 = x^2?

Absolute Value:  Does |x|^2 = x^2?

Proof that |x|^2 = x^2, assuming x is a real number.

Note that |x| = x/sgn(x), where sgn(x) is the sign function where:

sgn(x) = -1 if x < 0,
sgn(x) = 0 if x = 0,
and sgn(x) = 1 if x > 0

Case: x = 0.

Then:
|0| = 0 and |0|^2 = 0^2 = 0.

Case: x ≠ 0.

Then:
|x|^2 = (x/sgn(x))^2
= x/sgn(x) * x/sgn(x)
= x^2/sgn(x)^2

If x < 0, sgn(x) = -1, and since -1 * -1 = 1, sgn(x)^2 = 1
If x > 0, sgn(x) = 1, and since 1 * 1 = 1, sgn(x)^2 = 1

Hence:
x^2/sgn(x)^2
= x^2

QED

Caution:  The statement |x|^2 = x^2 is not true for complex numbers where the imaginary part is nonzero.

Let x = a + b*i

|x|^2 = |a + b*i|^2 = (√(a^2 + b^2))^2 = a^2 + b^2

x^2 = (a + b*i)^2 = a^2 + 2*a*b*i – b^2 ≠ a^2 + b^2   (b ≠ 0)

Conclude:  |x|^2 = x^2 only if x is a real number.

Eddie

This blog is property of Edward Shore, 2016

### TI 30Xa Algorithms: Greatest Common Divisor

TI 30Xa Algorithms: Greatest Common Divisor To find the greatest common divisor between two positive integers U and V: Let U ≥ V. ...