ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 04 May 2011 06:13:26 -0500simplify() does not work?http://ask.sagemath.org/question/8101/simplify-does-not-work/I enter:
sage: a, b = var('a, b'); simplify((a + b)^2 - a^2 - 2*a*b - b^2)
and I would expect 0 (i.e. zero) as a result from simplify(),
but instead I get back unmodified:
(a + b)^2 - a^2 - 2*a*b - b^2
Am I missing anything?
I just started using it and it looks very promissing...Wed, 04 May 2011 03:35:34 -0500http://ask.sagemath.org/question/8101/simplify-does-not-work/Answer by John Palmieri for <p>I enter:</p>
<pre><code>sage: a, b = var('a, b'); simplify((a + b)^2 - a^2 - 2*a*b - b^2)
</code></pre>
<p>and I would expect 0 (i.e. zero) as a result from simplify(),
but instead I get back unmodified: </p>
<pre><code>(a + b)^2 - a^2 - 2*a*b - b^2
</code></pre>
<p>Am I missing anything?
I just started using it and it looks very promissing...</p>
http://ask.sagemath.org/question/8101/simplify-does-not-work/?answer=12332#post-id-12332There are different simplify functions. Try this:
sage: var('a b')
(a, b)
sage: f = ((a + b)^2 - a^2 - 2*a*b - b^2)
sage: f.simplify() # as you had
(a + b)^2 - a^2 - 2*a*b - b^2
sage: f.simplify_full()
0
Wed, 04 May 2011 04:27:48 -0500http://ask.sagemath.org/question/8101/simplify-does-not-work/?answer=12332#post-id-12332Comment by John Palmieri for <p>There are different simplify functions. Try this:</p>
<pre><code>sage: var('a b')
(a, b)
sage: f = ((a + b)^2 - a^2 - 2*a*b - b^2)
sage: f.simplify() # as you had
(a + b)^2 - a^2 - 2*a*b - b^2
sage: f.simplify_full()
0
</code></pre>
http://ask.sagemath.org/question/8101/simplify-does-not-work/?comment=21763#post-id-21763Also note that you can type "f.simplify<TAB>" to get a list of functions whose names start with "simplify". Once you've found one, like "f.simplify()" or "f.simplify_full()", I would recommend typing "f.simplify?" or "f.simplify_full?" to read the documentation.Wed, 04 May 2011 06:13:26 -0500http://ask.sagemath.org/question/8101/simplify-does-not-work/?comment=21763#post-id-21763Comment by kcrisman for <p>There are different simplify functions. Try this:</p>
<pre><code>sage: var('a b')
(a, b)
sage: f = ((a + b)^2 - a^2 - 2*a*b - b^2)
sage: f.simplify() # as you had
(a + b)^2 - a^2 - 2*a*b - b^2
sage: f.simplify_full()
0
</code></pre>
http://ask.sagemath.org/question/8101/simplify-does-not-work/?comment=21764#post-id-21764To the original poster - note the 'dot' notation in this case, where f.simplify() does the same things as simplify(f).Wed, 04 May 2011 04:46:55 -0500http://ask.sagemath.org/question/8101/simplify-does-not-work/?comment=21764#post-id-21764