The a r (
rewrite] command makes
substitutions in a formula according to a specified pattern or patterns
known as rewrite rules. Whereas a b (
matches literally, so that substituting ‘sin(x)’ with ‘cos(x)’
matches only the
sin function applied to the variable
rewrite rules match general kinds of formulas; rewriting using the rule
‘sin(x) := cos(x)’ matches
sin of any argument and replaces
cos of that same argument. The only significance of the
x is that the same name is used on both sides of the rule.
Rewrite rules rearrange formulas already in Calc's memory. See Syntax Tables, to read about syntax rules, which are similar to algebraic rewrite rules but operate when new algebraic entries are being parsed, converting strings of characters into Calc formulas.