bn,n =var('bn,n')
# f(x) is odd as seen by the figure
bn=2/pi*(integral(3*x*(pi^2-x^2)*cos(n*x),x,-pi,pi))
print 'bn=',bn

#Plotting the function
x=var('x')
f1=function('f1',x)
f1=3*x*(pi^2-x^2)
f1.plot(xmin=-pi,xmax=pi)

SageDays/Kreyszig-10.4-16 (last edited 2010-08-12 13:35:31 by Aashita)