(*^
::[ 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 = "X Window System Mathematica Notebook Front End Version 2.2";
X11StandardFontEncoding;
fontset = title, inactive, noPageBreakBelow, noPageBreakInGroup, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, e8, 24, fontName, "times";
fontset = subtitle, inactive, noPageBreakBelow, noPageBreakInGroup, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, e6, 18, fontName, "times";
fontset = subsubtitle, inactive, noPageBreakBelow, noPageBreakInGroup, nohscroll, preserveAspect, groupLikeTitle, center, M7, italic, e6, 14, fontName, "times";
fontset = section, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, grayBox, M22, bold, a20, 18, fontName, "times";
fontset = subsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, blackBox, M19, bold, a15, 14, fontName, "times";
fontset = subsubsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, whiteBox, M18, bold, a12, 12, fontName, "times";
fontset = text, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, fontName, "times";
fontset = smalltext, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 10, fontName, "times";
fontset = input, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeInput, M42, N23, bold, 12, fontName, "courier";
fontset = output, output, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L-5, 12, fontName, "courier";
fontset = message, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, 12, fontName, "courier";
fontset = print, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, 12, fontName, "courier";
fontset = info, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, 12, fontName, "courier";
fontset = postscript, PostScript, formatAsPostScript, output, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeGraphics, M7, l34, w282, h287, 12, fontName, "courier";
fontset = name, inactive, noPageBreakInGroup, nohscroll, preserveAspect, M7, italic, B65535, 10, fontName, "times";
fontset = header, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, italic, 12, fontName, "times";
fontset = leftheader, 12, fontName, "times";
fontset = footer, inactive, nohscroll, noKeepOnOnePage, preserveAspect, center, M7, italic, 12, fontName, "times";
fontset = leftfooter, 12, fontName, "times";
fontset = help, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, fontName, "times";
fontset = clipboard, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, fontName, "times";
fontset = completions, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, fontName, "courier";
fontset = special1, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, fontName, "times";
fontset = special2, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, fontName, "times";
fontset = special3, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, fontName, "times";
fontset = special4, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, fontName, "times";
fontset = special5, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, fontName, "times";paletteColors = 128; automaticGrouping; currentKernel;
]
:[font = title; inactive; preserveAspect; cellOutline; left; fontColorRed = 65535; fontColorGreen = 65535; fontColorBlue = 65535; backColorRed = 21845; backColorGreen = 21845; backColorBlue = 21845; startGroup]
This notebook discusses Fourier Cosine series approximations of even functions on a symmetric interval.
:[font = subsection; inactive; preserveAspect; plain; bold; italic; startGroup]
These first nine commands are basic to the rest of this notebook. They are automatically executed if you started this session by "initallizing the notebhook".
:[font = text; inactive; preserveAspect]
We begin by defining the periodic function g[x] and the interval [a,b] over which it is periodic.
;[s]
5:0,0;44,1;48,2;66,3;72,4;99,-1;
5:1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;1,0,0 ,times,0,12,0,0,0;
:[font = input; initialization; preserveAspect]
*)
g[x_]:= If[x<-1,-((x+2)^2)-1,If[x<1,(x^2)+1,(-(x-2)^2)-1]]
(*
:[font = text; inactive; preserveAspect]
This function is periodic with period 2 and completes one period in the interval [-2,2]. Thus, we set
;[s]
3:0,0;83,1;89,2;103,-1;
3:1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;1,0,0 ,times,0,12,0,0,0;
:[font = input; initialization; preserveAspect]
*)
a:=-2
(*
:[font = input; initialization; preserveAspect]
*)
b:=2
(*
:[font = text; inactive; preserveAspect]
For all of these orthogonal series examples, we will use the function p[n,x] to represent the orthogonal functions We are using Cosine functions so we take
;[s]
3:0,0;70,1;76,2;156,-1;
3:1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;1,0,0 ,times,0,12,0,0,0;
:[font = input; initialization; preserveAspect]
*)
p[n_,x_]:=Cos[(n*Pi*x*2 )/(b-a)]
(*
:[font = text; inactive; preserveAspect]
The next line defines a macro that can compute the sum of any number of terms in the Fourier Cosine Series.
:[font = input; initialization; preserveAspect]
*)
s[n_,x_]:= Sum[c[m]*p[m,x],{m,0,n}]
(*
:[font = text; inactive; preserveAspect]
The standard formula in the Kreyszig text, Page ???, defines the coefficients of the series using the following formula.
;[s]
3:0,0;28,1;51,2;120,-1;
3:1,0,0 ,times,0,12,0,0,0;1,0,0 ,Courier,0,12,0,0,0;1,0,0 ,times,0,12,0,0,0;
:[font = input; initialization; preserveAspect]
*)
c[n_]:= NIntegrate[ p[n,x]*g[x]*h[x], {x,a,b}]/
NIntegrate[ p[n,x]*p[n,x]*h[x], {x,a,b}]
(*
:[font = text; inactive; preserveAspect]
Here, h(x) is the weight function. For the periodic trigonometric functions that we will be approximating in this notebook it truns out that we need
:[font = input; initialization; preserveAspect]
*)
h[x_]:=1
(*
:[font = text; inactive; preserveAspect]
Next, we define a way to make Mathematica plot all of the partial sum approximations
s[M, x], s[M+1, x] , s[M+2, x], ...., s[N, x]
on the same coordinate system.
;[s]
5:0,0;30,1;41,2;116,3;168,4;199,-1;
5:1,0,0 ,times,0,12,0,0,0;1,0,0 ,Clean,0,12,0,0,0;1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;1,0,0 ,times,0,12,0,0,0;
:[font = input; initialization; preserveAspect]
*)
plt440[M_,N_]:=Plot[Release[Table[s[n,x],{n,M,N}]],{x,a,b}]
(*
:[font = text; inactive; preserveAspect]
The next command is quite simmilar to the previous one except that it allows us to specifiy the x range we want to plot the series approximation over, aAutomatic part of the command will make sure that the graph will be scaled correctly.
;[s]
7:0,0;96,1;97,2;151,3;157,4;169,5;193,6;269,-1;
7:1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;1,0,0 ,times,0,12,0,0,0;
:[font = input; initialization; preserveAspect]
*)
pl44[ M_, N_, a_, b_ ] :=
Plot[ Release[ Table[ s[n,x], {n,M,N} ] ], {x, a, b},
AspectRatio->Automatic ]
(*
:[font = text; inactive; preserveAspect; cellOutline; plain; bold; fontColorRed = 65535; fontColorGreen = 65535; fontColorBlue = 65535; backColorRed = 21845; backColorGreen = 21845; backColorBlue = 21845; fontName = "Itc Souvenir"]
Note: When you opened this notebook Mathematica asked you if you wanted it initialized. If you clicked "yes" then all of the above definitions are in effect. You can find out if that is true by typeing ?h; Mathematica should tell you that h is defined as h[x_]:=1 ( of course, you can do that for any of the above definitions if you need to look at them. However, you will need to manually execute all of the other commands in this notebook. Also, note we have taken most of the graphs out of this notebook. We are including just a few for your viewing pleasure. You should regenerate them as you go along using the Shift--Enter key.
;[s]
8:0,0;36,1;47,2;205,3;206,4;217,5;617,6;629,7;635,-1;
8:1,0,0 ,Itc Souvenir,1,12,65535,65535,65535;1,0,0 ,Clean,1,14,65535,65535,65535;1,0,0 ,Itc Souvenir,1,12,65535,65535,65535;1,0,0 ,Clean,1,12,65535,65535,65535;1,0,0 ,Clean,1,14,65535,65535,65535;1,0,0 ,Itc Souvenir,1,12,65535,65535,65535;1,0,0 ,Clean,1,12,65535,65535,65535;1,0,0 ,Itc Souvenir,1,12,65535,65535,65535;
:[font = input; preserveAspect; endGroup]
:[font = section; inactive; preserveAspect; plain; bold; italic; fontName = "Times"; startGroup]
Graphing and Calculations for the above example.
:[font = text; inactive; preserveAspect]
First we will start by graphing g[x] over the interval.
;[s]
3:0,0;32,1;37,2;56,-1;
3:1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;1,0,0 ,times,0,12,0,0,0;
:[font = input; preserveAspect; startGroup]
aa=Plot[ g[x], {x,a,b} ]
:[font = postscript; PostScript; formatAsPostScript; output; inactive; preserveAspect; pictureLeft = 34; pictureWidth = 281; pictureHeight = 174]
%!
%%Creator: Mathematica
%%AspectRatio: .61803
MathPictureStart
%% Graphics
/Courier findfont 10 scalefont setfont
% Scaling calculations
0.5 0.238095 0.309017 0.147151 [
[(-2)] .02381 .30902 0 2 Msboxa
[(-1)] .2619 .30902 0 2 Msboxa
[(1)] .7381 .30902 0 2 Msboxa
[(2)] .97619 .30902 0 2 Msboxa
[(-2)] .4875 .01472 1 0 Msboxa
[(-1)] .4875 .16187 1 0 Msboxa
[(1)] .4875 .45617 1 0 Msboxa
[(2)] .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 .30902 m
.02381 .31527 L
s
P
[(-2)] .02381 .30902 0 2 Mshowa
p
.002 w
.2619 .30902 m
.2619 .31527 L
s
P
[(-1)] .2619 .30902 0 2 Mshowa
p
.002 w
.7381 .30902 m
.7381 .31527 L
s
P
[(1)] .7381 .30902 0 2 Mshowa
p
.002 w
.97619 .30902 m
.97619 .31527 L
s
P
[(2)] .97619 .30902 0 2 Mshowa
p
.001 w
.07143 .30902 m
.07143 .31277 L
s
P
p
.001 w
.11905 .30902 m
.11905 .31277 L
s
P
p
.001 w
.16667 .30902 m
.16667 .31277 L
s
P
p
.001 w
.21429 .30902 m
.21429 .31277 L
s
P
p
.001 w
.30952 .30902 m
.30952 .31277 L
s
P
p
.001 w
.35714 .30902 m
.35714 .31277 L
s
P
p
.001 w
.40476 .30902 m
.40476 .31277 L
s
P
p
.001 w
.45238 .30902 m
.45238 .31277 L
s
P
p
.001 w
.54762 .30902 m
.54762 .31277 L
s
P
p
.001 w
.59524 .30902 m
.59524 .31277 L
s
P
p
.001 w
.64286 .30902 m
.64286 .31277 L
s
P
p
.001 w
.69048 .30902 m
.69048 .31277 L
s
P
p
.001 w
.78571 .30902 m
.78571 .31277 L
s
P
p
.001 w
.83333 .30902 m
.83333 .31277 L
s
P
p
.001 w
.88095 .30902 m
.88095 .31277 L
s
P
p
.001 w
.92857 .30902 m
.92857 .31277 L
s
P
p
.002 w
0 .30902 m
1 .30902 L
s
P
p
.002 w
.5 .01472 m
.50625 .01472 L
s
P
[(-2)] .4875 .01472 1 0 Mshowa
p
.002 w
.5 .16187 m
.50625 .16187 L
s
P
[(-1)] .4875 .16187 1 0 Mshowa
p
.002 w
.5 .45617 m
.50625 .45617 L
s
P
[(1)] .4875 .45617 1 0 Mshowa
p
.002 w
.5 .60332 m
.50625 .60332 L
s
P
[(2)] .4875 .60332 1 0 Mshowa
p
.001 w
.5 .04415 m
.50375 .04415 L
s
P
p
.001 w
.5 .07358 m
.50375 .07358 L
s
P
p
.001 w
.5 .10301 m
.50375 .10301 L
s
P
p
.001 w
.5 .13244 m
.50375 .13244 L
s
P
p
.001 w
.5 .1913 m
.50375 .1913 L
s
P
p
.001 w
.5 .22073 m
.50375 .22073 L
s
P
p
.001 w
.5 .25016 m
.50375 .25016 L
s
P
p
.001 w
.5 .27959 m
.50375 .27959 L
s
P
p
.001 w
.5 .33845 m
.50375 .33845 L
s
P
p
.001 w
.5 .36788 m
.50375 .36788 L
s
P
p
.001 w
.5 .39731 m
.50375 .39731 L
s
P
p
.001 w
.5 .42674 m
.50375 .42674 L
s
P
p
.001 w
.5 .4856 m
.50375 .4856 L
s
P
p
.001 w
.5 .51503 m
.50375 .51503 L
s
P
p
.001 w
.5 .54446 m
.50375 .54446 L
s
P
p
.001 w
.5 .57389 m
.50375 .57389 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
.004 w
.02381 .16187 m
.02505 .16186 L
.02629 .16185 L
.02753 .16183 L
.02877 .1618 L
.03125 .16172 L
.03373 .16161 L
.03621 .16147 L
.03869 .16129 L
.04365 .16084 L
.04861 .16027 L
.05357 .15957 L
.06349 .15778 L
.07341 .15548 L
.08333 .15267 L
.10317 .14552 L
.12302 .13632 L
.14286 .12508 L
.18254 .09647 L
.20238 .07909 L
.22222 .05968 L
.24206 .03822 L
.24702 .03253 L
.25198 .02672 L
.25694 .02078 L
.25818 .01928 L
.25942 .01776 L
.26066 .01624 L
.2619 .60332 L
.26438 .60027 L
.26687 .59725 L
.27183 .59131 L
.28175 .57982 L
.30159 .55836 L
.34127 .52157 L
.38095 .49296 L
.40079 .48171 L
.42063 .47252 L
.44048 .46536 L
.4504 .46255 L
.46032 .46026 L
.47024 .45847 L
.4752 .45776 L
.48016 .45719 L
.48512 .45674 L
.4876 .45657 L
.49008 .45642 L
.49256 .45631 L
.4938 .45627 L
.49504 .45623 L
Mistroke
.49628 .4562 L
.49752 .45618 L
.49876 .45617 L
.5 .45617 L
.50124 .45617 L
.50248 .45618 L
.50372 .4562 L
.50496 .45623 L
.5062 .45627 L
.50744 .45631 L
.50992 .45642 L
.5124 .45657 L
.51488 .45674 L
.51984 .45719 L
.5248 .45776 L
.52976 .45847 L
.53968 .46026 L
.5496 .46255 L
.55952 .46536 L
.57937 .47252 L
.59921 .48171 L
.61905 .49296 L
.65873 .52157 L
.67857 .53894 L
.69841 .55836 L
.70833 .56883 L
.71825 .57982 L
.72321 .5855 L
.72817 .59131 L
.73065 .59427 L
.73313 .59725 L
.73438 .59876 L
.73562 .60027 L
.73686 .60179 L
.7381 .01472 L
.73934 .01624 L
.74058 .01776 L
.74306 .02078 L
.74802 .02672 L
.75794 .03822 L
.77778 .05968 L
.81746 .09647 L
.85714 .12508 L
.87698 .13632 L
.89683 .14552 L
.91667 .15267 L
.92659 .15548 L
.93651 .15778 L
.94643 .15957 L
.95139 .16027 L
Mistroke
.95635 .16084 L
.96131 .16129 L
.96379 .16147 L
.96627 .16161 L
.96875 .16172 L
.96999 .16177 L
.97123 .1618 L
.97247 .16183 L
.97371 .16185 L
.97495 .16186 L
.97619 .16187 L
Mfstroke
P
P
% End of Graphics
MathPictureEnd
:[font = output; output; inactive; preserveAspect; endGroup]
Graphics["<<>>"]
;[o]
-Graphics-
:[font = text; inactive; preserveAspect]
Now we will graph it again to use it as a back drop for the approximations and also as an illustration of how to modify existing plots.
:[font = input; preserveAspect; startGroup]
ab=Plot[g[x],{x,a,b},PlotStyle->GrayLevel[.5]]
:[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.238095 0.309017 0.147151 [
[(-2)] .02381 .30902 0 2 Msboxa
[(-1)] .2619 .30902 0 2 Msboxa
[(1)] .7381 .30902 0 2 Msboxa
[(2)] .97619 .30902 0 2 Msboxa
[(-2)] .4875 .01472 1 0 Msboxa
[(-1)] .4875 .16187 1 0 Msboxa
[(1)] .4875 .45617 1 0 Msboxa
[(2)] .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 .30902 m
.02381 .31527 L
s
P
[(-2)] .02381 .30902 0 2 Mshowa
p
.002 w
.2619 .30902 m
.2619 .31527 L
s
P
[(-1)] .2619 .30902 0 2 Mshowa
p
.002 w
.7381 .30902 m
.7381 .31527 L
s
P
[(1)] .7381 .30902 0 2 Mshowa
p
.002 w
.97619 .30902 m
.97619 .31527 L
s
P
[(2)] .97619 .30902 0 2 Mshowa
p
.001 w
.07143 .30902 m
.07143 .31277 L
s
P
p
.001 w
.11905 .30902 m
.11905 .31277 L
s
P
p
.001 w
.16667 .30902 m
.16667 .31277 L
s
P
p
.001 w
.21429 .30902 m
.21429 .31277 L
s
P
p
.001 w
.30952 .30902 m
.30952 .31277 L
s
P
p
.001 w
.35714 .30902 m
.35714 .31277 L
s
P
p
.001 w
.40476 .30902 m
.40476 .31277 L
s
P
p
.001 w
.45238 .30902 m
.45238 .31277 L
s
P
p
.001 w
.54762 .30902 m
.54762 .31277 L
s
P
p
.001 w
.59524 .30902 m
.59524 .31277 L
s
P
p
.001 w
.64286 .30902 m
.64286 .31277 L
s
P
p
.001 w
.69048 .30902 m
.69048 .31277 L
s
P
p
.001 w
.78571 .30902 m
.78571 .31277 L
s
P
p
.001 w
.83333 .30902 m
.83333 .31277 L
s
P
p
.001 w
.88095 .30902 m
.88095 .31277 L
s
P
p
.001 w
.92857 .30902 m
.92857 .31277 L
s
P
p
.002 w
0 .30902 m
1 .30902 L
s
P
p
.002 w
.5 .01472 m
.50625 .01472 L
s
P
[(-2)] .4875 .01472 1 0 Mshowa
p
.002 w
.5 .16187 m
.50625 .16187 L
s
P
[(-1)] .4875 .16187 1 0 Mshowa
p
.002 w
.5 .45617 m
.50625 .45617 L
s
P
[(1)] .4875 .45617 1 0 Mshowa
p
.002 w
.5 .60332 m
.50625 .60332 L
s
P
[(2)] .4875 .60332 1 0 Mshowa
p
.001 w
.5 .04415 m
.50375 .04415 L
s
P
p
.001 w
.5 .07358 m
.50375 .07358 L
s
P
p
.001 w
.5 .10301 m
.50375 .10301 L
s
P
p
.001 w
.5 .13244 m
.50375 .13244 L
s
P
p
.001 w
.5 .1913 m
.50375 .1913 L
s
P
p
.001 w
.5 .22073 m
.50375 .22073 L
s
P
p
.001 w
.5 .25016 m
.50375 .25016 L
s
P
p
.001 w
.5 .27959 m
.50375 .27959 L
s
P
p
.001 w
.5 .33845 m
.50375 .33845 L
s
P
p
.001 w
.5 .36788 m
.50375 .36788 L
s
P
p
.001 w
.5 .39731 m
.50375 .39731 L
s
P
p
.001 w
.5 .42674 m
.50375 .42674 L
s
P
p
.001 w
.5 .4856 m
.50375 .4856 L
s
P
p
.001 w
.5 .51503 m
.50375 .51503 L
s
P
p
.001 w
.5 .54446 m
.50375 .54446 L
s
P
p
.001 w
.5 .57389 m
.50375 .57389 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
.5 g
p
.004 w
.02381 .16187 m
.02505 .16186 L
.02629 .16185 L
.02753 .16183 L
.02877 .1618 L
.03125 .16172 L
.03373 .16161 L
.03621 .16147 L
.03869 .16129 L
.04365 .16084 L
.04861 .16027 L
.05357 .15957 L
.06349 .15778 L
.07341 .15548 L
.08333 .15267 L
.10317 .14552 L
.12302 .13632 L
.14286 .12508 L
.18254 .09647 L
.20238 .07909 L
.22222 .05968 L
.24206 .03822 L
.24702 .03253 L
.25198 .02672 L
.25694 .02078 L
.25818 .01928 L
.25942 .01776 L
.26066 .01624 L
.2619 .60332 L
.26438 .60027 L
.26687 .59725 L
.27183 .59131 L
.28175 .57982 L
.30159 .55836 L
.34127 .52157 L
.38095 .49296 L
.40079 .48171 L
.42063 .47252 L
.44048 .46536 L
.4504 .46255 L
.46032 .46026 L
.47024 .45847 L
.4752 .45776 L
.48016 .45719 L
.48512 .45674 L
.4876 .45657 L
.49008 .45642 L
.49256 .45631 L
.4938 .45627 L
.49504 .45623 L
Mistroke
.49628 .4562 L
.49752 .45618 L
.49876 .45617 L
.5 .45617 L
.50124 .45617 L
.50248 .45618 L
.50372 .4562 L
.50496 .45623 L
.5062 .45627 L
.50744 .45631 L
.50992 .45642 L
.5124 .45657 L
.51488 .45674 L
.51984 .45719 L
.5248 .45776 L
.52976 .45847 L
.53968 .46026 L
.5496 .46255 L
.55952 .46536 L
.57937 .47252 L
.59921 .48171 L
.61905 .49296 L
.65873 .52157 L
.67857 .53894 L
.69841 .55836 L
.70833 .56883 L
.71825 .57982 L
.72321 .5855 L
.72817 .59131 L
.73065 .59427 L
.73313 .59725 L
.73438 .59876 L
.73562 .60027 L
.73686 .60179 L
.7381 .01472 L
.73934 .01624 L
.74058 .01776 L
.74306 .02078 L
.74802 .02672 L
.75794 .03822 L
.77778 .05968 L
.81746 .09647 L
.85714 .12508 L
.87698 .13632 L
.89683 .14552 L
.91667 .15267 L
.92659 .15548 L
.93651 .15778 L
.94643 .15957 L
.95139 .16027 L
Mistroke
.95635 .16084 L
.96131 .16129 L
.96379 .16147 L
.96627 .16161 L
.96875 .16172 L
.96999 .16177 L
.97123 .1618 L
.97247 .16183 L
.97371 .16185 L
.97495 .16186 L
.97619 .16187 L
Mfstroke
P
P
% End of Graphics
MathPictureEnd
:[font = output; output; inactive; preserveAspect; endGroup]
Graphics["<<>>"]
;[o]
-Graphics-
:[font = text; inactive; preserveAspect]
Now we will look at the first 10 coefficents of the series
Note: We left this calculation in to show you that Mathematica has a slight problem
computing these coefficients. This is not unusual for Mathematica and don't be suprised if
you get these error messages when you exicute some of the other commands in this notebook.
;[s]
2:0,0;60,1;329,-1;
2:1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,3,12,0,0,0;
:[font = input; preserveAspect; startGroup]
Table[ c[m], {m,0,9} ]
:[font = message; inactive; preserveAspect]
NIntegrate::ploss:
Numerical integration stopping due to loss of precision.
Achieved neither the requested PrecisionGoal nor
AccuracyGoal; suspect one of the following: highly
oscillatory integrand or the true value of the integral
is 0.
:[font = message; inactive; preserveAspect]
NIntegrate::ploss:
Numerical integration stopping due to loss of precision.
Achieved neither the requested PrecisionGoal nor
AccuracyGoal; suspect one of the following: highly
oscillatory integrand or the true value of the integral
is 0.
:[font = message; inactive; preserveAspect]
NIntegrate::ploss:
Numerical integration stopping due to loss of precision.
Achieved neither the requested PrecisionGoal nor
AccuracyGoal; suspect one of the following: highly
oscillatory integrand or the true value of the integral
is 0.
:[font = message; inactive; preserveAspect]
General::stop:
Further output of NIntegrate::ploss
will be suppressed during this calculation.
:[font = message; inactive; preserveAspect]
NIntegrate::ncvb:
NIntegrate failed to converge to prescribed accuracy
after 7 recursive bisections in x near x = -2..
:[font = output; output; inactive; preserveAspect; endGroup]
{0., 1.514429987607942, 1.704365815147213*10^-16,
-0.810602322347057, -(1.324895054777286*10^-16),
0.501039425079166, 1.760744328116459*10^-16,
-0.360773837557387, -(1.340073885174304*10^-16),
0.2815264158370834}
;[o]
-16 -16
{0., 1.51443, 1.70437 10 , -0.810602, -1.3249 10 ,
-16 -16
0.501039, 1.76074 10 , -0.360774, -1.34007 10 ,
0.281526}
:[font = text; inactive; preserveAspect]
The next command generates the 10-th partial sum of the Fourier Cosine Series using these coeffecients.
;[s]
2:0,0;104,1;105,-1;
2:1,0,0 ,times,0,12,0,0,0;1,0,0 ,Courier,0,12,0,0,0;
:[font = input; preserveAspect]
s[9,x]
:[font = text; inactive; preserveAspect]
Now, let's take a look at the first approximation to the function.
:[font = input; preserveAspect]
bb=pl44[0,0,-4,4]
:[font = text; inactive; preserveAspect]
Compare that to g(x).
;[s]
2:0,0;16,1;21,-1;
2:1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;
:[font = input; preserveAspect]
Show[ab,bb]
:[font = text; inactive; preserveAspect]
Not very close, is it? Well, this is the first term in an infinate series. Let's see if we can get
a better approximation.
:[font = text; inactive; preserveAspect]
The next command will generate and plot the 4-rd, 5-th, and 6-th partial sum approximations. This time the plot will be given on the interval [-4,4].
;[s]
3:0,0;93,1;144,2;151,-1;
3:1,0,0 ,times,0,12,0,0,0;1,0,0 ,Charter,0,12,0,0,0;1,0,0 ,Charter,1,12,0,0,0;
:[font = input; preserveAspect]
bc=pl44[ 3, 5 , -4, 4 ]
:[font = text; inactive; preserveAspect]
Now compare it to g[x].
;[s]
2:0,0;18,1;23,-1;
2:1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;
:[font = input; preserveAspect]
Show[ab,bc]
:[font = text; inactive; preserveAspect]
This approximation is begining to look good. To make it even better we will plot 15 terms in the series. This may take your machine a while to do.
;[s]
4:0,0;104,1;105,2;145,3;146,-1;
4:1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;1,0,0 ,times,3,12,0,0,0;1,0,0 ,times,2,12,0,0,0;
:[font = input; preserveAspect]
bd=pl44[ 14, 14, -4, 4]
:[font = text; inactive; preserveAspect]
Let's take a look.
:[font = input; preserveAspect]
Show[ab,bd]
:[font = text; inactive; preserveAspect]
This approximation is now getting quite close isn't it?
;[s]
3:0,0;26,1;48,2;55,-1;
3:1,0,0 ,times,0,12,0,0,0;1,0,0 ,Charter,0,12,0,0,0;1,0,0 ,times,0,12,0,0,0;
:[font = text; inactive; preserveAspect]
Now we will take a very large number of terms. Warning: if you try this on your machine it may die on you.
Also note that part of the graph near the point (1,2) is not what we would normaly expect to see. It appears not to be symmetric about the Y axis. This is a bug in the Mathematica plotting routines that we must simply live with. The true curve is, of course, symmetric!
;[s]
2:0,0;47,1;384,-1;
2:1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,3,12,0,0,0;
:[font = input; preserveAspect; startGroup]
be=pl44[ 30, 30, -4, 4 ]
:[font = postscript; PostScript; formatAsPostScript; output; inactive; preserveAspect; pictureLeft = 34; pictureWidth = 358; pictureHeight = 199]
%!
%%Creator: Mathematica
%%AspectRatio: .55734
MathPictureStart
%% Graphics
/Courier findfont 10 scalefont setfont
% Scaling calculations
0.5 0.119048 0.278672 0.119048 [
[(-4)] .02381 .27867 0 2 Msboxa
[(-2)] .2619 .27867 0 2 Msboxa
[(2)] .7381 .27867 0 2 Msboxa
[(4)] .97619 .27867 0 2 Msboxa
[(-2)] .4875 .04058 1 0 Msboxa
[(-1)] .4875 .15962 1 0 Msboxa
[(1)] .4875 .39772 1 0 Msboxa
[(2)] .4875 .51677 1 0 Msboxa
[ -0.001 -0.001 0 0 ]
[ 1.001 .55834 0 0 ]
] MathScale
% Start of Graphics
1 setlinecap
1 setlinejoin
newpath
[ ] 0 setdash
0 g
p
p
.002 w
.02381 .27867 m
.02381 .28492 L
s
P
[(-4)] .02381 .27867 0 2 Mshowa
p
.002 w
.2619 .27867 m
.2619 .28492 L
s
P
[(-2)] .2619 .27867 0 2 Mshowa
p
.002 w
.7381 .27867 m
.7381 .28492 L
s
P
[(2)] .7381 .27867 0 2 Mshowa
p
.002 w
.97619 .27867 m
.97619 .28492 L
s
P
[(4)] .97619 .27867 0 2 Mshowa
p
.001 w
.07143 .27867 m
.07143 .28242 L
s
P
p
.001 w
.11905 .27867 m
.11905 .28242 L
s
P
p
.001 w
.16667 .27867 m
.16667 .28242 L
s
P
p
.001 w
.21429 .27867 m
.21429 .28242 L
s
P
p
.001 w
.30952 .27867 m
.30952 .28242 L
s
P
p
.001 w
.35714 .27867 m
.35714 .28242 L
s
P
p
.001 w
.40476 .27867 m
.40476 .28242 L
s
P
p
.001 w
.45238 .27867 m
.45238 .28242 L
s
P
p
.001 w
.54762 .27867 m
.54762 .28242 L
s
P
p
.001 w
.59524 .27867 m
.59524 .28242 L
s
P
p
.001 w
.64286 .27867 m
.64286 .28242 L
s
P
p
.001 w
.69048 .27867 m
.69048 .28242 L
s
P
p
.001 w
.78571 .27867 m
.78571 .28242 L
s
P
p
.001 w
.83333 .27867 m
.83333 .28242 L
s
P
p
.001 w
.88095 .27867 m
.88095 .28242 L
s
P
p
.001 w
.92857 .27867 m
.92857 .28242 L
s
P
p
.002 w
0 .27867 m
1 .27867 L
s
P
p
.002 w
.5 .04058 m
.50625 .04058 L
s
P
[(-2)] .4875 .04058 1 0 Mshowa
p
.002 w
.5 .15962 m
.50625 .15962 L
s
P
[(-1)] .4875 .15962 1 0 Mshowa
p
.002 w
.5 .39772 m
.50625 .39772 L
s
P
[(1)] .4875 .39772 1 0 Mshowa
p
.002 w
.5 .51677 m
.50625 .51677 L
s
P
[(2)] .4875 .51677 1 0 Mshowa
p
.001 w
.5 .06439 m
.50375 .06439 L
s
P
p
.001 w
.5 .0882 m
.50375 .0882 L
s
P
p
.001 w
.5 .11201 m
.50375 .11201 L
s
P
p
.001 w
.5 .13581 m
.50375 .13581 L
s
P
p
.001 w
.5 .18343 m
.50375 .18343 L
s
P
p
.001 w
.5 .20724 m
.50375 .20724 L
s
P
p
.001 w
.5 .23105 m
.50375 .23105 L
s
P
p
.001 w
.5 .25486 m
.50375 .25486 L
s
P
p
.001 w
.5 .30248 m
.50375 .30248 L
s
P
p
.001 w
.5 .32629 m
.50375 .32629 L
s
P
p
.001 w
.5 .3501 m
.50375 .3501 L
s
P
p
.001 w
.5 .37391 m
.50375 .37391 L
s
P
p
.001 w
.5 .42153 m
.50375 .42153 L
s
P
p
.001 w
.5 .44534 m
.50375 .44534 L
s
P
p
.001 w
.5 .46915 m
.50375 .46915 L
s
P
p
.001 w
.5 .49296 m
.50375 .49296 L
s
P
p
.001 w
.5 .01677 m
.50375 .01677 L
s
P
p
.001 w
.5 .54058 m
.50375 .54058 L
s
P
p
.002 w
.5 0 m
.5 .55734 L
s
P
P
0 0 m
1 0 L
1 .55734 L
0 .55734 L
closepath
clip
newpath
p
p
p
.004 w
.02381 .40276 m
.02505 .40218 L
.02629 .40057 L
.02753 .39832 L
.02877 .39598 L
.03001 .39412 L
.03125 .39321 L
.03249 .3935 L
.03373 .39496 L
.04365 .40098 L
.04489 .39894 L
.04613 .39749 L
.04737 .39711 L
.04861 .39799 L
.05109 .40299 L
.05233 .4062 L
.05357 .40907 L
.05481 .41108 L
.05605 .41187 L
.05853 .40991 L
.05977 .40793 L
.06101 .40609 L
.06225 .405 L
.06349 .40513 L
.06845 .4169 L
.06969 .42023 L
.07093 .42248 L
.07217 .42333 L
.07341 .42276 L
.07589 .41906 L
.07713 .41727 L
.07837 .41646 L
.08333 .42772 L
.08457 .43236 L
.08581 .43628 L
.08705 .4388 L
.08829 .43959 L
.08953 .4387 L
.09077 .43662 L
.09201 .43413 L
.09325 .43214 L
.09449 .43151 L
.09573 .43279 L
.09821 .44117 L
.09945 .44716 L
.10069 .45307 L
.10193 .45784 L
.10317 .46066 L
.10441 .46111 L
.10565 .45935 L
Mistroke
.10689 .45609 L
.10813 .45243 L
.10938 .44967 L
.11062 .44898 L
.11186 .45111 L
.1131 .45619 L
.11558 .4724 L
.11682 .48076 L
.11806 .48714 L
.1193 .49025 L
.12054 .48946 L
.12302 .47815 L
.12426 .47075 L
.1255 .46513 L
.12674 .46352 L
.12798 .46749 L
.13046 .49275 L
.13294 .52825 L
.13418 .54077 L
.13542 .54407 L
.13666 .53452 L
.1379 .5098 L
.14038 .41487 L
.14162 .34964 L
.14286 .27867 L
.1441 .2077 L
.14534 .14248 L
.14658 .08794 L
.14782 .04755 L
.14906 .02282 L
.1503 .01327 L
.15278 .0291 L
.15526 .0646 L
.1565 .07982 L
.15774 .08986 L
.15898 .09383 L
.16022 .09221 L
.1627 .07919 L
.16394 .07231 L
.16518 .06788 L
.16642 .0671 L
.16766 .07021 L
.17014 .08495 L
.17138 .09366 L
.17262 .10115 L
.17386 .10624 L
.1751 .10837 L
.17758 .10491 L
.17882 .10126 L
.18006 .09799 L
Mistroke
.1813 .09624 L
.18254 .09669 L
.18378 .0995 L
.18502 .10427 L
.1875 .11617 L
.18874 .12121 L
.18998 .12455 L
.19122 .12584 L
.19246 .1252 L
.20238 .12963 L
.20362 .13419 L
.20486 .13791 L
.2061 .14021 L
.20734 .14088 L
.20858 .14007 L
.20982 .13828 L
.21106 .1362 L
.2123 .13458 L
.21354 .13402 L
.21478 .13486 L
.21726 .14044 L
.21974 .14789 L
.22098 .15069 L
.22222 .15222 L
.22718 .14743 L
.22842 .14595 L
.22966 .14548 L
.23214 .14827 L
.24206 .15636 L
.2433 .1543 L
.24454 .15281 L
.24578 .15231 L
.24702 .153 L
.2495 .15731 L
.25074 .16003 L
.25198 .16238 L
.25322 .16384 L
.25446 .16413 L
.25694 .16136 L
.25818 .15902 L
.25942 .15677 L
.26066 .15516 L
.2619 .15458 L
.26314 .15516 L
.26438 .15677 L
.26563 .15902 L
.26687 .16136 L
.26811 .16322 L
.26935 .16413 L
.27059 .16384 L
Mistroke
.27183 .16238 L
.27307 .16003 L
.27431 .15731 L
.27555 .15478 L
.27679 .153 L
.27803 .15231 L
.27927 .15281 L
.28051 .1543 L
.28175 .15636 L
.28299 .15841 L
.28423 .15985 L
.28547 .16024 L
.28671 .15936 L
.28795 .15728 L
.28919 .15436 L
.29043 .15115 L
.29167 .14827 L
.29291 .14627 L
.29415 .14548 L
.29539 .14595 L
.29663 .14743 L
.29787 .14941 L
.29911 .15126 L
.30035 .15235 L
.30159 .15222 L
.30283 .15069 L
.30407 .14789 L
.30655 .14044 L
.30779 .13711 L
.30903 .13486 L
.31027 .13402 L
.31151 .13458 L
.31399 .13828 L
.31523 .14007 L
.31647 .14088 L
.32143 .12963 L
.32267 .12498 L
.32391 .12107 L
.32515 .11854 L
.32639 .11776 L
.32763 .11864 L
.32887 .12072 L
.33011 .12322 L
.33135 .1252 L
.33259 .12584 L
.33383 .12455 L
.33631 .11617 L
.33755 .11018 L
.33879 .10427 L
.34003 .0995 L
Mistroke
.34127 .09669 L
.34251 .09624 L
.34375 .09799 L
.34499 .10126 L
.34623 .10491 L
.34747 .10767 L
.34871 .10837 L
.34995 .10624 L
.35119 .10115 L
.35243 .09366 L
.35367 .08495 L
.35491 .07659 L
.35615 .07021 L
.35739 .0671 L
.35863 .06788 L
.35987 .07231 L
.36111 .07919 L
.38095 .27867 L
.38343 .41487 L
.38467 .4694 L
.38591 .5098 L
.38715 .53452 L
.38839 .54407 L
.38963 .54077 L
.39087 .52825 L
.39211 .51083 L
.39335 .49275 L
.39459 .47753 L
.39583 .46749 L
.39707 .46352 L
.39831 .46513 L
.39955 .47075 L
.40079 .47815 L
.40203 .48503 L
.40327 .48946 L
.40451 .49025 L
.40575 .48714 L
.40699 .48076 L
.40823 .4724 L
.40947 .46369 L
.41071 .45619 L
.41195 .45111 L
.41319 .44898 L
.41443 .44967 L
.41567 .45243 L
.41691 .45609 L
.41815 .45935 L
.41939 .46111 L
.42063 .46066 L
.42188 .45784 L
Mistroke
.42312 .45307 L
.42436 .44716 L
.4256 .44117 L
.42684 .43613 L
.42808 .43279 L
.42932 .43151 L
.43056 .43214 L
.4318 .43413 L
.43304 .43662 L
.43428 .4387 L
.43552 .43959 L
.43676 .4388 L
.438 .43628 L
.43924 .43236 L
.44048 .42772 L
.44172 .42315 L
.44296 .41944 L
.4442 .41713 L
.44544 .41646 L
.44668 .41727 L
.44792 .41906 L
.44916 .42114 L
.4504 .42276 L
.45164 .42333 L
.45288 .42248 L
.45536 .4169 L
.4566 .41308 L
.45784 .40946 L
.45908 .40666 L
.46032 .40513 L
.46156 .405 L
.4628 .40609 L
.46404 .40793 L
.46528 .40991 L
.46652 .41139 L
.46776 .41187 L
.469 .41108 L
.47024 .40907 L
.47148 .4062 L
.47272 .40299 L
.47396 .40007 L
.4752 .39799 L
.47644 .39711 L
.47768 .39749 L
.47892 .39894 L
.48016 .40098 L
.4814 .40304 L
.48264 .40454 L
.48388 .40503 L
.48512 .40434 L
Mistroke
.48636 .40256 L
.4876 .40004 L
.48884 .39731 L
.49008 .39496 L
.49132 .3935 L
.49256 .39321 L
.4938 .39412 L
.49504 .39598 L
.49628 .39832 L
.49752 .40057 L
.49876 .40218 L
.5 .40276 L
.50124 .40218 L
.50248 .40057 L
.50496 .39598 L
.5062 .39412 L
.50744 .39321 L
.50992 .39496 L
.51984 .40098 L
.52108 .39894 L
.52232 .39749 L
.52356 .39711 L
.5248 .39799 L
.52604 .40007 L
.52728 .40299 L
.52852 .4062 L
.52976 .40907 L
.531 .41108 L
.53224 .41187 L
.53472 .40991 L
.53596 .40793 L
.5372 .40609 L
.53844 .405 L
.53968 .40513 L
.54092 .40666 L
.54216 .40946 L
.5434 .41308 L
.54464 .4169 L
.54588 .42023 L
.54712 .42248 L
.54836 .42333 L
.5496 .42276 L
.55084 .42114 L
.55208 .41906 L
.55332 .41727 L
.55456 .41646 L
.5558 .41713 L
.55704 .41944 L
.55828 .42315 L
.55952 .42772 L
Mistroke
.56076 .43236 L
.562 .43628 L
.56324 .4388 L
.56448 .43959 L
.56572 .4387 L
.56696 .43662 L
.5682 .43413 L
.56944 .43214 L
.57068 .43151 L
.57192 .43279 L
.57316 .43613 L
.5744 .44117 L
.57564 .44716 L
.57688 .45307 L
.57813 .45784 L
.57937 .46066 L
.58061 .46111 L
.58185 .45935 L
.58309 .45609 L
.58433 .45243 L
.58557 .44967 L
.58681 .44898 L
.58805 .45111 L
.58929 .45619 L
.59053 .46369 L
.59177 .4724 L
.59301 .48076 L
.59425 .48714 L
.59549 .49025 L
.59673 .48946 L
.59797 .48503 L
.59921 .47815 L
.61905 .27867 L
.62153 .14248 L
.62277 .08794 L
.62401 .04755 L
.62525 .02282 L
.62649 .01327 L
.62773 .01658 L
.62897 .0291 L
.63021 .04652 L
.63145 .0646 L
.63269 .07982 L
.63393 .08986 L
.63517 .09383 L
.63641 .09221 L
.63765 .0866 L
.63889 .07919 L
.64013 .07231 L
.64137 .06788 L
Mistroke
.64261 .0671 L
.64385 .07021 L
.64509 .07659 L
.64633 .08495 L
.64757 .09366 L
.64881 .10115 L
.65005 .10624 L
.65129 .10837 L
.65253 .10767 L
.65377 .10491 L
.65501 .10126 L
.65625 .09799 L
.65749 .09624 L
.65873 .09669 L
.65997 .0995 L
.66121 .10427 L
.66369 .11617 L
.66493 .12121 L
.66617 .12455 L
.66741 .12584 L
.66865 .1252 L
.67113 .12072 L
.67237 .11864 L
.67361 .11776 L
.67857 .12963 L
.67981 .13419 L
.68105 .13791 L
.68229 .14021 L
.68353 .14088 L
.68477 .14007 L
.68601 .13828 L
.68725 .1362 L
.68849 .13458 L
.68973 .13402 L
.69097 .13486 L
.69345 .14044 L
.69469 .14426 L
.69593 .14789 L
.69717 .15069 L
.69841 .15222 L
.69965 .15235 L
.70089 .15126 L
.70213 .14941 L
.70337 .14743 L
.70461 .14595 L
.70585 .14548 L
.70709 .14627 L
.70833 .14827 L
.70957 .15115 L
.71081 .15436 L
Mistroke
.71205 .15728 L
.71329 .15936 L
.71453 .16024 L
.71577 .15985 L
.71701 .15841 L
.71825 .15636 L
.71949 .1543 L
.72073 .15281 L
.72197 .15231 L
.72321 .153 L
.72445 .15478 L
.72569 .15731 L
.72693 .16003 L
.72817 .16238 L
.72941 .16384 L
.73065 .16413 L
.73189 .16322 L
.73313 .16136 L
.73438 .15902 L
.73562 .15677 L
.73686 .15516 L
.7381 .15458 L
.73934 .15516 L
.74058 .15677 L
.74182 .15902 L
.74306 .16136 L
.7443 .16322 L
.74554 .16413 L
.74678 .16384 L
.74802 .16238 L
.75794 .15636 L
.75918 .15841 L
.76042 .15985 L
.76166 .16024 L
.7629 .15936 L
.76538 .15436 L
.76662 .15115 L
.76786 .14827 L
.7691 .14627 L
.77034 .14548 L
.77282 .14743 L
.77406 .14941 L
.7753 .15126 L
.77654 .15235 L
.77778 .15222 L
.78274 .14044 L
.78398 .13711 L
.78522 .13486 L
.78646 .13402 L
.7877 .13458 L
Mistroke
.79018 .13828 L
.79142 .14007 L
.79266 .14088 L
.79762 .12963 L
.79886 .12498 L
.8001 .12107 L
.80134 .11854 L
.80258 .11776 L
.80382 .11864 L
.80506 .12072 L
.8063 .12322 L
.80754 .1252 L
.80878 .12584 L
.81002 .12455 L
.8125 .11617 L
.81374 .11018 L
.81498 .10427 L
.81622 .0995 L
.81746 .09669 L
.8187 .09624 L
.81994 .09799 L
.82118 .10126 L
.82242 .10491 L
.82366 .10767 L
.8249 .10837 L
.82614 .10624 L
.82738 .10115 L
.82986 .08495 L
.8311 .07659 L
.83234 .07021 L
.83358 .0671 L
.83482 .06788 L
.8373 .07919 L
.83854 .0866 L
.83978 .09221 L
.84102 .09383 L
.84226 .08986 L
.84474 .0646 L
.84722 .0291 L
.84846 .01658 L
.8497 .01327 L
.85094 .02282 L
.85218 .04755 L
.85466 .14248 L
.8559 .2077 L
.85714 .27867 L
.85838 .34964 L
.85962 .41487 L
.86086 .4694 L
.8621 .5098 L
Mistroke
.86334 .53452 L
.86458 .54407 L
.86706 .52825 L
.86954 .49275 L
.87078 .47753 L
.87202 .46749 L
.87326 .46352 L
.8745 .46513 L
.87698 .47815 L
.87822 .48503 L
.87946 .48946 L
.8807 .49025 L
.88194 .48714 L
.88442 .4724 L
.88566 .46369 L
.8869 .45619 L
.88814 .45111 L
.88938 .44898 L
.89187 .45243 L
.89311 .45609 L
.89435 .45935 L
.89559 .46111 L
.89683 .46066 L
.89807 .45784 L
.89931 .45307 L
.90179 .44117 L
.90303 .43613 L
.90427 .43279 L
.90551 .43151 L
.90675 .43214 L
.91667 .42772 L
.91791 .42315 L
.91915 .41944 L
.92039 .41713 L
.92163 .41646 L
.92287 .41727 L
.92411 .41906 L
.92535 .42114 L
.92659 .42276 L
.92783 .42333 L
.92907 .42248 L
.93155 .4169 L
.93403 .40946 L
.93527 .40666 L
.93651 .40513 L
.94147 .40991 L
.94271 .41139 L
.94395 .41187 L
.94643 .40907 L
.95635 .40098 L
Mistroke
.95759 .40304 L
.95883 .40454 L
.96007 .40503 L
.96131 .40434 L
.96379 .40004 L
.96503 .39731 L
.96627 .39496 L
.96751 .3935 L
.96875 .39321 L
.96999 .39412 L
.97123 .39598 L
.97619 .40276 L
Mfstroke
P
P
P
% End of Graphics
MathPictureEnd
:[font = output; output; inactive; preserveAspect; endGroup]
Graphics["<<>>"]
;[o]
-Graphics-
:[font = text; inactive; preserveAspect]
Now compare to g[x]. Again, notice the bug that makes the approximation look bad near the points (1,2) and (-1,-2)
;[s]
3:0,0;15,1;21,2;115,-1;
3:1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;1,0,0 ,times,0,12,0,0,0;
:[font = input; preserveAspect; startGroup]
Show[ab,be]
:[font = postscript; PostScript; formatAsPostScript; output; inactive; preserveAspect; pictureLeft = 34; pictureWidth = 281; pictureHeight = 174]
%!
%%Creator: Mathematica
%%AspectRatio: .61803
MathPictureStart
%% Graphics
/Courier findfont 10 scalefont setfont
% Scaling calculations
0.5 0.119048 0.309017 0.132011 [
[(-4)] .02381 .30902 0 2 Msboxa
[(-2)] .2619 .30902 0 2 Msboxa
[(2)] .7381 .30902 0 2 Msboxa
[(4)] .97619 .30902 0 2 Msboxa
[(-2)] .4875 .045 1 0 Msboxa
[(-1)] .4875 .17701 1 0 Msboxa
[(1)] .4875 .44103 1 0 Msboxa
[(2)] .4875 .57304 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 .30902 m
.02381 .31527 L
s
P
[(-4)] .02381 .30902 0 2 Mshowa
p
.002 w
.2619 .30902 m
.2619 .31527 L
s
P
[(-2)] .2619 .30902 0 2 Mshowa
p
.002 w
.7381 .30902 m
.7381 .31527 L
s
P
[(2)] .7381 .30902 0 2 Mshowa
p
.002 w
.97619 .30902 m
.97619 .31527 L
s
P
[(4)] .97619 .30902 0 2 Mshowa
p
.001 w
.07143 .30902 m
.07143 .31277 L
s
P
p
.001 w
.11905 .30902 m
.11905 .31277 L
s
P
p
.001 w
.16667 .30902 m
.16667 .31277 L
s
P
p
.001 w
.21429 .30902 m
.21429 .31277 L
s
P
p
.001 w
.30952 .30902 m
.30952 .31277 L
s
P
p
.001 w
.35714 .30902 m
.35714 .31277 L
s
P
p
.001 w
.40476 .30902 m
.40476 .31277 L
s
P
p
.001 w
.45238 .30902 m
.45238 .31277 L
s
P
p
.001 w
.54762 .30902 m
.54762 .31277 L
s
P
p
.001 w
.59524 .30902 m
.59524 .31277 L
s
P
p
.001 w
.64286 .30902 m
.64286 .31277 L
s
P
p
.001 w
.69048 .30902 m
.69048 .31277 L
s
P
p
.001 w
.78571 .30902 m
.78571 .31277 L
s
P
p
.001 w
.83333 .30902 m
.83333 .31277 L
s
P
p
.001 w
.88095 .30902 m
.88095 .31277 L
s
P
p
.001 w
.92857 .30902 m
.92857 .31277 L
s
P
p
.002 w
0 .30902 m
1 .30902 L
s
P
p
.002 w
.5 .045 m
.50625 .045 L
s
P
[(-2)] .4875 .045 1 0 Mshowa
p
.002 w
.5 .17701 m
.50625 .17701 L
s
P
[(-1)] .4875 .17701 1 0 Mshowa
p
.002 w
.5 .44103 m
.50625 .44103 L
s
P
[(1)] .4875 .44103 1 0 Mshowa
p
.002 w
.5 .57304 m
.50625 .57304 L
s
P
[(2)] .4875 .57304 1 0 Mshowa
p
.001 w
.5 .0714 m
.50375 .0714 L
s
P
p
.001 w
.5 .0978 m
.50375 .0978 L
s
P
p
.001 w
.5 .1242 m
.50375 .1242 L
s
P
p
.001 w
.5 .1506 m
.50375 .1506 L
s
P
p
.001 w
.5 .20341 m
.50375 .20341 L
s
P
p
.001 w
.5 .22981 m
.50375 .22981 L
s
P
p
.001 w
.5 .25621 m
.50375 .25621 L
s
P
p
.001 w
.5 .28261 m
.50375 .28261 L
s
P
p
.001 w
.5 .33542 m
.50375 .33542 L
s
P
p
.001 w
.5 .36182 m
.50375 .36182 L
s
P
p
.001 w
.5 .38822 m
.50375 .38822 L
s
P
p
.001 w
.5 .41463 m
.50375 .41463 L
s
P
p
.001 w
.5 .46743 m
.50375 .46743 L
s
P
p
.001 w
.5 .49383 m
.50375 .49383 L
s
P
p
.001 w
.5 .52023 m
.50375 .52023 L
s
P
p
.001 w
.5 .54664 m
.50375 .54664 L
s
P
p
.001 w
.5 .01859 m
.50375 .01859 L
s
P
p
.001 w
.5 .59944 m
.50375 .59944 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
.5 g
p
.004 w
.2619 .17701 m
.26252 .177 L
.26314 .17699 L
.26376 .17697 L
.26438 .17695 L
.26563 .17688 L
.26687 .17678 L
.26811 .17665 L
.26935 .17649 L
.27183 .17609 L
.27431 .17557 L
.27679 .17494 L
.28175 .17334 L
.28671 .17128 L
.29167 .16876 L
.30159 .16234 L
.31151 .15409 L
.32143 .144 L
.34127 .11833 L
.35119 .10275 L
.36111 .08533 L
.37103 .06608 L
.37351 .06098 L
.37599 .05577 L
.37847 .05044 L
.37909 .04909 L
.37971 .04773 L
.38033 .04637 L
.38095 .57304 L
.38219 .5703 L
.38343 .5676 L
.38591 .56227 L
.39087 .55195 L
.40079 .5327 L
.42063 .4997 L
.44048 .47403 L
.4504 .46395 L
.46032 .4557 L
.47024 .44928 L
.4752 .44676 L
.48016 .44469 L
.48512 .44309 L
.4876 .44246 L
.49008 .44194 L
.49256 .44154 L
.4938 .44139 L
.49504 .44126 L
.49628 .44116 L
.4969 .44112 L
.49752 .44109 L
Mistroke
.49814 .44106 L
.49876 .44104 L
.49938 .44103 L
.5 .44103 L
.50062 .44103 L
.50124 .44104 L
.50186 .44106 L
.50248 .44109 L
.5031 .44112 L
.50372 .44116 L
.50496 .44126 L
.5062 .44139 L
.50744 .44154 L
.50992 .44194 L
.5124 .44246 L
.51488 .44309 L
.51984 .44469 L
.5248 .44676 L
.52976 .44928 L
.53968 .4557 L
.5496 .46395 L
.55952 .47403 L
.57937 .4997 L
.58929 .51528 L
.59921 .5327 L
.60417 .5421 L
.60913 .55195 L
.61161 .55705 L
.61409 .56227 L
.61533 .56492 L
.61657 .5676 L
.61719 .56895 L
.61781 .5703 L
.61843 .57167 L
.61905 .045 L
.61967 .04637 L
.62029 .04773 L
.62153 .05044 L
.62401 .05577 L
.62897 .06608 L
.63889 .08533 L
.65873 .11833 L
.67857 .144 L
.68849 .15409 L
.69841 .16234 L
.70833 .16876 L
.71329 .17128 L
.71825 .17334 L
.72321 .17494 L
.72569 .17557 L
Mistroke
.72817 .17609 L
.73065 .17649 L
.73189 .17665 L
.73313 .17678 L
.73438 .17688 L
.735 .17692 L
.73562 .17695 L
.73624 .17697 L
.73686 .17699 L
.73748 .177 L
.7381 .17701 L
Mfstroke
P
P
p
p
p
.004 w
.02381 .44662 m
.02505 .44597 L
.02629 .44419 L
.02753 .4417 L
.02877 .4391 L
.03001 .43704 L
.03125 .43603 L
.03249 .43635 L
.03373 .43797 L
.04365 .44464 L
.04489 .44238 L
.04613 .44078 L
.04737 .44035 L
.04861 .44133 L
.05109 .44687 L
.05233 .45043 L
.05357 .45362 L
.05481 .45584 L
.05605 .45671 L
.05853 .45455 L
.05977 .45235 L
.06101 .4503 L
.06225 .4491 L
.06349 .44924 L
.06845 .4623 L
.06969 .46599 L
.07093 .46849 L
.07217 .46942 L
.07341 .4688 L
.07589 .46469 L
.07713 .46271 L
.07837 .46181 L
.08333 .47429 L
.08457 .47944 L
.08581 .48379 L
.08705 .48658 L
.08829 .48745 L
.08953 .48647 L
.09077 .48417 L
.09201 .4814 L
.09325 .4792 L
.09449 .47849 L
.09573 .47992 L
.09821 .48921 L
.09945 .49585 L
.10069 .5024 L
.10193 .5077 L
.10317 .51082 L
.10441 .51132 L
.10565 .50937 L
Mistroke
.10689 .50575 L
.10813 .5017 L
.10938 .49864 L
.11062 .49787 L
.11186 .50023 L
.1131 .50587 L
.11558 .52384 L
.11682 .53311 L
.11806 .54018 L
.1193 .54363 L
.12054 .54276 L
.12302 .53022 L
.12426 .52201 L
.1255 .51578 L
.12674 .51399 L
.12798 .51839 L
.13046 .5464 L
.13294 .58577 L
.13418 .59965 L
.13542 .60332 L
.13666 .59273 L
.1379 .56531 L
.14038 .46004 L
.14162 .38772 L
.14286 .30902 L
.1441 .23032 L
.14534 .15799 L
.14658 .09752 L
.14782 .05273 L
.14906 .02531 L
.1503 .01472 L
.15278 .03226 L
.15526 .07163 L
.1565 .08851 L
.15774 .09964 L
.15898 .10404 L
.16022 .10225 L
.1627 .08781 L
.16394 .08018 L
.16518 .07528 L
.16642 .0744 L
.16766 .07785 L
.17014 .0942 L
.17138 .10386 L
.17262 .11216 L
.17386 .11781 L
.1751 .12017 L
.17758 .11634 L
.17882 .11228 L
.18006 .10866 L
Mistroke
.1813 .10672 L
.18254 .10722 L
.18378 .11034 L
.18502 .11563 L
.1875 .12882 L
.18874 .13441 L
.18998 .13811 L
.19122 .13954 L
.19246 .13884 L
.20238 .14374 L
.20362 .14881 L
.20486 .15293 L
.2061 .15548 L
.20734 .15622 L
.20858 .15533 L
.20982 .15334 L
.21106 .15104 L
.2123 .14923 L
.21354 .14861 L
.21478 .14955 L
.21726 .15573 L
.21974 .16399 L
.22098 .16709 L
.22222 .16879 L
.22718 .16348 L
.22842 .16184 L
.22966 .16132 L
.23214 .16442 L
.24206 .17339 L
.2433 .17111 L
.24454 .16945 L
.24578 .16889 L
.24702 .16966 L
.2495 .17444 L
.25074 .17746 L
.25198 .18006 L
.25322 .18169 L
.25446 .18201 L
.25694 .17893 L
.25818 .17634 L
.25942 .17384 L
.26066 .17206 L
.2619 .17141 L
.26314 .17206 L
.26438 .17384 L
.26563 .17634 L
.26687 .17893 L
.26811 .181 L
.26935 .18201 L
.27059 .18169 L
Mistroke
.27183 .18006 L
.27307 .17746 L
.27431 .17444 L
.27555 .17164 L
.27679 .16966 L
.27803 .16889 L
.27927 .16945 L
.28051 .17111 L
.28175 .17339 L
.28299 .17566 L
.28423 .17726 L
.28547 .17769 L
.28671 .17671 L
.28795 .1744 L
.28919 .17117 L
.29043 .16761 L
.29167 .16442 L
.29291 .1622 L
.29415 .16132 L
.29539 .16184 L
.29663 .16348 L
.29787 .16568 L
.29911 .16773 L
.30035 .16894 L
.30159 .16879 L
.30283 .16709 L
.30407 .16399 L
.30655 .15573 L
.30779 .15204 L
.30903 .14955 L
.31027 .14861 L
.31151 .14923 L
.31399 .15334 L
.31523 .15533 L
.31647 .15622 L
.32143 .14374 L
.32267 .13859 L
.32391 .13425 L
.32515 .13145 L
.32639 .13058 L
.32763 .13156 L
.32887 .13387 L
.33011 .13664 L
.33135 .13884 L
.33259 .13954 L
.33383 .13811 L
.33631 .12882 L
.33755 .12218 L
.33879 .11563 L
.34003 .11034 L
Mistroke
.34127 .10722 L
.34251 .10672 L
.34375 .10866 L
.34499 .11228 L
.34623 .11634 L
.34747 .1194 L
.34871 .12017 L
.34995 .11781 L
.35119 .11216 L
.35243 .10386 L
.35367 .0942 L
.35491 .08493 L
.35615 .07785 L
.35739 .0744 L
.35863 .07528 L
.35987 .08018 L
.36111 .08781 L
.38095 .30902 L
.38343 .46004 L
.38467 .52051 L
.38591 .56531 L
.38715 .59273 L
.38839 .60332 L
.38963 .59965 L
.39087 .58577 L
.39211 .56645 L
.39335 .5464 L
.39459 .52953 L
.39583 .51839 L
.39707 .51399 L
.39831 .51578 L
.39955 .52201 L
.40079 .53022 L
.40203 .53785 L
.40327 .54276 L
.40451 .54363 L
.40575 .54018 L
.40699 .53311 L
.40823 .52384 L
.40947 .51418 L
.41071 .50587 L
.41195 .50023 L
.41319 .49787 L
.41443 .49864 L
.41567 .5017 L
.41691 .50575 L
.41815 .50937 L
.41939 .51132 L
.42063 .51082 L
.42188 .5077 L
Mistroke
.42312 .5024 L
.42436 .49585 L
.4256 .48921 L
.42684 .48362 L
.42808 .47992 L
.42932 .47849 L
.43056 .4792 L
.4318 .4814 L
.43304 .48417 L
.43428 .48647 L
.43552 .48745 L
.43676 .48658 L
.438 .48379 L
.43924 .47944 L
.44048 .47429 L
.44172 .46923 L
.44296 .46511 L
.4442 .46256 L
.44544 .46181 L
.44668 .46271 L
.44792 .46469 L
.44916 .467 L
.4504 .4688 L
.45164 .46942 L
.45288 .46849 L
.45536 .4623 L
.4566 .45806 L
.45784 .45404 L
.45908 .45094 L
.46032 .44924 L
.46156 .4491 L
.4628 .4503 L
.46404 .45235 L
.46528 .45455 L
.46652 .45619 L
.46776 .45671 L
.469 .45584 L
.47024 .45362 L
.47148 .45043 L
.47272 .44687 L
.47396 .44363 L
.4752 .44133 L
.47644 .44035 L
.47768 .44078 L
.47892 .44238 L
.48016 .44464 L
.4814 .44693 L
.48264 .44859 L
.48388 .44914 L
.48512 .44837 L
Mistroke
.48636 .44639 L
.4876 .4436 L
.48884 .44057 L
.49008 .43797 L
.49132 .43635 L
.49256 .43603 L
.4938 .43704 L
.49504 .4391 L
.49628 .4417 L
.49752 .44419 L
.49876 .44597 L
.5 .44662 L
.50124 .44597 L
.50248 .44419 L
.50496 .4391 L
.5062 .43704 L
.50744 .43603 L
.50992 .43797 L
.51984 .44464 L
.52108 .44238 L
.52232 .44078 L
.52356 .44035 L
.5248 .44133 L
.52604 .44363 L
.52728 .44687 L
.52852 .45043 L
.52976 .45362 L
.531 .45584 L
.53224 .45671 L
.53472 .45455 L
.53596 .45235 L
.5372 .4503 L
.53844 .4491 L
.53968 .44924 L
.54092 .45094 L
.54216 .45404 L
.5434 .45806 L
.54464 .4623 L
.54588 .46599 L
.54712 .46849 L
.54836 .46942 L
.5496 .4688 L
.55084 .467 L
.55208 .46469 L
.55332 .46271 L
.55456 .46181 L
.5558 .46256 L
.55704 .46511 L
.55828 .46923 L
.55952 .47429 L
Mistroke
.56076 .47944 L
.562 .48379 L
.56324 .48658 L
.56448 .48745 L
.56572 .48647 L
.56696 .48417 L
.5682 .4814 L
.56944 .4792 L
.57068 .47849 L
.57192 .47992 L
.57316 .48362 L
.5744 .48921 L
.57564 .49585 L
.57688 .5024 L
.57813 .5077 L
.57937 .51082 L
.58061 .51132 L
.58185 .50937 L
.58309 .50575 L
.58433 .5017 L
.58557 .49864 L
.58681 .49787 L
.58805 .50023 L
.58929 .50587 L
.59053 .51418 L
.59177 .52384 L
.59301 .53311 L
.59425 .54018 L
.59549 .54363 L
.59673 .54276 L
.59797 .53785 L
.59921 .53022 L
.61905 .30902 L
.62153 .15799 L
.62277 .09752 L
.62401 .05273 L
.62525 .02531 L
.62649 .01472 L
.62773 .01838 L
.62897 .03226 L
.63021 .05158 L
.63145 .07163 L
.63269 .08851 L
.63393 .09964 L
.63517 .10404 L
.63641 .10225 L
.63765 .09603 L
.63889 .08781 L
.64013 .08018 L
.64137 .07528 L
Mistroke
.64261 .0744 L
.64385 .07785 L
.64509 .08493 L
.64633 .0942 L
.64757 .10386 L
.64881 .11216 L
.65005 .11781 L
.65129 .12017 L
.65253 .1194 L
.65377 .11634 L
.65501 .11228 L
.65625 .10866 L
.65749 .10672 L
.65873 .10722 L
.65997 .11034 L
.66121 .11563 L
.66369 .12882 L
.66493 .13441 L
.66617 .13811 L
.66741 .13954 L
.66865 .13884 L
.67113 .13387 L
.67237 .13156 L
.67361 .13058 L
.67857 .14374 L
.67981 .14881 L
.68105 .15293 L
.68229 .15548 L
.68353 .15622 L
.68477 .15533 L
.68601 .15334 L
.68725 .15104 L
.68849 .14923 L
.68973 .14861 L
.69097 .14955 L
.69345 .15573 L
.69469 .15997 L
.69593 .16399 L
.69717 .16709 L
.69841 .16879 L
.69965 .16894 L
.70089 .16773 L
.70213 .16568 L
.70337 .16348 L
.70461 .16184 L
.70585 .16132 L
.70709 .1622 L
.70833 .16442 L
.70957 .16761 L
.71081 .17117 L
Mistroke
.71205 .1744 L
.71329 .17671 L
.71453 .17769 L
.71577 .17726 L
.71701 .17566 L
.71825 .17339 L
.71949 .17111 L
.72073 .16945 L
.72197 .16889 L
.72321 .16966 L
.72445 .17164 L
.72569 .17444 L
.72693 .17746 L
.72817 .18006 L
.72941 .18169 L
.73065 .18201 L
.73189 .181 L
.73313 .17893 L
.73438 .17634 L
.73562 .17384 L
.73686 .17206 L
.7381 .17141 L
.73934 .17206 L
.74058 .17384 L
.74182 .17634 L
.74306 .17893 L
.7443 .181 L
.74554 .18201 L
.74678 .18169 L
.74802 .18006 L
.75794 .17339 L
.75918 .17566 L
.76042 .17726 L
.76166 .17769 L
.7629 .17671 L
.76538 .17117 L
.76662 .16761 L
.76786 .16442 L
.7691 .1622 L
.77034 .16132 L
.77282 .16348 L
.77406 .16568 L
.7753 .16773 L
.77654 .16894 L
.77778 .16879 L
.78274 .15573 L
.78398 .15204 L
.78522 .14955 L
.78646 .14861 L
.7877 .14923 L
Mistroke
.79018 .15334 L
.79142 .15533 L
.79266 .15622 L
.79762 .14374 L
.79886 .13859 L
.8001 .13425 L
.80134 .13145 L
.80258 .13058 L
.80382 .13156 L
.80506 .13387 L
.8063 .13664 L
.80754 .13884 L
.80878 .13954 L
.81002 .13811 L
.8125 .12882 L
.81374 .12218 L
.81498 .11563 L
.81622 .11034 L
.81746 .10722 L
.8187 .10672 L
.81994 .10866 L
.82118 .11228 L
.82242 .11634 L
.82366 .1194 L
.8249 .12017 L
.82614 .11781 L
.82738 .11216 L
.82986 .0942 L
.8311 .08493 L
.83234 .07785 L
.83358 .0744 L
.83482 .07528 L
.8373 .08781 L
.83854 .09603 L
.83978 .10225 L
.84102 .10404 L
.84226 .09964 L
.84474 .07163 L
.84722 .03226 L
.84846 .01838 L
.8497 .01472 L
.85094 .02531 L
.85218 .05273 L
.85466 .15799 L
.8559 .23032 L
.85714 .30902 L
.85838 .38772 L
.85962 .46004 L
.86086 .52051 L
.8621 .56531 L
Mistroke
.86334 .59273 L
.86458 .60332 L
.86706 .58577 L
.86954 .5464 L
.87078 .52953 L
.87202 .51839 L
.87326 .51399 L
.8745 .51578 L
.87698 .53022 L
.87822 .53785 L
.87946 .54276 L
.8807 .54363 L
.88194 .54018 L
.88442 .52384 L
.88566 .51418 L
.8869 .50587 L
.88814 .50023 L
.88938 .49787 L
.89187 .5017 L
.89311 .50575 L
.89435 .50937 L
.89559 .51132 L
.89683 .51082 L
.89807 .5077 L
.89931 .5024 L
.90179 .48921 L
.90303 .48362 L
.90427 .47992 L
.90551 .47849 L
.90675 .4792 L
.91667 .47429 L
.91791 .46923 L
.91915 .46511 L
.92039 .46256 L
.92163 .46181 L
.92287 .46271 L
.92411 .46469 L
.92535 .467 L
.92659 .4688 L
.92783 .46942 L
.92907 .46849 L
.93155 .4623 L
.93403 .45404 L
.93527 .45094 L
.93651 .44924 L
.94147 .45455 L
.94271 .45619 L
.94395 .45671 L
.94643 .45362 L
.95635 .44464 L
Mistroke
.95759 .44693 L
.95883 .44859 L
.96007 .44914 L
.96131 .44837 L
.96379 .4436 L
.96503 .44057 L
.96627 .43797 L
.96751 .43635 L
.96875 .43603 L
.96999 .43704 L
.97123 .4391 L
.97619 .44662 L
Mfstroke
P
P
P
P
% End of Graphics
MathPictureEnd
:[font = output; output; inactive; preserveAspect; endGroup]
Graphics["<<>>"]
;[o]
-Graphics-
:[font = text; inactive; preserveAspect; plain; bold; italic; endGroup]
We have included the last 2 graphs so that you don't have to exicute this command to see
this approximation.
:[font = section; inactive; preserveAspect; plain; bold; italic; startGroup]
Your Own Example.
:[font = text; inactive; preserveAspect; fontColorRed = 65535; fontColorGreen = 65535; fontColorBlue = 65535; backColorRed = 21845; backColorGreen = 21845; backColorBlue = 21845]
Finaly, we give a sequence of commands that will generate a new example using a function that you must input. You are to edit the Mathematica commands to redefine them to your liking. However, remember that the set of commands that were input for this notebook were set up to handle even functions. Any other choices will result in error messages and lots of garbage. Warning!
Garbage In -> Garbage Out.
;[s]
7:0,0;129,1;141,2;370,3;379,4;412,5;448,6;449,-1;
7:1,0,0 ,times,0,14,65535,65535,65535;1,0,0 ,Clean,0,14,65535,65535,65535;1,0,0 ,times,0,14,65535,65535,65535;1,0,0 ,times,1,14,65535,65535,65535;1,0,0 ,times,0,12,65535,65535,65535;1,0,0 ,times,0,18,65535,65535,65535;1,0,0 ,times,1,12,65535,65535,65535;
:[font = text; inactive; preserveAspect]
First, clear out the old definitions of g[x], a and b.
;[s]
4:0,0;41,1;50,2;54,3;58,-1;
4:1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;
:[font = input; preserveAspect]
Clear[g,a,b]
:[font = text; inactive; preserveAspect]
You may start over at any time by returning to this command. Now edit the next 3 lines to
romove the ? marks and define your own example. Remember you must pick an even function g[x] and a symmetric interval.
;[s]
7:0,0;52,1;65,2;103,3;104,4;181,5;185,6;211,-1;
7:1,0,0 ,times,0,12,0,0,0;1,0,0 ,Charter,0,12,0,0,0;1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;1,0,0 ,times,0,12,0,0,0;
:[font = input; preserveAspect]
g[x_]:= ?
:[font = input; preserveAspect]
b:= ?
:[font = input; preserveAspect]
a:= ?
:[font = text; inactive; preserveAspect]
Now execute the follwoing sequence of commands to generate your example. The new variable Num is the number of terms to be used in the partial sum, initally set to 15.
;[s]
3:0,0;90,1;93,2;167,-1;
3:1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;1,0,0 ,times,0,12,0,0,0;
:[font = input; preserveAspect]
Num := 15
:[font = text; inactive; preserveAspect]
Plot the function g[x]
;[s]
2:0,0;18,1;23,-1;
2:1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;
:[font = input; preserveAspect]
cb=Plot[ g[x], {x,a,b}, PlotStyle -> GrayLevel[.5] ]
:[font = text; inactive; preserveAspect]
Look at the coefficients c[m] for m=0, 1, 2, ..., Num-1
;[s]
4:0,0;25,1;30,2;33,3;55,-1;
4:1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;
:[font = input; preserveAspect]
Table[ c[m], {m,0,Num-1} ]
:[font = text; inactive; preserveAspect]
Look at the formula for the partial sum
:[font = input; preserveAspect]
s[Num-1,x]
:[font = text; inactive; preserveAspect]
To see a plot of the first term exicute the following.
:[font = input; preserveAspect]
da=pl44[0,0,a,b]
:[font = text; inactive; preserveAspect]
And compare to g[x]
;[s]
2:0,0;15,1;19,-1;
2:1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;
:[font = input; preserveAspect]
Show[cb,da]
:[font = text; inactive; preserveAspect]
Just to see how things are going, plot the 4-th, 5-th, and 6-th partial sums
:[font = input; preserveAspect]
db=pl44[3,5, a, b ]
:[font = text; inactive; preserveAspect]
Now compare with g[x]
;[s]
2:0,0;17,1;21,-1;
2:1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;
:[font = input; preserveAspect]
Show[cb,db]
:[font = text; inactive; preserveAspect]
Look at the Num- th partial sum
;[s]
3:0,0;12,1;15,2;31,-1;
3:1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;1,0,0 ,times,0,12,0,0,0;
:[font = input; preserveAspect]
dc=pl44[ Num-1, Num-1, a, b ]
:[font = text; inactive; preserveAspect]
Now compare it to g[x]
;[s]
2:0,0;18,1;22,-1;
2:1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;
:[font = input; preserveAspect]
Show[cb,dc]
:[font = text; inactive; preserveAspect]
Now look at twice as many terms in the partial sums
:[font = input; preserveAspect]
dd=pl44[ (2*Num)-1, (2*Num)-1, a, b ]
:[font = text; inactive; preserveAspect]
and compare it to g[x]
;[s]
2:0,0;18,1;22,-1;
2:1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;
:[font = input; preserveAspect]
Show[cb,dd]
:[font = text; inactive; preserveAspect; endGroup]
You may start over at any time by returning to the Clear[g,a,b] command above.
;[s]
3:0,0;51,1;64,2;78,-1;
3:1,0,0 ,times,0,12,0,0,0;1,0,0 ,courier,1,12,0,0,0;1,0,0 ,Charter,0,12,0,0,0;
:[font = section; inactive; preserveAspect; startGroup]
Here are two example functions you may want to try.
:[font = input; preserveAspect]
g[x_]:=If[x<-1,-1,If[x<1,(x^2)+1,-1]]
a:=-2
b:=2
:[font = input; preserveAspect; endGroup; endGroup]
g[x_]:=If[x<0,x+1,1-x]
a:=-1
b:=1
^*)