Solve equations involving like terms