Next: Algebra Answer 2, Previous: Types Answer 15, Up: Answers to Exercises

#### 3.7.48 Algebra Tutorial Exercise 1

The result ‘`sqrt(x)^2`’ is simplified back to ‘`x`’ by the Calculator, but ‘`sqrt(x^2)`’ is not. (Consider what happens if ‘`x = -4`’.) If ‘`x`’ is real, this formula could be simplified to ‘`abs(x)`’, but for general complex arguments even that is not safe. (See Declarations, for a way to tell Calc that ‘`x`’ is known to be real.)