Simplify rational expressions (advanced)