The basics are nicely covered in PAIP; the source code is free online -- see particularly the source files with 'macsyma' in the name. Topics include rewrite-rule systems, simplification using canonical forms, integration and differentiation, and compiling and memoizing rewrite rules for speed.