(*^ ::[ 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 = "NeXT Mathematica Notebook Front End Version 2.2"; NeXTStandardFontEncoding; fontset = title, inactive, noPageBreakBelow, noPageBreakInGroup, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, L1, e8, 24, "Times"; ; fontset = subtitle, inactive, noPageBreakBelow, noPageBreakInGroup, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, L1, e6, 18, "Times"; ; fontset = subsubtitle, inactive, noPageBreakBelow, noPageBreakInGroup, nohscroll, preserveAspect, groupLikeTitle, center, M7, italic, L1, e6, 14, "Times"; ; fontset = section, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, grayBox, M22, bold, L1, a20, 18, "Times"; ; fontset = subsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, blackBox, M19, bold, L1, a15, 14, "Times"; ; fontset = subsubsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, whiteBox, M18, bold, L1, a12, 12, "Times"; ; fontset = text, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1, 12; fontset = smalltext, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1, 10, "Times"; ; fontset = input, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeInput, M42, N23, bold, L1, 12, "Courier"; ; fontset = output, output, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L-5, 12, "Courier"; ; fontset = message, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L1, 12, "Courier"; ; fontset = print, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L1, 12, "Courier"; ; fontset = info, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L1, 12, "Courier"; ; fontset = postscript, PostScript, formatAsPostScript, output, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeGraphics, M7, l34, w282, h287, L1, 12, "Courier"; ; fontset = name, inactive, noPageBreakInGroup, nohscroll, preserveAspect, M7, italic, B65535, L1, 10, "Times"; ; fontset = header, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, italic, L1, 12, "Times"; ; fontset = leftheader, 12; fontset = footer, inactive, nohscroll, noKeepOnOnePage, preserveAspect, center, M7, italic, L1, 12, "Times"; ; fontset = leftfooter, 12; fontset = help, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1, 12; fontset = clipboard, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1, 12; fontset = completions, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1, 12, "Courier"; ; fontset = special1, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1, 12; fontset = special2, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1, 12; fontset = special3, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1, 12; fontset = special4, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1, 12; fontset = special5, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1, 12; paletteColors = 128; automaticGrouping; currentKernel; ] :[font = title; inactive; preserveAspect; startGroup] Vieta's Formula :[font = subsubtitle; inactive; preserveAspect] by George Beck :[font = text; inactive; preserveAspect] This notebook continues the discussion on aproximating pi by calculating the areas of a circle using inscribed and circumscribed regular polygons. We illustrate Vieta's formula, which is the oldest exact result derived for pi. :[font = section; inactive; preserveAspect; startGroup] The formula :[font = text; inactive; preserveAspect] In PiSqueeze the points are the upper and lower estimates of pi calculated from the areas of polygons of n sides. To get a good approximation we need a lot of sides. The line in the middle is the approximation from Vieta's formula, which calculates the area of a regular polygon of 2^n sides. :[font = input; preserveAspect; startGroup] PiSqueeze[100]; :[font = postscript; PostScript; formatAsPostScript; output; inactive; preserveAspect; pictureLeft = 34; pictureWidth = 282; pictureHeight = 174; endGroup] %! %%Creator: Mathematica %%AspectRatio: .61803 MathPictureStart %% Graphics /Courier findfont 10 scalefont setfont % Scaling calculations 0.02381 0.009718 -20.296827 6.568924 [ [(20)] .21817 .06684 0 2 Msboxa [(40)] .41254 .06684 0 2 Msboxa [(60)] .6069 .06684 0 2 Msboxa [(80)] .80126 .06684 0 2 Msboxa [(100)] .99563 .06684 0 2 Msboxa [(3.12)] .01131 .19821 1 0 Msboxa [(3.14)] .01131 .32959 1 0 Msboxa [(3.16)] .01131 .46097 1 0 Msboxa [(3.18)] .01131 .59235 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 .21817 .06684 m .21817 .07309 L s P [(20)] .21817 .06684 0 2 Mshowa p .002 w .41254 .06684 m .41254 .07309 L s P [(40)] .41254 .06684 0 2 Mshowa p .002 w .6069 .06684 m .6069 .07309 L s P [(60)] .6069 .06684 0 2 Mshowa p .002 w .80126 .06684 m .80126 .07309 L s P [(80)] .80126 .06684 0 2 Mshowa p .002 w .99563 .06684 m .99563 .07309 L s P [(100)] .99563 .06684 0 2 Mshowa p .001 w .06268 .06684 m .06268 .07059 L s P p .001 w .10155 .06684 m .10155 .07059 L s P p .001 w .14043 .06684 m .14043 .07059 L s P p .001 w .1793 .06684 m .1793 .07059 L s P p .001 w .25705 .06684 m .25705 .07059 L s P p .001 w .29592 .06684 m .29592 .07059 L s P p .001 w .33479 .06684 m .33479 .07059 L s P p .001 w .37366 .06684 m .37366 .07059 L s P p .001 w .45141 .06684 m .45141 .07059 L s P p .001 w .49028 .06684 m .49028 .07059 L s P p .001 w .52915 .06684 m .52915 .07059 L s P p .001 w .56803 .06684 m .56803 .07059 L s P p .001 w .64577 .06684 m .64577 .07059 L s P p .001 w .68465 .06684 m .68465 .07059 L s P p .001 w .72352 .06684 m .72352 .07059 L s P p .001 w .76239 .06684 m .76239 .07059 L s P p .001 w .84014 .06684 m .84014 .07059 L s P p .001 w .87901 .06684 m .87901 .07059 L s P p .001 w .91788 .06684 m .91788 .07059 L s P p .001 w .95675 .06684 m .95675 .07059 L s P p .002 w 0 .06684 m 1 .06684 L s P p .002 w .02381 .19821 m .03006 .19821 L s P [(3.12)] .01131 .19821 1 0 Mshowa p .002 w .02381 .32959 m .03006 .32959 L s P [(3.14)] .01131 .32959 1 0 Mshowa p .002 w .02381 .46097 m .03006 .46097 L s P [(3.16)] .01131 .46097 1 0 Mshowa p .002 w .02381 .59235 m .03006 .59235 L s P [(3.18)] .01131 .59235 1 0 Mshowa p .001 w .02381 .09311 m .02756 .09311 L s P p .001 w .02381 .11939 m .02756 .11939 L s P p .001 w .02381 .14566 m .02756 .14566 L s P p .001 w .02381 .17194 m .02756 .17194 L s P p .001 w .02381 .22449 m .02756 .22449 L s P p .001 w .02381 .25077 m .02756 .25077 L s P p .001 w .02381 .27704 m .02756 .27704 L s P p .001 w .02381 .30332 m .02756 .30332 L s P p .001 w .02381 .35587 m .02756 .35587 L s P p .001 w .02381 .38214 m .02756 .38214 L s P p .001 w .02381 .40842 m .02756 .40842 L s P p .001 w .02381 .4347 m .02756 .4347 L s P p .001 w .02381 .48725 m .02756 .48725 L s P p .001 w .02381 .51352 m .02756 .51352 L s P p .001 w .02381 .5398 m .02756 .5398 L s P p .001 w .02381 .56607 m .02756 .56607 L s P p .001 w .02381 .04056 m .02756 .04056 L s P p .001 w .02381 .01428 m .02756 .01428 L s P p .002 w .02381 0 m .02381 .61803 L s P P 0 0 m 1 0 L 1 .61803 L 0 .61803 L closepath clip newpath p p .008 w .03353 -11.76355 Mdot .04325 -7.15898 Mdot .05296 -4.67828 Mdot .06268 -3.23026 Mdot .0724 -2.32156 Mdot .08212 -1.71711 Mdot .09184 -1.29593 Mdot .10155 -0.99125 Mdot .11127 -0.76397 Mdot .12099 -0.59006 Mdot .13071 -0.45408 Mdot .14043 -0.34578 Mdot .15015 -0.25816 Mdot .15986 -0.18628 Mdot .16958 -0.12659 Mdot .1793 -0.07649 Mdot .18902 -0.03403 Mdot .19874 .00226 Mdot .20845 .03353 Mdot .21817 .06065 Mdot .22789 .08433 Mdot .23761 .10512 Mdot .24733 .12348 Mdot .25705 .13977 Mdot .26676 .1543 Mdot .27648 .16729 Mdot .2862 .17898 Mdot .29592 .18951 Mdot .30564 .19905 Mdot .31535 .20771 Mdot .32507 .21559 Mdot .33479 .22279 Mdot .34451 .22939 Mdot .35423 .23544 Mdot .36395 .24101 Mdot .37366 .24615 Mdot .38338 .2509 Mdot .3931 .25529 Mdot .40282 .25937 Mdot .41254 .26316 Mdot .42225 .2667 Mdot .43197 .26999 Mdot .44169 .27307 Mdot .45141 .27594 Mdot .46113 .27864 Mdot .47085 .28117 Mdot .48056 .28355 Mdot .49028 .28578 Mdot .5 .28789 Mdot .50972 .28987 Mdot .51944 .29175 Mdot .52915 .29352 Mdot .53887 .2952 Mdot .54859 .29678 Mdot .55831 .29829 Mdot .56803 .29971 Mdot .57775 .30107 Mdot .58746 .30236 Mdot .59718 .30358 Mdot .6069 .30475 Mdot .61662 .30586 Mdot .62634 .30692 Mdot .63605 .30793 Mdot .64577 .3089 Mdot .65549 .30982 Mdot .66521 .3107 Mdot .67493 .31155 Mdot .68465 .31235 Mdot .69436 .31313 Mdot .70408 .31387 Mdot .7138 .31458 Mdot .72352 .31527 Mdot .73324 .31592 Mdot .74295 .31655 Mdot .75267 .31716 Mdot .76239 .31774 Mdot .77211 .3183 Mdot .78183 .31884 Mdot .79155 .31937 Mdot .80126 .31987 Mdot .81098 .32035 Mdot .8207 .32082 Mdot .83042 .32127 Mdot .84014 .3217 Mdot .84985 .32212 Mdot .85957 .32252 Mdot .86929 .32292 Mdot .87901 .3233 Mdot .88873 .32366 Mdot .89845 .32402 Mdot .90816 .32436 Mdot .91788 .32469 Mdot .9276 .32501 Mdot .93732 .32532 Mdot .94704 .32563 Mdot .95675 .32592 Mdot .96647 .3262 Mdot .97619 .32648 Mdot P p .008 w .03353 13.8363 Mdot .04325 5.97887 Mdot .05296 3.56618 Mdot .06268 2.45859 Mdot .0724 1.84716 Mdot .08212 1.47067 Mdot .09184 1.22121 Mdot .10155 1.0469 Mdot .11127 .92008 Mdot .12099 .82483 Mdot .13071 .7514 Mdot .14043 .69357 Mdot .15015 .64719 Mdot .15986 .60941 Mdot .16958 .57823 Mdot .1793 .55218 Mdot .18902 .5302 Mdot .19874 .51148 Mdot .20845 .4954 Mdot .21817 .48148 Mdot .22789 .46936 Mdot .23761 .45874 Mdot .24733 .44937 Mdot .25705 .44108 Mdot .26676 .43369 Mdot .27648 .42709 Mdot .2862 .42116 Mdot .29592 .41582 Mdot .30564 .41099 Mdot .31535 .40661 Mdot .32507 .40263 Mdot .33479 .39899 Mdot .34451 .39566 Mdot .35423 .3926 Mdot .36395 .38979 Mdot .37366 .3872 Mdot .38338 .38481 Mdot .3931 .38259 Mdot .40282 .38054 Mdot .41254 .37863 Mdot .42225 .37685 Mdot .43197 .37519 Mdot .44169 .37365 Mdot .45141 .3722 Mdot .46113 .37084 Mdot .47085 .36957 Mdot .48056 .36838 Mdot .49028 .36725 Mdot .5 .3662 Mdot .50972 .3652 Mdot .51944 .36426 Mdot .52915 .36337 Mdot .53887 .36253 Mdot .54859 .36173 Mdot .55831 .36098 Mdot .56803 .36026 Mdot .57775 .35958 Mdot .58746 .35893 Mdot .59718 .35832 Mdot .6069 .35773 Mdot .61662 .35718 Mdot .62634 .35665 Mdot .63605 .35614 Mdot .64577 .35565 Mdot .65549 .35519 Mdot .66521 .35475 Mdot .67493 .35433 Mdot .68465 .35392 Mdot .69436 .35353 Mdot .70408 .35316 Mdot .7138 .3528 Mdot .72352 .35246 Mdot .73324 .35213 Mdot .74295 .35182 Mdot .75267 .35151 Mdot .76239 .35122 Mdot .77211 .35094 Mdot .78183 .35067 Mdot .79155 .35041 Mdot .80126 .35016 Mdot .81098 .34992 Mdot .8207 .34968 Mdot .83042 .34946 Mdot .84014 .34924 Mdot .84985 .34903 Mdot .85957 .34883 Mdot .86929 .34863 Mdot .87901 .34844 Mdot .88873 .34826 Mdot .89845 .34808 Mdot .90816 .34791 Mdot .91788 .34774 Mdot .9276 .34758 Mdot .93732 .34742 Mdot .94704 .34727 Mdot .95675 .34713 Mdot .96647 .34698 Mdot .97619 .34685 Mdot P .004 w s s s .05756 0 m .06268 .20771 L s .06268 .20771 m .0724 .30692 L .08212 .33177 L .09184 .33798 L .10155 .33954 L .11127 .33993 L .12099 .34002 L .13071 .34005 L .14043 .34005 L .15015 .34005 L .15986 .34005 L .16958 .34005 L .1793 .34005 L .18902 .34005 L .19874 .34005 L .20845 .34005 L .21817 .34005 L s P % End of Graphics MathPictureEnd :[font = text; inactive; preserveAspect] Vieta's formula gives very good apprximations to pi for quite low values of n. :[font = input; preserveAspect; startGroup] Table[NVieta[n], {n, 10}] :[font = output; output; inactive; preserveAspect; endGroup] {2, 2.82842712474619, 3.061467458920718, 3.121445152258052, 3.136548490545939, 3.140331156954752, 3.141277250932773, 3.141513801144301, 3.141572940367092, 3.14158772527716} ;[o] {2, 2.82843, 3.06147, 3.12145, 3.13655, 3.14033, 3.14128, 3.14151, 3.14157, 3.14159} :[font = text; inactive; pageBreak; preserveAspect] Vieta's formula states that 2 / pi is equal to the infinite product of a sequence of nested square roots. The first 5 terms are shown here. :[font = input; preserveAspect; startGroup] VietaSequence[5] :[font = output; output; inactive; preserveAspect; endGroup] {2^(-1/2), (2 + 2^(1/2))^(1/2)/2, (2 + (2 + 2^(1/2))^(1/2))^(1/2)/2, (2 + (2 + (2 + 2^(1/2))^(1/2))^(1/2))^(1/2)/2, (2 + (2 + (2 + (2 + 2^(1/2))^(1/2))^(1/2))^(1/2))^ (1/2)/2} ;[o] 1 Sqrt[2 + Sqrt[2]] {-------, -----------------, Sqrt[2] 2 Sqrt[2 + Sqrt[2 + Sqrt[2]]] ---------------------------, 2 Sqrt[2 + Sqrt[2 + Sqrt[2 + Sqrt[2]]]] -------------------------------------, 2 Sqrt[2 + Sqrt[2 + Sqrt[2 + Sqrt[2 + Sqrt[2]]]]] -----------------------------------------------} 2 :[font = text; inactive; preserveAspect] The first term is Sqrt[2] / 2, and it has the same form as the others. Mathematica automatically simplified it. :[font = input; preserveAspect; startGroup] Sqrt[2] / 2 :[font = output; output; inactive; preserveAspect; endGroup] 2^(-1/2) ;[o] 1 ------- Sqrt[2] :[font = text; inactive; preserveAspect] This is the 20th term. It gives pi to more than a dozen decimal places. :[font = input; preserveAspect; startGroup] VietaTerm[20] :[font = output; output; inactive; preserveAspect; endGroup; endGroup] (2 + (2 + (2 + (2 + (2 + (2 + (2 + (2 + (2 + (2 + (2 + (2 + (2 + (2 + (2 + (2 + (2 + (2 + (2 + 2^(1/2))^(1/2))^(1/2))^ (1/2))^(1/2))^(1/2))^(1/2))^(1/2))^ (1/2))^(1/2))^(1/2))^(1/2))^(1/2))^ (1/2))^(1/2))^(1/2))^(1/2))^(1/2))^ (1/2))^(1/2)/2 ;[o] Sqrt[2 + Sqrt[2 + Sqrt[2 + Sqrt[2 + Sqrt[2 + Sqrt[2 + Sqrt[2 + Sqrt[2 + Sqrt[2 + Sqrt[2 + Sqrt[2 + Sqrt[2 + Sqrt[2 + Sqrt[2 + Sqrt[2 + Sqrt[2 + Sqrt[2 + Sqrt[2 + Sqrt[2 + Sqrt[2]]]]]]]]]]]] ]]]]]]]] / 2 :[font = section; inactive; pageBreak; preserveAspect; startGroup] Derivation of the formula :[font = text; inactive; preserveAspect] To derive Vieta's formula we need to combine several results from calculus and trigonometry. We won't prove these results but we will illustrate them here. For any x, x / 2^n tends to 0 as n tends to infinity. :[font = subsection; inactive; preserveAspect; startGroup] 2^n Sin[x / 2^n] tends to 1 as n tends to infinity :[font = subsubsection; inactive; preserveAspect; startGroup] Sin[x] / x tends 1 as x tends to 0. ;[s] 1:0,0;36,-1; 1:1,11,8,Times,0,12,0,0,0; :[font = text; inactive; preserveAspect] When x is large Sin[x] and x are rather different. :[font = input; preserveAspect; startGroup] Plot[{x, Sin[x]}, {x, -10, 10}]; :[font = postscript; PostScript; formatAsPostScript; output; inactive; preserveAspect; pictureLeft = 34; pictureWidth = 282; pictureHeight = 112; endGroup] %! %%Creator: Mathematica %%AspectRatio: .39788 MathPictureStart %% Graphics /Courier findfont 10 scalefont setfont % Scaling calculations 0.5 0.047619 0.19894 0.047619 [ [(-10)] .02381 .19894 0 2 Msboxa [(-5)] .2619 .19894 0 2 Msboxa [(5)] .7381 .19894 0 2 Msboxa [(10)] .97619 .19894 0 2 Msboxa [(-4)] .4875 .00846 1 0 Msboxa [(-2)] .4875 .1037 1 0 Msboxa [(2)] .4875 .29418 1 0 Msboxa [(4)] .4875 .38942 1 0 Msboxa [ -0.001 -0.001 0 0 ] [ 1.001 .39888 0 0 ] ] MathScale % Start of Graphics 1 setlinecap 1 setlinejoin newpath [ ] 0 setdash 0 g p p .002 w .02381 .19894 m .02381 .20519 L s P [(-10)] .02381 .19894 0 2 Mshowa p .002 w .2619 .19894 m .2619 .20519 L s P [(-5)] .2619 .19894 0 2 Mshowa p .002 w .7381 .19894 m .7381 .20519 L s P [(5)] .7381 .19894 0 2 Mshowa p .002 w .97619 .19894 m .97619 .20519 L s P [(10)] .97619 .19894 0 2 Mshowa p .001 w .07143 .19894 m .07143 .20269 L s P p .001 w .11905 .19894 m .11905 .20269 L s P p .001 w .16667 .19894 m .16667 .20269 L s P p .001 w .21429 .19894 m .21429 .20269 L s P p .001 w .30952 .19894 m .30952 .20269 L s P p .001 w .35714 .19894 m .35714 .20269 L s P p .001 w .40476 .19894 m .40476 .20269 L s P p .001 w .45238 .19894 m .45238 .20269 L s P p .001 w .54762 .19894 m .54762 .20269 L s P p .001 w .59524 .19894 m .59524 .20269 L s P p .001 w .64286 .19894 m .64286 .20269 L s P p .001 w .69048 .19894 m .69048 .20269 L s P p .001 w .78571 .19894 m .78571 .20269 L s P p .001 w .83333 .19894 m .83333 .20269 L s P p .001 w .88095 .19894 m .88095 .20269 L s P p .001 w .92857 .19894 m .92857 .20269 L s P p .002 w 0 .19894 m 1 .19894 L s P p .002 w .5 .00846 m .50625 .00846 L s P [(-4)] .4875 .00846 1 0 Mshowa p .002 w .5 .1037 m .50625 .1037 L s P [(-2)] .4875 .1037 1 0 Mshowa p .002 w .5 .29418 m .50625 .29418 L s P [(2)] .4875 .29418 1 0 Mshowa p .002 w .5 .38942 m .50625 .38942 L s P [(4)] .4875 .38942 1 0 Mshowa p .001 w .5 .02751 m .50375 .02751 L s P p .001 w .5 .04656 m .50375 .04656 L s P p .001 w .5 .06561 m .50375 .06561 L s P p .001 w .5 .08465 m .50375 .08465 L s P p .001 w .5 .12275 m .50375 .12275 L s P p .001 w .5 .1418 m .50375 .1418 L s P p .001 w .5 .16084 m .50375 .16084 L s P p .001 w .5 .17989 m .50375 .17989 L s P p .001 w .5 .21799 m .50375 .21799 L s P p .001 w .5 .23703 m .50375 .23703 L s P p .001 w .5 .25608 m .50375 .25608 L s P p .001 w .5 .27513 m .50375 .27513 L s P p .001 w .5 .31323 m .50375 .31323 L s P p .001 w .5 .33227 m .50375 .33227 L s P p .001 w .5 .35132 m .50375 .35132 L s P p .001 w .5 .37037 m .50375 .37037 L s P p .002 w .5 0 m .5 .39788 L s P P 0 0 m 1 0 L 1 .39788 L 0 .39788 L closepath clip newpath p p p .004 w s s s s s s s .30106 0 m .30159 .00053 L s .30159 .00053 m .34127 .04021 L .38095 .07989 L .42063 .11957 L .46032 .15926 L .5 .19894 L .53968 .23862 L .57937 .2783 L .61905 .31799 L .65873 .35767 L .69841 .39735 L s .69894 .39788 m .69841 .39735 L s s s s s s s s P P p p .004 w .02381 .22485 m .06349 .18678 L .08333 .16919 L .09325 .16214 L .09821 .1592 L .10317 .15669 L .10813 .15463 L .11062 .15378 L .1131 .15306 L .11558 .15246 L .11806 .15198 L .1193 .15179 L .12054 .15163 L .12178 .15151 L .12302 .15141 L .12426 .15135 L .1255 .15132 L .12674 .15133 L .12798 .15136 L .12922 .15143 L .13046 .15153 L .13294 .15182 L .13418 .15202 L .13542 .15225 L .1379 .1528 L .14286 .15427 L .14782 .15623 L .15278 .15865 L .1627 .16478 L .18254 .18112 L .20238 .20052 L .22222 .21965 L .23214 .22807 L .24206 .23523 L .24702 .23824 L .25198 .24082 L .25694 .24295 L .2619 .2446 L .26438 .24524 L .26687 .24576 L .26935 .24615 L .27059 .24629 L .27183 .24641 L .27307 .24649 L .27431 .24654 L .27555 .24656 L .27679 .24654 L .27803 .2465 L .27927 .24642 L .28051 .24631 L Mistroke .28175 .24616 L .28423 .24578 L .28671 .24527 L .29167 .24387 L .29663 .24199 L .30159 .23964 L .31151 .23365 L .32143 .22616 L .34127 .20801 L .36111 .18832 L .38095 .17044 L .39087 .16317 L .40079 .15744 L .40575 .15524 L .41071 .15351 L .41319 .15283 L .41567 .15227 L .41691 .15204 L .41815 .15184 L .41939 .15167 L .42063 .15154 L .42188 .15144 L .42312 .15137 L .42436 .15133 L .4256 .15132 L .42684 .15135 L .42808 .15141 L .42932 .1515 L .43056 .15162 L .4318 .15178 L .43304 .15196 L .43552 .15243 L .44048 .15375 L .44544 .15556 L .4504 .15783 L .46032 .16369 L .48016 .17967 L .5 .19894 L .51984 .21821 L .52976 .2268 L .53968 .23419 L .54464 .23732 L .5496 .24005 L .55456 .24232 L .55952 .24413 L .562 .24485 L .56448 .24545 L .56696 .24592 L .5682 .2461 L .56944 .24626 L Mistroke .57068 .24638 L .57192 .24647 L .57316 .24653 L .5744 .24656 L .57564 .24655 L .57688 .24651 L .57813 .24644 L .57937 .24634 L .58185 .24604 L .58309 .24584 L .58433 .24561 L .58929 .24437 L .59425 .24264 L .59921 .24044 L .60913 .23471 L .61905 .22744 L .65873 .18987 L .67857 .17172 L .68849 .16423 L .69841 .15824 L .70337 .15589 L .70833 .15401 L .71081 .15325 L .71329 .15261 L .71577 .1521 L .71701 .15189 L .71825 .15172 L .71949 .15157 L .72073 .15146 L .72197 .15138 L .72321 .15134 L .72445 .15132 L .72569 .15134 L .72693 .15139 L .72817 .15147 L .72941 .15158 L .73065 .15173 L .73313 .15212 L .73562 .15264 L .7381 .15328 L .74306 .15493 L .74802 .15706 L .75794 .16265 L .77778 .17823 L .79762 .19736 L .81746 .21676 L .8373 .2331 L .84722 .23923 L .85218 .24165 L .85714 .24361 L Mistroke .85962 .24441 L .8621 .24508 L .86458 .24563 L .86706 .24605 L .8683 .24622 L .86954 .24635 L .87078 .24645 L .87202 .24652 L .87326 .24655 L .8745 .24656 L .87574 .24653 L .87698 .24647 L .87822 .24637 L .87946 .24625 L .88194 .2459 L .88442 .24542 L .8869 .24482 L .89187 .24325 L .89683 .24119 L .90675 .23574 L .91667 .22869 L .93651 .21109 L .97619 .17303 L Mfstroke P P P % End of Graphics MathPictureEnd :[font = text; inactive; preserveAspect] But when x is small Sin[x] and x are aproximately the same. :[font = input; preserveAspect; startGroup] Plot[{x, Sin[x]}, {x, -1, 1}]; :[font = postscript; PostScript; formatAsPostScript; output; inactive; preserveAspect; pictureLeft = 75; pictureTop = 2; pictureWidth = 203; pictureHeight = 203; endGroup] %! %%Creator: Mathematica %%AspectRatio: 1 MathPictureStart %% Graphics /Courier findfont 10 scalefont setfont % Scaling calculations 0.5 0.47619 0.5 0.47619 [ [(-1)] .02381 .5 0 2 Msboxa [(-0.5)] .2619 .5 0 2 Msboxa [(0.5)] .7381 .5 0 2 Msboxa [(1)] .97619 .5 0 2 Msboxa [(-1)] .4875 .02381 1 0 Msboxa [(-0.5)] .4875 .2619 1 0 Msboxa [(0.5)] .4875 .7381 1 0 Msboxa [(1)] .4875 .97619 1 0 Msboxa [ -0.001 -0.001 0 0 ] [ 1.001 1.001 0 0 ] ] MathScale % Start of Graphics 1 setlinecap 1 setlinejoin newpath [ ] 0 setdash 0 g p p .002 w .02381 .5 m .02381 .50625 L s P [(-1)] .02381 .5 0 2 Mshowa p .002 w .2619 .5 m .2619 .50625 L s P [(-0.5)] .2619 .5 0 2 Mshowa p .002 w .7381 .5 m .7381 .50625 L s P [(0.5)] .7381 .5 0 2 Mshowa p .002 w .97619 .5 m .97619 .50625 L s P [(1)] .97619 .5 0 2 Mshowa p .001 w .07143 .5 m .07143 .50375 L s P p .001 w .11905 .5 m .11905 .50375 L s P p .001 w .16667 .5 m .16667 .50375 L s P p .001 w .21429 .5 m .21429 .50375 L s P p .001 w .30952 .5 m .30952 .50375 L s P p .001 w .35714 .5 m .35714 .50375 L s P p .001 w .40476 .5 m .40476 .50375 L s P p .001 w .45238 .5 m .45238 .50375 L s P p .001 w .54762 .5 m .54762 .50375 L s P p .001 w .59524 .5 m .59524 .50375 L s P p .001 w .64286 .5 m .64286 .50375 L s P p .001 w .69048 .5 m .69048 .50375 L s P p .001 w .78571 .5 m .78571 .50375 L s P p .001 w .83333 .5 m .83333 .50375 L s P p .001 w .88095 .5 m .88095 .50375 L s P p .001 w .92857 .5 m .92857 .50375 L s P p .002 w 0 .5 m 1 .5 L s P p .002 w .5 .02381 m .50625 .02381 L s P [(-1)] .4875 .02381 1 0 Mshowa p .002 w .5 .2619 m .50625 .2619 L s P [(-0.5)] .4875 .2619 1 0 Mshowa p .002 w .5 .7381 m .50625 .7381 L s P [(0.5)] .4875 .7381 1 0 Mshowa p .002 w .5 .97619 m .50625 .97619 L s P [(1)] .4875 .97619 1 0 Mshowa p .001 w .5 .07143 m .50375 .07143 L s P p .001 w .5 .11905 m .50375 .11905 L s P p .001 w .5 .16667 m .50375 .16667 L s P p .001 w .5 .21429 m .50375 .21429 L s P p .001 w .5 .30952 m .50375 .30952 L s P p .001 w .5 .35714 m .50375 .35714 L s P p .001 w .5 .40476 m .50375 .40476 L s P p .001 w .5 .45238 m .50375 .45238 L s P p .001 w .5 .54762 m .50375 .54762 L s P p .001 w .5 .59524 m .50375 .59524 L s P p .001 w .5 .64286 m .50375 .64286 L s P p .001 w .5 .69048 m .50375 .69048 L s P p .001 w .5 .78571 m .50375 .78571 L s P p .001 w .5 .83333 m .50375 .83333 L s P p .001 w .5 .88095 m .50375 .88095 L s P p .001 w .5 .92857 m .50375 .92857 L s P p .002 w .5 0 m .5 1 L s P P 0 0 m 1 0 L 1 1 L 0 1 L closepath clip newpath p p p .004 w .02381 .02381 m .06349 .06349 L .10317 .10317 L .14286 .14286 L .18254 .18254 L .22222 .22222 L .2619 .2619 L .30159 .30159 L .34127 .34127 L .38095 .38095 L .42063 .42063 L .46032 .46032 L .5 .5 L .53968 .53968 L .57937 .57937 L .61905 .61905 L .65873 .65873 L .69841 .69841 L .7381 .7381 L .77778 .77778 L .81746 .81746 L .85714 .85714 L .89683 .89683 L .93651 .93651 L .97619 .97619 L s P P p p .004 w .02381 .0993 m .06349 .12211 L .10317 .14753 L .14286 .17541 L .18254 .20554 L .22222 .23771 L .2619 .2717 L .30159 .30728 L .34127 .34419 L .38095 .38219 L .42063 .421 L .46032 .46036 L .5 .5 L .53968 .53964 L .57937 .579 L .61905 .61781 L .65873 .65581 L .69841 .69272 L .7381 .7283 L .77778 .76229 L .81746 .79446 L .85714 .82459 L .89683 .85247 L .93651 .87789 L .97619 .9007 L s P P P % End of Graphics MathPictureEnd :[font = text; inactive; pageBreak; preserveAspect] Mathematically this is expressed in terms of limits. :[font = input; preserveAspect; startGroup] Limit[Sin[x] / x, x -> 0] :[font = output; output; inactive; preserveAspect; endGroup] 1 ;[o] 1 :[font = text; inactive; preserveAspect] If x is any fixed number, x / 2^n tends to 0 as n gets large. :[font = input; preserveAspect; startGroup] Limit[1 / 2^n, n -> Infinity] :[font = output; output; inactive; preserveAspect; endGroup] 0 ;[o] 0 :[font = text; inactive; preserveAspect] So Sin[x / 2^n] / (1 / 2^n)] will tend to x. :[font = input; preserveAspect; startGroup] Limit[Sin[x / 2^n] / (1 / 2^n), n -> Infinity] :[font = output; output; inactive; preserveAspect; endGroup] x ;[o] x :[font = text; inactive; preserveAspect] This limit can be rewritten more simply as follows, since 1 / (1 / 2^n) is 2^n. :[font = input; preserveAspect; startGroup] Limit[2^n Sin[x / 2^n], n -> Infinity] :[font = output; output; inactive; preserveAspect; endGroup; endGroup; endGroup] x ;[o] x :[font = subsection; inactive; pageBreak; preserveAspect; startGroup] Euler's formula :[font = text; inactive; preserveAspect] We apply and keep reapplying the rule Sin[x] -> 2 Cos[x/2] Sin[x/2]. :[font = input; preserveAspect] SinRule = Sin[z_] :> 2 Cos[z/2] Sin[z/2]; :[font = input; preserveAspect; startGroup] y = Sin[x]; z = {y}; Do[y = y /. SinRule; z = Append[z, y], {5}]; TableForm[z] :[font = output; output; inactive; preserveAspect; endGroup] TableForm[{Sin[x], 2*Cos[x/2]*Sin[x/2], 4*Cos[x/4]*Cos[x/2]*Sin[x/4], 8*Cos[x/8]*Cos[x/4]*Cos[x/2]*Sin[x/8], 16*Cos[x/16]*Cos[x/8]*Cos[x/4]*Cos[x/2]*Sin[x/16], 32*Cos[x/32]*Cos[x/16]*Cos[x/8]*Cos[x/4]*Cos[x/2]* Sin[x/32]}] ;[o] Sin[x] x x 2 Cos[-] Sin[-] 2 2 x x x 4 Cos[-] Cos[-] Sin[-] 4 2 4 x x x x 8 Cos[-] Cos[-] Cos[-] Sin[-] 8 4 2 8 x x x x x 16 Cos[--] Cos[-] Cos[-] Cos[-] Sin[--] 16 8 4 2 16 x x x x x x 32 Cos[--] Cos[--] Cos[-] Cos[-] Cos[-] Sin[--] 32 16 8 4 2 32 :[font = text; inactive; preserveAspect] Each of these products is equal to Sin[x]. As n tends to infinity the product of the first and last terms tends to x, as we saw above. Taking the limit and dividing by x, we get a formula of Euler: :[font = input; preserveAspect; startGroup] Sin[x] / x == Product[Cos[x / 2^n], {n, 1, Infinity}] :[font = output; output; inactive; preserveAspect; endGroup; endGroup] Sin[x]/x == Product[Cos[x/2^n], {n, 1, DirectedInfinity[1]}] ;[o] Sin[x] x ------ == Product[Cos[--], {n, 1, Infinity}] x n 2 :[font = subsection; inactive; pageBreak; preserveAspect; startGroup] Vieta's formula :[font = text; inactive; preserveAspect] We substitute pi/2 for x. :[font = input; preserveAspect; startGroup] % /. x -> Pi / 2 :[font = output; output; inactive; preserveAspect; endGroup] 2/Pi == Product[Cos[Pi/(2*2^n)], {n, 1, DirectedInfinity[1]}] ;[o] 2 Pi -- == Product[Cos[----], {n, 1, Infinity}] Pi n 2 2 :[font = text; inactive; preserveAspect] All that is left to do is to verify that the cosines are nested square roots. Mathematically this would be proved by induction. Here we illustrate the result for one term by defining a second rule that we apply repeatedly. :[font = input; preserveAspect] CosRule = Cos[z_] :> Sqrt[(Cos[2 z] + 1) / 2]; :[font = input; preserveAspect; startGroup] Cos[Pi / 2 ^ 6] //. CosRule :[font = output; output; inactive; preserveAspect; endGroup] (1 + (1 + (1 + (1 + 2^(-1/2))^(1/2)/2^(1/2))^(1/2)/ 2^(1/2))^(1/2)/2^(1/2))^(1/2)/2^(1/2) ;[o] 1 Sqrt[1 + -------] Sqrt[2] Sqrt[1 + -----------------] Sqrt[2] Sqrt[1 + ---------------------------] Sqrt[2] Sqrt[1 + -------------------------------------] Sqrt[2] ----------------------------------------------- Sqrt[2] :[font = text; inactive; preserveAspect] This simplifies to the previous form of nested square roots. :[font = input; preserveAspect; startGroup] Simplify[%] :[font = output; output; inactive; preserveAspect; endGroup] (2 + (2 + (2 + (2 + 2^(1/2))^(1/2))^(1/2))^(1/2))^ (1/2)/2 ;[o] Sqrt[2 + Sqrt[2 + Sqrt[2 + Sqrt[2 + Sqrt[2]]]]] ----------------------------------------------- 2 :[font = text; inactive; preserveAspect; endGroup; endGroup] For numerical calculations it is much faster to use N early (as in the definition of NVieta) and to avoid such symbolic formulas. :[font = section; inactive; pageBreak; preserveAspect; startGroup] Implementation :[font = input; initialization; preserveAspect] *) SetOptions[Plot, AspectRatio -> Automatic]; (* :[font = input; initialization; preserveAspect] *) Needs["Calculus`Limit`"] (* :[font = subsection; inactive; preserveAspect; startGroup] Usage messages :[font = input; initialization; preserveAspect] *) PiInterval::usage = "PiInterval[n] gives the areas of the inscribed and circumscribed regular polygons of a unit circle."; (* :[font = input; initialization; preserveAspect] *) PiSqueeze::usage = "PiSqueeze[n] gives a graph of the upper and lower bounds to pi based on inscribed and circumscribed polygons of n sides, together with a graph of Vieta's formula."; (* :[font = input; initialization; preserveAspect] *) NVieta::usage = "NVieta[n] gives an approximation to pi using a product of n terms."; (* :[font = input; initialization; preserveAspect] *) VietaSequence::usage = "VietaSequence[n] gives the first n terms of Vieta's formula."; (* :[font = input; initialization; preserveAspect; endGroup] *) VietaTerm::usage = "VietaTerm[n] gives the n-th term of Vieta's formula."; (* :[font = subsection; inactive; pageBreak; preserveAspect; startGroup] Function definitions :[font = input; initialization; preserveAspect] *) PiInterval[n_] := {n/2 Sin[N[Pi] / n], n Tan[N[Pi] / n]} (* :[font = input; initialization; preserveAspect] *) PiSqueeze[n_] := Module[ {a, lower, upper, middle, i}, a = 2 N[Pi] / i; lower = ListPlot[ Table[ i / 2 Sin[2 N[Pi] / i], {i, 3, n} ], DisplayFunction -> Identity ]; upper = ListPlot[Table[i Tan[N[Pi] / i], {i, 3, n}], DisplayFunction -> Identity]; middle = ListPlot[Table[NVieta[i], {i, Max[20, Floor @ Log @ n]}], DisplayFunction -> Identity, PlotJoined -> True]; Show[{lower, upper, middle}, DisplayFunction -> $DisplayFunction] ] (* :[font = input; initialization; preserveAspect] *) NVieta[n_] := 2 / NProduct[Cos[Pi / 2^i], {i, 2, n}] (* :[font = input; initialization; preserveAspect] *) VietaTerm[n_] := Fold[Sqrt[#2 + #1]&, 0, Table[2, {n}]] / 2 (* :[font = input; initialization; preserveAspect; endGroup; endGroup; endGroup] *) VietaSequence[n_] := Rest @ FoldList[Sqrt[#2 + #1]&, 0, Table[2, {n}]] / 2 (* ^*)