a0,an,bn,n =var('a0,an,bn,n')
a0=1/(2*pi)*integral(x,x,-pi,pi)
print 'a0=',a0
bn=integral(x*sin(n*x),x,-pi,pi)*1/pi
an=integral(x*cos(n*x),x,-pi,pi)*1/pi
print 'an=',an
print 'bn=',bn

SageDays/Kreyszig-10-16 (last edited 2010-08-12 11:20:52 by Aashita)