How to Expand Algebraic Expressions