#15346: symbolic sums that don't simplify don't simplify
-------------------------+-----------------------------
Reporter: kcrisman | Owner:
Type: defect | Status: new
Priority: minor | Milestone: sage-5.13
Component: symbolics | Keywords:
Merged in: | Authors:
Reviewers: | Report Upstream: N/A
Work issues: | Branch:
Commit: | Dependencies:
Stopgaps: |
-------------------------+-----------------------------
[http://ask.sagemath.org/question/3152 This ask.sagemath question] points
out that
{{{
sage: k,n = var('k,n')
sage: f(x,k) = sum((2/n)*(sin(n*x)*(-1)^(n+1)), n, 1, k)
sage: f(x,2)
-2*sum((-1)^n*sin(n*x)/n, n, 1, 2)
}}}
while
{{{
sage: f(x)=(2/n)*(sin(n*x)*(-1)^(n+1))
sage: sum(f, n, 1, 2) #using summation function
-sin(2*x) + 2*sin(x)
}}}
User twch found this workaround
{{{
sage: var('n')
sage: def g(x,k):
sage: return sum((2/n)*(sin(n*x)*(-1)^(n+1)), n, 1, k)
sage: print g(x,2)
-sin(2*x) + 2*sin(x)
}}}
but I agree with him/her that we should look into how to fix this.
The essential problem is that when Maxima does not simplify a sum, we
don't have any mechanism (currently) to get it to "just print out all the
numbers". Which of course may not be very nice when `k` is big, but
presumably should be allowed to be done by users.
----
By the way, the way to do this in Maxima is as follows:
{{{
(%i1) f: -2*'sum((-1)^n*sin(n*x)/n,n,1,2);
2
==== n
\ (- 1) sin(n x)
(%o1) - 2 > ---------------
/ n
====
n = 1
(%i8) f, nouns;
sin(2 x)
(%o8) - 2 (-------- - sin(x))
2
}}}
so setting `nouns:true` just for this would work, but I can never figure
out how to do this from within Sage - see #10955.
--
Ticket URL: <http://trac.sagemath.org/ticket/15346>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" 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-trac.
For more options, visit https://groups.google.com/groups/opt_out.