Simplifying expressions and differentiating expressions