Simplifying expressions with index notation