On Fri, Mar 6, 2020 at 1:44 PM Fernando Gouvea <fqgou...@colby.edu> wrote: > > OK, so I'm doing a computation and my result is something I called thirdroot. > I'm trying to test whether it's equal to a particular expression. Can someone > explain what is wrong here? > > (s*t+1)^2/(s+t)^2 > > (s*t + 1)^2/(s + t)^2 > > factor(thirdroot+1) > > (s*t + 1)^2/(s + t)^2 > > thirdroot+1-(s*t+1)^2/(s+t)^2 > > ((s^2 - 1)*t^2 - s^2 + 1)/(s^2 + 2*s*t + t^2) - (s*t + 1)^2/(s + t)^2 + 1 > > simplify(thirdroot+1-(s*t+1)^2/(s+t)^2) > > ((s^2 - 1)*t^2 - s^2 + 1)/(s^2 + 2*s*t + t^2) - (s*t + 1)^2/(s + t)^2 + 1 > > expand(thirdroot+1-(s*t+1)^2/(s+t)^2) > > -s^2/(s^2 + 2*s*t + t^2) - 2*s*t/(s^2 + 2*s*t + t^2) - t^2/(s^2 + 2*s*t + > t^2) + 1 > > Seeing a 0 would make me happier...
If you work in a polynomial ring, it will work: age: R.<s,t>=QQ[] sage: f=-s^2/(s^2 + 2*s*t + t^2) - 2*s*t/(s^2 + 2*s*t + t^2) - t^2/(s^2 + 2*s*t + t^2) + 1 sage: type(f) <class 'sage.rings.fraction_field_element.FractionFieldElement'> sage: f 0 > > Fernando > > -- > ============================================================= > Fernando Q. Gouvea http://www.colby.edu/~fqgouvea > Carter Professor of Mathematics > Dept. of Mathematics and Statistics > Colby College > 5836 Mayflower Hill > Waterville, ME 04901 > > When God is invisible behind the world, the contents of the world will > become new gods; when the symbols of transcendent religiosity are > banned, new symbols develop from the inner-worldly language of science > to take their place. > -- Eric Voegelin > > -- > You received this message because you are subscribed to the Google Groups > "sage-support" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sage-support+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sage-support/3b48a9c3-c752-a0bf-9da8-f4359c53647d%40colby.edu. -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/CAAWYfq0YyhbP%2Bq5LAv%2BuJp0zBG4nTKuU_%2B-uWZ%2BW_4B4FbN%3D0w%40mail.gmail.com.