Ask Your Question

Revision history [back]

Hi,

For the first one:

sage: s = sum(sin(k)/k for k in [1..100])
sage: s
1/100*sin(100) + 1/99*sin(99) + ... + 1
sage: n(s)  # to get a numerical value
1.06042893840106
sage: n(s, digits=100)
1.060428938401062128124909620302077101279763978311569855925441799757471979305661574312928477002754702

For the second one:

sage: s = integrate(log(x), (x,1,10))
sage: s
10*log(10) - 9
sage: n(s)
14.0258509299405

Eric.