Simplifying expressions with like bases