(*^ ::[ Information = "This is a Mathematica Notebook file. It contains ASCII text, and can be transferred by email, ftp, or other text-file transfer utility. It should be read or edited using a copy of Mathematica or MathReader. If you received this as email, use your mail application or copy/paste to save everything from the line containing (*^ down to the line containing ^*) into a plain text file. On some systems you may have to give the file a name ending with ".ma" to allow Mathematica to recognize it as a Notebook. The line below identifies what version of Mathematica created this file, but it can be opened using any other version as well."; FrontEndVersion = "Macintosh Mathematica Notebook Front End Version 2.2"; MacintoshStandardFontEncoding; fontset = title, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, L3, e8, 24, "Times"; fontset = subtitle, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, L2, e6, 20, "Times"; fontset = subsubtitle, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, L2, e6, 16, "Times"; fontset = section, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, grayBox, M22, bold, L2, a20, 16, "Times"; fontset = subsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, blackBox, M19, bold, L2, a15, 14, "Times"; fontset = subsubsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, whiteBox, M18, bold, L2, a12, 12, "Times"; fontset = text, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L2, 14, "Times"; fontset = smalltext, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L2, 12, "Times"; fontset = input, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeInput, M42, N23, bold, L2, 12, "Courier"; fontset = output, output, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L2, 12, "Courier"; fontset = message, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, R65535, L2, 12, "Courier"; fontset = print, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L2, 12, "Courier"; fontset = info, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L2, 12, "Courier"; fontset = postscript, PostScript, formatAsPostScript, output, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeGraphics, M7, l34, w282, h287, L2, 12, "Courier"; fontset = name, inactive, nowordwrap, nohscroll, noKeepOnOnePage, preserveAspect, M7, italic, B65535, L2, 10, "Geneva"; fontset = header, inactive, noKeepOnOnePage, preserveAspect, M7, L2, 10, "Times"; fontset = leftheader, inactive, L2, 10, "Times"; fontset = footer, inactive, noKeepOnOnePage, preserveAspect, center, M7, L2, 12, "Times"; fontset = leftfooter, inactive, center, L2, 12, "Times"; fontset = help, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L2, 10, "Geneva"; fontset = clipboard, inactive, noKeepOnOnePage, preserveAspect, M7, L2, 12, "New York"; fontset = completions, inactive, nowordwrap, noKeepOnOnePage, preserveAspect, M7, L2, 12, "New York"; fontset = special1, inactive, nowordwrap, noKeepOnOnePage, preserveAspect, M7, L2, 12, "New York"; fontset = special2, inactive, nowordwrap, noKeepOnOnePage, preserveAspect, center, M7, L2, 12, "New York"; fontset = special3, inactive, nowordwrap, noKeepOnOnePage, preserveAspect, right, M7, L2, 12, "New York"; fontset = special4, inactive, nowordwrap, noKeepOnOnePage, preserveAspect, M7, L2, 12, "New York"; fontset = special5, inactive, nowordwrap, noKeepOnOnePage, preserveAspect, M7, L2, 12, "New York"; paletteColors = 128; currentKernel; ] :[font = title; inactive; preserveAspect; startGroup] Linear Methods of Applied Mathematics Differentiating Fourier Series ;[s] 3:0,1;38,2;39,1;70,-1; 3:0,27,18,Times,1,24,0,0,0;2,26,17,Times,1,23,0,0,0;1,14,8,Times,1,11,0,0,0; :[font = text; inactive; preserveAspect; plain; bold] (c) Copyright 1994-1997 by Evans M. Harrell II and James V. Herod. All rights reserved. ;[s] 1:0,1;94,-1; 2:0,17,12,Times,1,14,0,0,0;1,14,9,Times,1,12,0,0,0; :[font = text; inactive; Cclosed; preserveAspect; plain; bold; startGroup] Notes for the instructor. ;[s] 2:0,1;25,0;26,-1; 2:1,17,12,Times,1,14,0,0,0;1,12,8,Times,1,9,0,0,0; :[font = text; inactive; preserveAspect; endGroup] This contains calculations and examples which correlate with chapter 5 of the WWW text by Harrell and Herod. Students can be encouraged to cut and paste from this notebook to do homework. :[font = subsubsection; inactive; Cclosed; preserveAspect; startGroup] Instructions :[font = text; inactive; preserveAspect; endGroup] This notebook uses Mathematica to perform calculations for Harrell and Herod's hypertext book, Linear Methods of Applied Mathematics. The student needs only a basic knowledge of Mathematica to use the notebook, which is designed both to show how to work problems in the text and to provide a template for using Mathematica to work other problems of the student's own design. Calculations will be performed when the reader presses enter in a given calculation cell (bold print). It is best to activate the cells in order, so that Mathematica will be able to call on operators and functions defined in earlier cells. Red color coding is used to warn the reader when a given calculation relies on an earlier one. ;[s] 11:0,0;19,1;30,0;96,1;133,0;181,1;192,0;315,1;326,0;538,1;549,0;721,-1; 2:6,17,12,Times,0,14,0,0,0;5,17,12,Times,2,14,0,0,0; :[font = text; inactive; preserveAspect] A useful substitution, which we shall often make, is: :[font = input; preserveAspect] TrigId = {Cos[Pi n_] -> (-1)^n, Sin[Pi n_] -> 0}; :[font = text; inactive; preserveAspect] Please activate this cell before proceeding. :[font = section; inactive; preserveAspect; fontSize = 18; startGroup] Introduction. :[font = text; inactive; preserveAspect; endGroup] Some of the most important purposes for which Fourier series are used are to solve differential equations. We shall therefore wish to differentiate them, and it is reasonable to wonder whether this is legitimate - it is not always legitimate to differentiate an infinite series. Fortunately, Fourier series are robust enough that differentiating them normally works quite well. Let's begin by recalling how to set Mathematica up to calculate Fourier series, from the Mathematica notebook for Chapter 4: ;[s] 5:0,0;417,1;428,0;470,1;481,0;506,-1; 2:3,17,12,Times,0,14,0,0,0;2,17,12,Times,2,14,0,0,0; :[font = section; inactive; Cclosed; preserveAspect; fontSize = 18; startGroup] Automating the Fourier series :[font = text; inactive; preserveAspect] Here we set up some Mathematica commands to compute the Fourier for a general function defined on an interval a < x < b. Warning! We do not recommend running these commands on a computer with a slow processor, since there are several nested definitions and integrations. If you find yoursefl limited by the capabilities of your machine, it is recommended that you calculate the coefficients first, and then insert them into the series with a separate definition, as in the examples above. ;[s] 3:0,0;20,1;31,0;493,-1; 2:2,17,12,Times,0,14,0,0,0;1,17,12,Times,2,14,0,0,0; :[font = input; dontPreserveAspect] Ave[f_, {a_,b_}] := (1/(b-a)) Integrate[(f /. x -> intvar1), \ {intvar1, a, b}] A[f_,m_, {a_,b_}] := (2/(b-a)) Integrate[ \ (Cos[2 m Pi intvar2/(b-a)] f /. x -> intvar2), \ {intvar2, a, b}] /. TrigId B[f_,n_, {a_,b_}] := (2/(b-a)) Integrate[ \ (Sin[2 n Pi intvar3/(b-a)] f /. x -> intvar3), \ {intvar3, a, b}] /. TrigId :[font = input; preserveAspect] FullSeries[f_, NN_, {x_,a_,b_}] := Ave[f,{a,b}] + \ Sum[A[f,m,{a,b}] Cos[2 m Pi x/(b-a)], {m, 1, NN}] + \ Sum[B[f,n,{a,b}] Sin[2 n Pi x/(b-a)], {n, 1, NN}] :[font = text; inactive; preserveAspect] An example: :[font = input; preserveAspect; startGroup] FullSeries[x, 3, {x,0,1}] ;[s] 2:0,1;10,0;26,-1; 2:1,14,10,Courier,1,12,0,0,0;1,14,10,Courier,1,12,65535,0,0; :[font = output; output; inactive; preserveAspect; endGroup; endGroup] 1/2 - Sin[2*Pi*x]/Pi - Sin[4*Pi*x]/(2*Pi) - Sin[6*Pi*x]/(3*Pi) ;[o] 1 Sin[2 Pi x] Sin[4 Pi x] Sin[6 Pi x] - - ----------- - ----------- - ----------- 2 Pi 2 Pi 3 Pi :[font = subsection; inactive; Cclosed; preserveAspect; fontSize = 18; startGroup] Example: Differentiating the series for x - x3. ;[s] 3:0,0;46,1;47,0;49,-1; 2:2,20,14,Times,1,18,0,0,0;1,32,20,Times,33,18,0,0,0; :[font = text; inactive; preserveAspect] In the notebook for chapter 4 we calculated the Fourier series for the function x - x3, and found a series with only sine contributions (because the function is odd): ;[s] 3:0,0;96,1;97,0;179,-1; 2:2,17,12,Times,0,14,0,0,0;1,25,16,Times,32,14,0,0,0; :[font = input; Cclosed; dontPreserveAspect; startGroup] FSeries[x_, N_] = Sum[-12 (-1)^k Sin[ Pi k x ] /(k Pi)^3, {k, 1, N} ] ;[s] 1:0,0;70,-1; 1:1,17,12,New York,1,12,0,0,0; :[font = output; output; inactive; dontPreserveAspect; endGroup] Sum[(-12*(-1)^k*Sin[k*Pi*x])/(k^3*Pi^3), {k, 1, N}] ;[o] k -12 (-1) Sin[k Pi x] Sum[---------------------, {k, 1, N}] 3 3 k Pi :[font = input; dontPreserveAspect] Plot[{x-x^3, FSeries[x,3]}, {x,-1,1}] ;[s] 3:0,0;13,1;20,0;38,-1; 2:2,14,10,Courier,1,12,0,0,0;1,14,10,Courier,1,12,65535,0,0; :[font = text; inactive; Cclosed; dontPreserveAspect; startGroup] The match is superb. But what happens if we differentiate? Is the derivative of a Fourier series the series for the derivative? If so, that can save us a lot of work, since it is easy to differentiate a Fourier series term by term. Supposing this works, the series for the derivative 1 - 3 x^2 should be: :[font = input; Cclosed; dontPreserveAspect; startGroup] D[FSeries[x,N],x] ;[s] 3:0,0;2,1;9,0;18,-1; 2:2,14,10,Courier,1,12,0,0,0;1,14,10,Courier,1,12,65535,0,0; :[font = output; output; inactive; dontPreserveAspect; endGroup] Sum[(-12*(-1)^k*Cos[k*Pi*x])/(k^2*Pi^2), {k, 1, N}] ;[o] k -12 (-1) Cos[k Pi x] Sum[---------------------, {k, 1, N}] 2 2 k Pi :[font = input; Cclosed; dontPreserveAspect; startGroup] %/. N -> 4 ;[s] 2:0,1;1,0;11,-1; 2:1,14,10,Courier,1,12,0,0,0;1,14,10,Courier,1,12,65535,0,0; :[font = output; output; inactive; dontPreserveAspect; endGroup] (12*Cos[Pi*x])/Pi^2 - (3*Cos[2*Pi*x])/Pi^2 + (4*Cos[3*Pi*x])/(3*Pi^2) - (3*Cos[4*Pi*x])/(4*Pi^2) ;[o] 12 Cos[Pi x] 3 Cos[2 Pi x] 4 Cos[3 Pi x] ------------ - ------------- + ------------- - 2 2 2 Pi Pi 3 Pi 3 Cos[4 Pi x] ------------- 2 4 Pi :[font = input; dontPreserveAspect] Plot[{1 - 3 x^2, %}, {x, -1,1}] ;[s] 3:0,0;17,1;18,0;32,-1; 2:2,14,10,Courier,1,12,0,0,0;1,14,10,Courier,1,12,65535,0,0; :[font = text; inactive; dontPreserveAspect] Superb! Just for fun, let's see the comparison outside the interval where we cut off the polynomials: :[font = input; dontPreserveAspect] Plot[{1 - 3 x^2, %%}, {x, -Pi,Pi}] ;[s] 3:0,0;17,1;19,0;35,-1; 2:2,14,10,Courier,1,12,0,0,0;1,14,10,Courier,1,12,65535,0,0; :[font = text; inactive; dontPreserveAspect] Finally, let us calculate the Fourier series for 1 - 3 x^2 and see that the integral formulae give us the same series: :[font = input; dontPreserveAspect] f[x_] := 1 - 3 x^2 :[font = input; Cclosed; preserveAspect; startGroup] Ave[f[x], {-1,1}] A[f[x],m, {-1,1}] B[f[x],n, {-1,1}] :[font = output; output; inactive; preserveAspect] 0 ;[o] 0 :[font = output; output; inactive; preserveAspect] (-12*(-1)^m)/(m^2*Pi^2) ;[o] m -12 (-1) --------- 2 2 m Pi :[font = output; output; inactive; preserveAspect; endGroup] 0 ;[o] 0 :[font = input; dontPreserveAspect; startGroup] NewSeries[x_, NN_] := Sum[12 ((-1)^(m+1)/(m Pi)^2 ) \ Cos[m Pi x], {m,1,NN}] :[font = input; Cclosed; preserveAspect; startGroup] NewSeries[x, 4] :[font = output; output; inactive; preserveAspect; endGroup; endGroup] (12*Cos[Pi*x])/Pi^2 - (3*Cos[2*Pi*x])/Pi^2 + (4*Cos[3*Pi*x])/(3*Pi^2) - (3*Cos[4*Pi*x])/(4*Pi^2) ;[o] 12 Cos[Pi x] 3 Cos[2 Pi x] 4 Cos[3 Pi x] ------------ - ------------- + ------------- - 2 2 2 Pi Pi 3 Pi 3 Cos[4 Pi x] ------------- 2 4 Pi :[font = text; inactive; dontPreserveAspect; endGroup; endGroup] Indeed the same as predicted. The general rule is : The Fourier series is very robust. When it is manipulated in almost any reasonable way, correct and consistent answers result. ;[s] 3:0,0;54,1;88,0;182,-1; 2:2,17,12,Times,0,14,0,0,0;1,17,12,Times,2,14,0,0,0; :[font = subsection; inactive; Cclosed; preserveAspect; fontSize = 18; startGroup] Example: Integrating the series for x - x3. ;[s] 3:0,0;42,1;43,0;45,-1; 2:2,20,14,Times,1,18,0,0,0;1,32,20,Times,33,18,0,0,0; :[font = text; inactive; dontPreserveAspect] Suppose now that we try integrating a Fourier series term by term. If c[0] (which = a[0]) is different from 0, we get another Fourier series! If c[0] is not 0, then we would only get another Fourier series after replacing the function x with a Fourier series, but we won't consider that case now. Does the integrated series converge to the integral of the original function? According to our experiment with differentiation, it seems so. Let us do an experiment, by integrating x - x^3. As before: :[font = input; Cclosed; dontPreserveAspect; startGroup] FSeries[x_, N_] = Sum[-12 (-1)^k Sin[ Pi k x ] /(k Pi)^3, {k, 1, N} ] :[font = output; output; inactive; dontPreserveAspect; endGroup] Sum[(-12*(-1)^k*Sin[Pi*k*x])/(Pi^3*k^3), {k, 1, N}] ;[o] k -12 (-1) Sin[Pi k x] Sum[---------------------, {k, 1, N}] 3 3 Pi k :[font = text; inactive; dontPreserveAspect] Mathematica had difficulties with this one, but it is easy to integrate by hand: ;[s] 2:0,1;11,0;81,-1; 2:1,17,12,Times,0,14,0,0,0;1,17,12,Times,2,14,0,0,0; :[font = input; Cclosed; dontPreserveAspect; startGroup] IntegratedSeries = Sum[12 (-1)^k Cos[ Pi k x ] /(k Pi)^4, {k,1,N} ] :[font = output; output; inactive; dontPreserveAspect; endGroup] Sum[(12*(-1)^k*Cos[k*Pi*x])/(k^4*Pi^4), {k, 1, N}] ;[o] k 12 (-1) Cos[k Pi x] Sum[--------------------, {k, 1, N}] 4 4 k Pi :[font = input; Cclosed; dontPreserveAspect; startGroup] % /. N -> 3 ;[s] 2:0,1;1,0;12,-1; 2:1,14,10,Courier,1,12,0,0,0;1,14,10,Courier,1,12,65535,0,0; :[font = output; output; inactive; dontPreserveAspect; endGroup] (-12*Cos[Pi*x])/Pi^4 + (3*Cos[2*Pi*x])/(4*Pi^4) - (4*Cos[3*Pi*x])/(27*Pi^4) ;[o] -12 Cos[Pi x] 3 Cos[2 Pi x] 4 Cos[3 Pi x] ------------- + ------------- - ------------- 4 4 4 Pi 4 Pi 27 Pi :[font = input; Cclosed; dontPreserveAspect; startGroup] Plot[{x^2/2 - x^4/4, %}, {x,-1,1}] :[font = postscript; PostScript; formatAsPostScript; output; inactive; preserveAspect; pictureLeft = 34; pictureWidth = 282; pictureHeight = 174] %! %%Creator: Mathematica %%AspectRatio: .61803 MathPictureStart %% Graphics /Courier findfont 10 scalefont setfont % Scaling calculations 0.5 0.47619 0.202377 1.60377 [ [(-1)] .02381 .20238 0 2 Msboxa [(-0.5)] .2619 .20238 0 2 Msboxa [(0.5)] .7381 .20238 0 2 Msboxa [(1)] .97619 .20238 0 2 Msboxa [(-0.1)] .4875 .042 1 0 Msboxa [(-0.05)] .4875 .12219 1 0 Msboxa [(0.05)] .4875 .28257 1 0 Msboxa [(0.1)] .4875 .36275 1 0 Msboxa [(0.15)] .4875 .44294 1 0 Msboxa [(0.2)] .4875 .52313 1 0 Msboxa [(0.25)] .4875 .60332 1 0 Msboxa [ -0.001 -0.001 0 0 ] [ 1.001 .61903 0 0 ] ] MathScale % Start of Graphics 1 setlinecap 1 setlinejoin newpath [ ] 0 setdash 0 g p p .002 w .02381 .20238 m .02381 .20863 L s P [(-1)] .02381 .20238 0 2 Mshowa p .002 w .2619 .20238 m .2619 .20863 L s P [(-0.5)] .2619 .20238 0 2 Mshowa p .002 w .7381 .20238 m .7381 .20863 L s P [(0.5)] .7381 .20238 0 2 Mshowa p .002 w .97619 .20238 m .97619 .20863 L s P [(1)] .97619 .20238 0 2 Mshowa p .001 w .07143 .20238 m .07143 .20613 L s P p .001 w .11905 .20238 m .11905 .20613 L s P p .001 w .16667 .20238 m .16667 .20613 L s P p .001 w .21429 .20238 m .21429 .20613 L s P p .001 w .30952 .20238 m .30952 .20613 L s P p .001 w .35714 .20238 m .35714 .20613 L s P p .001 w .40476 .20238 m .40476 .20613 L s P p .001 w .45238 .20238 m .45238 .20613 L s P p .001 w .54762 .20238 m .54762 .20613 L s P p .001 w .59524 .20238 m .59524 .20613 L s P p .001 w .64286 .20238 m .64286 .20613 L s P p .001 w .69048 .20238 m .69048 .20613 L s P p .001 w .78571 .20238 m .78571 .20613 L s P p .001 w .83333 .20238 m .83333 .20613 L s P p .001 w .88095 .20238 m .88095 .20613 L s P p .001 w .92857 .20238 m .92857 .20613 L s P p .002 w 0 .20238 m 1 .20238 L s P p .002 w .5 .042 m .50625 .042 L s P [(-0.1)] .4875 .042 1 0 Mshowa p .002 w .5 .12219 m .50625 .12219 L s P [(-0.05)] .4875 .12219 1 0 Mshowa p .002 w .5 .28257 m .50625 .28257 L s P [(0.05)] .4875 .28257 1 0 Mshowa p .002 w .5 .36275 m .50625 .36275 L s P [(0.1)] .4875 .36275 1 0 Mshowa p .002 w .5 .44294 m .50625 .44294 L s P [(0.15)] .4875 .44294 1 0 Mshowa p .002 w .5 .52313 m .50625 .52313 L s P [(0.2)] .4875 .52313 1 0 Mshowa p .002 w .5 .60332 m .50625 .60332 L s P [(0.25)] .4875 .60332 1 0 Mshowa p .001 w .5 .05804 m .50375 .05804 L s P p .001 w .5 .07408 m .50375 .07408 L s P p .001 w .5 .09011 m .50375 .09011 L s P p .001 w .5 .10615 m .50375 .10615 L s P p .001 w .5 .13823 m .50375 .13823 L s P p .001 w .5 .15426 m .50375 .15426 L s P p .001 w .5 .1703 m .50375 .1703 L s P p .001 w .5 .18634 m .50375 .18634 L s P p .001 w .5 .21841 m .50375 .21841 L s P p .001 w .5 .23445 m .50375 .23445 L s P p .001 w .5 .25049 m .50375 .25049 L s P p .001 w .5 .26653 m .50375 .26653 L s P p .001 w .5 .2986 m .50375 .2986 L s P p .001 w .5 .31464 m .50375 .31464 L s P p .001 w .5 .33068 m .50375 .33068 L s P p .001 w .5 .34672 m .50375 .34672 L s P p .001 w .5 .37879 m .50375 .37879 L s P p .001 w .5 .39483 m .50375 .39483 L s P p .001 w .5 .41087 m .50375 .41087 L s P p .001 w .5 .4269 m .50375 .4269 L s P p .001 w .5 .45898 m .50375 .45898 L s P p .001 w .5 .47502 m .50375 .47502 L s P p .001 w .5 .49106 m .50375 .49106 L s P p .001 w .5 .50709 m .50375 .50709 L s P p .001 w .5 .53917 m .50375 .53917 L s P p .001 w .5 .55521 m .50375 .55521 L s P p .001 w .5 .57124 m .50375 .57124 L s P p .001 w .5 .58728 m .50375 .58728 L s P p .001 w .5 .02596 m .50375 .02596 L s P p .001 w .5 .00992 m .50375 .00992 L s P p .002 w .5 0 m .5 .61803 L s P P 0 0 m 1 0 L 1 .61803 L 0 .61803 L closepath clip newpath p p p .004 w .02381 .60332 m .02505 .60331 L .02629 .60328 L .02753 .60322 L .02877 .60315 L .03125 .60293 L .03373 .60264 L .03869 .6018 L .04365 .60065 L .05357 .59744 L .06349 .59309 L .08333 .58129 L .10317 .56589 L .14286 .52658 L .18254 .47957 L .22222 .42882 L .2619 .37779 L .30159 .32951 L .34127 .28653 L .38095 .25093 L .42063 .22434 L .44048 .21481 L .4504 .21103 L .46032 .20793 L .47024 .2055 L .4752 .20455 L .48016 .20377 L .48512 .20316 L .4876 .20292 L .49008 .20272 L .49256 .20257 L .4938 .20251 L .49504 .20246 L .49628 .20243 L .49752 .2024 L .49876 .20238 L .5 .20238 L .50124 .20238 L .50248 .2024 L .50372 .20243 L .50496 .20246 L .5062 .20251 L .50744 .20257 L .50992 .20272 L .5124 .20292 L .51488 .20316 L .51984 .20377 L .5248 .20455 L .52976 .2055 L .53968 .20793 L Mistroke .55952 .21481 L .57937 .22434 L .61905 .25093 L .65873 .28653 L .69841 .32951 L .7381 .37779 L .77778 .42882 L .81746 .47957 L .85714 .52658 L .87698 .54746 L .89683 .56589 L .91667 .58129 L .92659 .58768 L .93651 .59309 L .94643 .59744 L .95139 .59919 L .95635 .60065 L .96131 .6018 L .96379 .60226 L .96627 .60264 L .96875 .60293 L .96999 .60305 L .97123 .60315 L .97247 .60322 L .97371 .60328 L .97495 .60331 L .97619 .60332 L Mfstroke P P p p .004 w .02381 .41474 m .02505 .41473 L .02629 .4147 L .02753 .41465 L .02877 .41459 L .03125 .41441 L .03373 .41416 L .03621 .41384 L .03869 .41344 L .04365 .41244 L .05357 .40959 L .06349 .40563 L .08333 .39457 L .10317 .37965 L .14286 .34036 L .18254 .29255 L .22222 .24109 L .2619 .19003 L .30159 .14227 L .34127 .09986 L .38095 .0644 L .42063 .03745 L .44048 .02764 L .4504 .02373 L .46032 .02051 L .47024 .01798 L .4752 .01699 L .48016 .01617 L .48512 .01553 L .4876 .01528 L .49008 .01508 L .49256 .01492 L .4938 .01486 L .49504 .01481 L .49628 .01477 L .49752 .01474 L .49876 .01472 L .5 .01472 L .50124 .01472 L .50248 .01474 L .50372 .01477 L .50496 .01481 L .5062 .01486 L .50744 .01492 L .50992 .01508 L .5124 .01528 L .51488 .01553 L .51984 .01617 L .5248 .01699 L .52976 .01798 L Mistroke .53968 .02051 L .55952 .02764 L .57937 .03745 L .61905 .0644 L .65873 .09986 L .69841 .14227 L .7381 .19003 L .77778 .24109 L .81746 .29255 L .85714 .34036 L .87698 .36138 L .89683 .37965 L .91667 .39457 L .92659 .40061 L .93651 .40563 L .94643 .40959 L .95139 .41115 L .95635 .41244 L .96131 .41344 L .96379 .41384 L .96627 .41416 L .96875 .41441 L .96999 .41451 L .97123 .41459 L .97247 .41465 L .97371 .4147 L .97495 .41473 L .97619 .41474 L Mfstroke P P P % End of Graphics MathPictureEnd :[font = output; output; inactive; dontPreserveAspect; endGroup] Graphics["<<>>"] ;[o] -Graphics- :[font = text; inactive; dontPreserveAspect; endGroup; endGroup] Why don't they match? The answer lies in the choice of the constant of integration. The method we used gives us the integral with average 0. This is not the case for x^2/2 - x^4/4. The lesson is: When integrating a Fourier series, take some care about the constant terms. ;[s] 6:0,0;127,1;141,0;169,2;185,0;201,1;278,-1; 3:3,17,12,Times,0,14,0,0,0;2,17,12,Times,2,14,0,0,0;1,16,11,Courier,0,14,0,0,0; ^*)