||'''Book'''|| Advanced Engineering Mathematics || ||'''Author'''|| Erwin Kreyszig || ||'''Edition'''|| 8th Edition || /* code_begins */ {{{ a0,an,n =var('a0,an,n') # f(x) is even as seen by the figure an=2/pi*(integral(-2*x*cos(n*x),x,-pi,0)+integral(2*x*cos(n*x),x,0,pi)) a0=1/(pi)*(integral(-2*x,x,-pi,0)+integral(2*x,x,0,pi)) print 'a0=',a0 print 'an=',an #Plotting the function x=var('x') f1=function('f1',x) f1=2*x f2=function('f2',x) f2=-2*x f1.plot(xmin=-pi,xmax=0)+f2.plot(xmin=0,xmax=pi) }}} /* code_ends */ * '''Solution by''': * Snehal Mitragotri, Ex-student, IIT Roorkee * Aashita Kesarwani, Student, IIT Roorkee * Tale PrafullKumar, Student, IIT Roorkee