First time here? Check out the FAQ!
answered 2018-08-11 10:30:56 +0100
For simplifying expressions involving square roots, it often helps to use the canonicalize_radical method.
canonicalize_radical
In your case:
sage: f.canonicalize_radical() 0