On 04/13/2014 12:16 PM, Daniel Edler wrote: > I wanted to show that two equations are equal so I used the bool() > function. Unfortunately sage (6.1.1) do not see that it is equal but > obviously they are. If I replace log(x) with -log(1/x) it works and the > replacement itself is also true for sage. What is the problem? Here is > my cell: >
When you call bool() on a symbolic equality, there are three potential results that are returned as only two constants: - True: They're equal - False: Either they're not equal, or I don't know In your case, False means "I don't know." Sage errs on the safe side here. You can convince it to try more drastic transformations in order to determine that they're equal: sage: actual = -g*m^2*log( (m*v*cos(alpha))/(m*v*cos(alpha) - k*x) ) /k^2 + m*v*sin(alpha)/k+ g*m^2/k^2 - (m*v*cos(alpha) - k*x)*sin(alpha)/(k*cos(alpha)) - (m*v*cos(alpha) - k*x)*g*m/(k^2*v*cos(alpha)) sage: expected = (tan(alpha)+m*g/(k*v*cos(alpha)))*x + g*(m/k)^2 * log(1-k*x/(m*v*cos(alpha))) sage: bool(actual == expected) False sage: bool(actual.simplify_full() == expected.simplify_full()) True -- 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
