For simplifying expressions involving square roots, it often helps to use the canonicalize_radical method.
sage: f.canonicalize_radical()