Difference between revisions of "Sum Command"

From GeoGebra Manual
Jump to: navigation, search
Line 19: Line 19:
 
:Computes sum <math>\sum_{t=s}^{e}f(t)</math>. End value might be infinity.
 
:Computes sum <math>\sum_{t=s}^{e}f(t)</math>. End value might be infinity.
 
:{{Example|1=&nbsp;
 
:{{Example|1=&nbsp;
:*<code><nowiki>Sum[i^2, i, 1, 3] </nowiki></code>  returns 14.
+
:*<code><nowiki>Sum[i^2, i, 1, 3]</nowiki></code>  returns 14.
:*<code><nowiki>Sum[r^i, i,0,n] </nowiki></code>  returns (1-r^(n+1))/(1-r).
+
:*<code><nowiki>Sum[r^i, i,0,n]</nowiki></code>  returns (1-r^(n+1))/(1-r).
:*<code><nowiki>Sum[(1/3)^i, i,0,Infinity] </nowiki></code>  returns 3/2.}}
+
:*<code><nowiki>Sum[(1/3)^i, i,0,Infinity]</nowiki></code>  returns 3/2.}}

Revision as of 13:20, 10 August 2011


Sum[List]
Calculates the sum of all list elements.
Note: This command works for numbers, points, vectors, text, and functions.
Example:  
  • Sum[{1, 2, 3}] gives you the number a = 6.
  • Sum[{x^2, x^3}] gives you f(x) = x2 + x3.
  • Sum[Sequence[i,i,1,100]] gives you the number a = 5050.
  • Sum[{(1, 2), (2, 3)}] gives you the point A = (3, 5).
  • Sum[{(1, 2), 3}] gives you the point B = (4, 2).
  • Sum[{"a","b","c"}] gives you the text "abc".


Sum[List, Number n of Elements]
Calculates the sum of the first n list elements.
Note: This command works for numbers, points, vectors, text, and functions.
Example: Sum[{1, 2, 3, 4, 5, 6}, 4] gives you the number a = 10.

CAS specific syntax

Following syntax works only in CAS view

Sum[<Expression f(t)>,<Variable t>,<Start Value s>,<End Value e>]
Computes sum \sum_{t=s}^{e}f(t). End value might be infinity.
Example:  
  • Sum[i^2, i, 1, 3] returns 14.
  • Sum[r^i, i,0,n] returns (1-r^(n+1))/(1-r).
  • Sum[(1/3)^i, i,0,Infinity] returns 3/2.
© 2021 International GeoGebra Institute