If you look close, the book probably says something about a&b being positive or at least non-neg.
-12 = 1
-1 = 11/2
-1 = 1
As soon as you start putting negs inside square roots the rules change. Because otherwise you'd get wrong answers like you showed here. The technical rule for square roots of squares is absolute value, so your second line should really be sqrt[(-1)^2] = sqrt which means your last line should be |-1| = sqrt so 1 = 1.