**Quote:**

but isn't something wrong with this? how can we derive |a|=|b| from just a=|b|?

there is nothing wrong. we can derive |a| = |b| from a = |b| i.e.

a = |b| => |a| = |b| (but not the other way around).

you just need to consider the range of numbers that the first equation implies for 'a'. in the first equation (a = |b|) the right side ( |b| ) is 0 or greater than 0, therefore the left side (a) is also 0 or greater, so "a" can't be a negative number

(a >= 0).

let me explain in a different way:

1) original equation:

a = |b| implies that:

I. 'b' can be anything

II. a is 0 or greater than 0 i.e. 'a' cant be negative (a>=0).

for example:

b= -0.6 and a is 0.6

b = 0 and a is 0

b = 10 and a is 10

2) the new equation:

|a| = |b| says that

absolute value of 'a' is equal to absolute value of 'b'.

why is this ok? because from the first equation we already know that

'a' is not negative, and since absolute value of non-negative numbers are the same as the number, the new equation true also.

remember always pay attention to range of values a variable can take. for example in X = 1/Y you should beware that y can never be 0.