Sunteți pe pagina 1din 2

Matlab Symbolic

Calculul sumei unei serii numerice (sintaxa si exemple)


Functia symsum
 Fie seria lui Riemann (seria-p, cu p=2)

syms x k
s1 = symsum(1/k^2,1,inf)
s1 =
1/6*pi^2

 Fie seria geometrica

s2 = symsum(x^k,k,0,inf)
s2 =
-1/(x-1)

symsum(x^k/sym('k!'), k, 0,inf)
exp(x)
Alte exemple
s = symsum(1/(k^2-1),2,inf)
s =
¾
-----------------------------------
s = symsum(log((k+1)/k),1,inf)
s =
Inf % Serie divergenta
----------------------------------

s = symsum(1/k^3,1,inf)
s= zeta(3)
zeta(3)
ans =
1.2021
------------------------------------------------------------------------------------
s = symsum(1/k,1,inf)
s =
Inf …% Serie divergenta

s = symsum(1/k^(1/n),1,inf)
s = symsum((-1)^(k+1)/k,1,inf)
s =
log(2)

Calculul sumelor finite (sintaxa si exemple


Functia symsum

Calculul sumei patratelor primelor n numere naturale
syms k n x
symsum(k^2)
return
1/3*k^3-1/2*k^2+1/6*k

 Calculul sumei patratelor primelor 10 numere naturale

symsum(k^2,0,10) returns
385

Calculul sumei primelor n numere naturale
symsum(k) returns
1/2*k^2-1/2*k

symsum(sin(k*pi)/k,0,n)
-1/2*sin(k*(n+1))/k+1/2*sin(k)/k/(cos(k)-
1)*cos(k*(n+1))-
1/2*sin(k)/k/(cos(k)-1)