182apr28.mws

> restart;

> with(student):

> an:=x^n;
bn:=1/n^2;

an := x^n

bn := 1/n^2

> A1:=Sum(an,n=1..infinity);
B1:=Sum(bn,n=1..infinity);

A1 := Sum(x^n, n = 1 .. infinity)

B1 := Sum(1/n^2, n = 1 .. infinity)

> A2:=value(A1);
B2:=value(B1);

A2 := -x/(x-1)

B2 := 1/6*Pi^2

> subs(x=1/3,A1=A2);

Sum((1/3)^n, n = 1 .. infinity) = 1/2

> S1:=Sum(an*bn,n=1..infinity);

S1 := Sum(x^n/n^2, n = 1 .. infinity)

> S2:=value(S1);

S2 := polylog(2, x)

> T1:=simplify(diff(S1,x));

T1 := Sum(x^(n-1)/n, n = 1 .. infinity)

> T2:=expand(x*T1,x);

T2 := Sum(x^n/n, n = 1 .. infinity)

> T3:=simplify(diff(T2,x));

T3 := Sum(x^(n-1), n = 1 .. infinity)

> T4:=value(T3);

T4 := -1/(x-1)

> #Therefore
Diff(x*Diff(y(x),x),x)=T4;

Diff(x*(Diff(y(x), x)), x) = -1/(x-1)

> #where
y(x)=S1;

y(x) = Sum(x^n/n^2, n = 1 .. infinity)

> #Now integrate to find y(x)
#BUG: the following integral should work only assuming t<1

T5:=int(T4,x=0..t) assuming t<0;

T5 := -ln(1-t)

> T6:=T5/t;

T6 := -ln(1-t)/t

> #Therefore y(x) is given by
T7:=int(T6,t=0..x);

T7 := dilog(1-x)

> #The difference between S2 and T7 should be zero
simplify(S2-T7);

polylog(2, x)-dilog(1-x)

> #When x=1/3 they have the same values
evalf(subs(x=1/3,S2));

evalf(subs(x=1/3,T7));

.3662132299

.3662132299

> #Sum the first 10 terms should make an approximation
S3:=sum(an*bn,n=1..10);

S3 := x+1/4*x^2+1/9*x^3+1/16*x^4+1/25*x^5+1/36*x^6+1/49*x^7+1/64*x^8+1/81*x^9+1/100*x^10

> S4:=subs(x=1/3,S3);

S4 := 45774786439/124994923200

> #Agrees to the first 5 decimals
evalf(S4);

.3662131650

>