Lucas Kent e39465ad2f Changes to be committed:
new file:   Files/flashplayer_32_sa.exe
	new file:   favicon.ico
	new file:   globe.gif
	new file:   imgs/download.png
	new file:   imgs/zuck.jpg
	new file:   index.html
	new file:   other.ico
	new file:   script.js
	new file:   site.webmanifest
	new file:   sitemap.html
	new file:   styles/backround.css
	new file:   styles/border.css
	new file:   styles/fonts/Titillium_Web/OFL.txt
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-Black.ttf
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-Bold.ttf
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-BoldItalic.ttf
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-ExtraLight.ttf
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-ExtraLightItalic.ttf
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-Italic.ttf
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-Light.ttf
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-LightItalic.ttf
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-Regular.ttf
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-SemiBold.ttf
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-SemiBoldItalic.ttf
	new file:   styles/fonts/webfontkit-20221027-163353/generator_config.txt
	new file:   styles/fonts/webfontkit-20221027-163353/specimen_files/grid_12-825-55-15.css
	new file:   styles/fonts/webfontkit-20221027-163353/specimen_files/specimen_stylesheet.css
	new file:   styles/fonts/webfontkit-20221027-163353/stylesheet.css
	new file:   styles/fonts/webfontkit-20221027-163353/titilliumweb-extralight-demo.html
	new file:   styles/fonts/webfontkit-20221027-163353/titilliumweb-extralight-webfont.woff
	new file:   styles/fonts/webfontkit-20221027-163353/titilliumweb-extralight-webfont.woff2
	new file:   styles/fonts/webfontkit-20221027-165950/generator_config.txt
	new file:   styles/fonts/webfontkit-20221027-165950/specimen_files/grid_12-825-55-15.css
	new file:   styles/fonts/webfontkit-20221027-165950/specimen_files/specimen_stylesheet.css
	new file:   styles/fonts/webfontkit-20221027-165950/stylesheet.css
	new file:   styles/fonts/webfontkit-20221027-165950/titilliumweb-bold-demo.html
	new file:   styles/fonts/webfontkit-20221027-165950/titilliumweb-bold-webfont.woff
	new file:   styles/fonts/webfontkit-20221027-165950/titilliumweb-bold-webfont.woff2
	new file:   styles/style.css
	new file:   tools/2048/.gitignore
	new file:   tools/2048/.jshintrc
	new file:   tools/2048/CONTRIBUTING.md
	new file:   tools/2048/LICENSE.txt
	new file:   tools/2048/README.md
	new file:   tools/2048/Rakefile
	new file:   tools/2048/favicon.ico
	new file:   tools/2048/index.html
	new file:   tools/2048/js/animframe_polyfill.js
	new file:   tools/2048/js/application.js
	new file:   tools/2048/js/bind_polyfill.js
	new file:   tools/2048/js/classlist_polyfill.js
	new file:   tools/2048/js/game_manager.js
	new file:   tools/2048/js/grid.js
	new file:   tools/2048/js/html_actuator.js
	new file:   tools/2048/js/keyboard_input_manager.js
	new file:   tools/2048/js/local_storage_manager.js
	new file:   tools/2048/js/tile.js
    new file:   tools/2048/meta/apple-touch-icon.png
	new file:   tools/webretro/cores/neocd_libretro.js
	new file:   tools/webretro/cores/neocd_libretro.wasm
	new file:   tools/webretro/cores/nestopia_libretro.js
	new file:   tools/webretro/cores/nestopia_libretro.wasm
	new file:   tools/webretro/cores/o2em_libretro.js
	new file:   tools/webretro/cores/o2em_libretro.wasm
	new file:   tools/webretro/cores/opera_libretro.js
	new file:   tools/webretro/cores/opera_libretro.wasm
2022-11-02 08:40:01 -04:00

316 lines
17 KiB
HTML

<!doctype html>
<html lang="en"><!-- #BeginTemplate "/Templates/Advanced.dwt" --><!-- DW6 -->
<!-- Mirrored from www.mathsisfun.com/algebra/taylor-series.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 29 Oct 2022 00:49:08 GMT -->
<head>
<!-- #BeginEditable "doctitle" -->
<title>Taylor Series</title>
<meta name="description" content="Math explained in easy language, plus puzzles, games, quizzes, worksheets and a forum. For K-12 kids, teachers and parents." />
<!-- #EndEditable -->
<meta name="keywords" content="math, maths, mathematics, school, homework, education" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width; initial-scale=1.0; user-scalable=true;" />
<meta name="HandheldFriendly" content="true"/>
<meta http-equiv="pics-label" content='(PICS-1.1 "http://www.classify.org/safesurf/" L gen true for "http://www.mathsisfun.com" r (SS~~000 1))' />
<link rel="stylesheet" type="text/css" href="../style3.css" />
<script src="../main3.js" type="text/javascript"></script>
</head>
<body id="bodybg" class="adv">
<div class="bg">
<div id="stt"></div>
<div id="hdr"></div>
<div id="logo"><a href="../index.html"><img src="../images/style/logo.svg" alt="Math is Fun" /></a></div>
<div id="advText">Advanced</div>
<div id="gtran"><script type="text/javascript">document.write(getTrans());</script></div>
<div id="gplus"><script type="text/javascript">document.write(getGPlus());</script></div>
<div id="adTopOuter" class="centerfull noprint">
<div id="adTop">
<script type="text/javascript">document.write(getAdTop());</script>
</div>
</div>
<div id="adHide">
<div id="showAds1"><a href="javascript:showAds()">Show Ads</a></div>
<div id="hideAds1"><a href="javascript:hideAds()">Hide Ads</a><br>
<a href="../about-ads.html">About Ads</a></div>
</div>
<div id="menuWide" class="menu">
<script type="text/javascript">document.write(getMenu(0));</script>
</div>
<div id="linkto">
<div id="linktort"><script type="text/javascript">document.write(getLinks());</script></div>
</div>
<div id="search" role="search"><script type="text/javascript">document.write(getSearch());</script></div>
<div id="menuSlim" class="menu">
<script type="text/javascript">document.write(getMenu(1));</script>
</div>
<div id="menuTiny" class="menu">
<script type="text/javascript">document.write(getMenu(2));</script>
</div>
<div id="extra"></div>
</div>
<div id="content" role="main"><!-- #BeginEditable "Body" -->
<h1 class="center">Taylor Series </h1>
<p>A Taylor Series is an expansion of some function into an <b>infinite sum of terms</b>, where each term has a larger exponent like x, x<sup>2</sup>, x<sup>3</sup>, etc.</p>
<div class="example">
<h3>Example: <span class="larger">The Taylor Series for e<sup>x</sup></span></h3>
<p class="center larger"><i>e</i><sup>x</sup> = 1 + x + <span class=intbl><em>x<sup>2</sup></em><strong>2!</strong></span> + <span class=intbl><em>x<sup>3</sup></em><strong>3!</strong></span> + <span class=intbl><em>x<sup>4</sup></em><strong>4!</strong></span> + <span class=intbl><em>x<sup>5</sup></em><strong>5!</strong></span> + ...</p>
<div class="tbl">
<div class="row"><span class="left">says that the function:</span><span class="right">e<sup>x</sup></span></div>
<div class="row"><span class="left">is equal to the infinite sum of terms:</span><span class="right">1 + x + x<sup>2</sup>/2! + x<sup>3</sup>/3! + ... etc</span></div>
</div>
<p>(Note: <span class="large">!</span> is the <a href="../numbers/factorial.html">Factorial Function</a>.)</p>
<p></p>
</div>
<p>Does it really work? Let's try it:</p>
<div class="example">
<h3>Example: <span class="larger">e<sup>x</sup></span> for x=2</h3>
<p>Well, we already know the answer is <b>e<sup>2</sup></b> = 2.71828... &times; 2.71828... = <b>7.389056...</b></p>
<p>But let's try more and more terms of our infinte series:</p>
<div class="simple">
<table align="center">
<tr>
<th><b>Terms</b></th>
<th>&nbsp;</th>
<th><b>Result</b></th>
</tr>
<tr><td>1+2</td>
<td>&nbsp;</td>
<td><b>3</b></td></tr>
<tr><td>1+2+<span class=intbl><em>2<sup>2</sup></em><strong>2!</strong></span></td>
<td>&nbsp;</td>
<td><b>5</b></td></tr>
<tr><td>1+2+<span class=intbl><em>2<sup>2</sup></em><strong>2!</strong></span>+<span class=intbl><em>2<sup>3</sup></em><strong>3!</strong></span></td>
<td>&nbsp;</td>
<td><b>6.3333...</b></td></tr>
<tr><td>1+2+<span class=intbl><em>2<sup>2</sup></em><strong>2!</strong></span>+<span class=intbl><em>2<sup>3</sup></em><strong>3!</strong></span>+<span class=intbl><em>2<sup>4</sup></em><strong>4!</strong></span></td>
<td>&nbsp;</td>
<td><b>7</b></td></tr>
<tr><td>1+2+<span class=intbl><em>2<sup>2</sup></em><strong>2!</strong></span>+<span class=intbl><em>2<sup>3</sup></em><strong>3!</strong></span>+<span class=intbl><em>2<sup>4</sup></em><strong>4!</strong></span>+<span class=intbl><em>2<sup>5</sup></em><strong>5!</strong></span></td>
<td>&nbsp;</td>
<td><b>7.2666...</b></td></tr>
<tr><td>1+2+<span class=intbl><em>2<sup>2</sup></em><strong>2!</strong></span>+<span class=intbl><em>2<sup>3</sup></em><strong>3!</strong></span>+<span class=intbl><em>2<sup>4</sup></em><strong>4!</strong></span>+<span class=intbl><em>2<sup>5</sup></em><strong>5!</strong></span>+<span class=intbl><em>2<sup>6</sup></em><strong>6!</strong></span></td>
<td>&nbsp;</td>
<td><b>7.3555...</b></td></tr>
<tr><td>1+2+<span class=intbl><em>2<sup>2</sup></em><strong>2!</strong></span>+<span class=intbl><em>2<sup>3</sup></em><strong>3!</strong></span>+<span class=intbl><em>2<sup>4</sup></em><strong>4!</strong></span>+<span class=intbl><em>2<sup>5</sup></em><strong>5!</strong></span>+<span class=intbl><em>2<sup>6</sup></em><strong>6!</strong></span>+<span class=intbl><em>2<sup>7</sup></em><strong>7!</strong></span></td>
<td>&nbsp;</td>
<td><b>7.3809...</b></td></tr>
<tr><td>1+2+<span class=intbl><em>2<sup>2</sup></em><strong>2!</strong></span>+<span class=intbl><em>2<sup>3</sup></em><strong>3!</strong></span>+<span class=intbl><em>2<sup>4</sup></em><strong>4!</strong></span>+<span class=intbl><em>2<sup>5</sup></em><strong>5!</strong></span>+<span class=intbl><em>2<sup>6</sup></em><strong>6!</strong></span>+<span class=intbl><em>2<sup>7</sup></em><strong>7!</strong></span>+<span class=intbl><em>2<sup>8</sup></em><strong>8!</strong></span></td>
<td>&nbsp;</td>
<td><b>7.3873...</b></td></tr>
</table>
</div>
<p>It starts out really badly, but it then gets better and better!</p>
<p>Try using &quot;<b>2^n/fact(n)</b>&quot; and <b>n=0</b> to 20 in the <a href="../numbers/sigma-calculator.html">Sigma Calculator</a> and see what you get.</p>
</div>
<p>Here are some common Taylor Series:</p>
<div class="beach">
<table border="0" align="center" cellpadding="5">
<tr>
<td><b>Taylor Series expansion</b></td>
<td>&nbsp;</td>
<td><b>As <a href="sigma-notation.html">Sigma Notation</a></b></td>
</tr>
<tr>
<td><p class="larger"><i><b>e</b></i><b><sup>x</sup></b> = 1 + x + <span class=intbl><em>x<sup>2</sup></em><strong>2!</strong></span> + <span class=intbl><em>x<sup>3</sup></em><strong>3!</strong></span> + ...</p></td>
<td>&nbsp;</td>
<td><img src="images/taylor-ex-sigma.gif" width="58" height="50" alt="Taylor: Sigma n=0 to infinity of (x^n)/n!" /></td>
</tr>
<tr>
<td>
<p class="larger"><b>sin x</b> = x &minus; <span class=intbl><em>x<sup>3</sup></em><strong>3!</strong></span> + <span class=intbl><em>x<sup>5</sup></em><strong>5!</strong></span> &minus; ...</p></td>
<td>&nbsp;</td>
<td><img src="images/taylor-sin-sigma.gif" width="157" height="50" alt="Taylor: Sigma n=0 to infinity of [ (-1)^n / (2n+1)! ] times x^(2n+1)" /></td>
</tr>
<tr>
<td>
<p class="larger"><b>cos x</b> = 1 &minus; <span class=intbl><em>x<sup>2</sup></em><strong>2!</strong></span> + <span class=intbl><em>x<sup>4</sup></em><strong>4!</strong></span> &minus; ...</p></td>
<td>&nbsp;</td>
<td><img src="images/taylor-cos-sigma.gif" width="112" height="50" alt="Taylor: Sigma n=0 to infinity of [ (-1)^n / (2n)! ] times x^(2n)" /></td>
</tr>
<tr>
<td><img src="images/taylor-1-1-x.gif" width="371" height="46" alt="Taylor 1/(1-x) = 1 + x + x^2 + x^3 + ..." /></td>
<td>&nbsp;</td>
<td><img src="images/taylor-1-1-x-sigma.gif" width="54" height="57" alt="Taylor: Sigma n=0 to infinity of x^n" /></td>
</tr>
</table>
</div>
<p>(There are many more.) </p>
<h2>Approximations</h2>
<p>We can use the first few terms of a Taylor Series to get an approximate value for a function.</p>
<p>Here we show better and better approximations for <b>cos(x)</b>. The red line is <b>cos(x)</b>, the blue is the approximation (<a href="../data/function-grapher8cc1.html?func1=1-x^2/2+x^4/24-x^6/720+x^8/40320&amp;func2=cos(x)&amp;xmin=-12&amp;xmax=12&amp;ymin=-8&amp;ymax=8">try plotting it yourself</a>) :</p>
<div class="simple">
<table border="0" align="center" cellspacing="10">
<tr>
<td align="center"><span class="center larger">1 &minus; x<sup>2</sup>/2!</span></td>
<td><img src="images/taylor-cos-2.gif" width="266" height="107" alt="taylor cosine graph 2" /></td>
</tr>
<tr>
<td align="center"><span class="center larger">1 &minus; x<sup>2</sup>/2! + x<sup>4</sup>/4! </span></td>
<td><img src="images/taylor-cos-4.gif" width="264" height="108" alt="taylor cosine graph 4" /></td>
</tr>
<tr>
<td align="center"><span class="center larger">1 &minus; x<sup>2</sup>/2! + x<sup>4</sup>/4! &minus; x<sup>6</sup>/6!</span></td>
<td><img src="images/taylor-cos-6.gif" width="267" height="108" alt="taylor cosine graph 6" /></td>
</tr>
<tr>
<td align="center"><span class="center larger">1 &minus; x<sup>2</sup>/2! + x<sup>4</sup>/4! &minus; x<sup>6</sup>/6!</span><span class="center larger"> + x<sup>8</sup>/8!</span></td>
<td><img src="images/taylor-cos-8.gif" width="268" height="108" alt="taylor cosine graph 8" /></td>
</tr>
</table>
</div>
<p>You can also see the Taylor Series in action at <a href="eulers-formula.html">Euler's Formula for Complex Numbers</a>.</p>
<h2>What is this Magic?</h2>
<p>How can we turn a function into a series of power terms like this?</p>
<p>Well, it isn't really magic. First we say we <b>want</b> to have this expansion:</p>
<p class="center larger"> f(x) = c<sub>0</sub> + c<sub>1</sub>(x-a) + c<sub>2</sub>(x-a)<sup>2</sup> + c<sub>3</sub>(x-a)<sup>3</sup> + ...</p>
<p>Then we choose a value &quot;a&quot;, and work out the values c<sub>0</sub> , c<sub>1</sub> , c<sub>2</sub> , ... etc</p>
<p>And it is done using <b>derivatives</b> (so we must know the derivative of our function)</p>
<div class="def">
<p style="float:right; margin: 0 0 5px 10px;"><img src="../calculus/images/slope-examples.svg" alt="slope examples y=3, slope=0; y=2x, slope=2" /></p>
<h3>Quick review: a <a href="../calculus/derivatives-introduction.html">derivative</a> gives us the slope of a function at any point.</h3>
<p>These basic <a href="../calculus/derivatives-rules.html">derivative rules</a> can help us:</p>
<ul>
<li>The derivative of a constant is <b>0</b></li>
<li>The derivative of <b>ax</b> is <b>a</b> (example: the derivative of <b>2x</b> is <b>2</b>) </li>
<li>The derivative of <b>x<sup>n</sup></b> is <b>nx<sup>n-1</sup></b>
(example: the derivative of <b>x<sup>3</sup></b> is <b>3x<sup>2</sup></b>) </li>
</ul>
<p>We will use the little mark <span class="large">&rsquo;</span> to mean &quot;derivative of&quot;. </p>
</div>
<p>OK, let's start:</p>
<div class="dotpoint">
<p>To get c<sub>0</sub>, choose x=a so all the (x-a) terms become zero, leaving us with:</p>
<p class="center">f(a) = c<sub>0</sub></p>
<p class="center">So <b>c<sub>0</sub> = f(a)</b></p>
</div>
<div class="dotpoint">
<p>To get c<sub>1</sub>, take the derivative of f(x):</p>
<p class="center">f<span class="large">&rsquo;</span>(x) = c<sub>1</sub> + 2c<sub>2</sub>(x-a) + 3c<sub>3</sub>(x-a)<sup>2</sup> + ...</p>
<p>With x=a all the (x-a) terms become zero:</p>
<p class="center">f<span class="large">&rsquo;</span>(a) = c<sub>1</sub></p>
<p class="center">So <b>c<sub>1</sub> = f<span class="large">&rsquo;</span>(a)</b></p>
</div>
<div class="dotpoint">
<p>To get c<sub>2</sub>, do the derivative again:</p>
<p class="center">f<span class="large">&rsquo;</span><span class="large">&rsquo;</span>(x) = 2c<sub>2</sub> + 3&times;2&times;c<sub>3</sub>(x-a) + ...</p>
<p>With x=a all the (x-a) terms become zero:</p>
<p class="center">f<span class="large">&rsquo;</span><span class="large">&rsquo;</span>(a) = 2c<sub>2</sub></p>
<p class="center">So <b>c<sub>2</sub> = f<span class="large">&rsquo;</span><span class="large">&rsquo;</span>(a)/2</b></p>
</div>
<p>In fact, a pattern is emerging. Each term is</p>
<ul>
<li>the next higher derivative ...</li>
<li>... divided by all the exponents so far multiplied together (for which we can use <a href="../numbers/factorial.html">factorial notation</a>, for example 3! = 3&times;2&times;1)</li>
</ul>
<p>And we get:</p>
<div class="def"> <p class="center"><span class="center larger">f(x) = f(a)<sub></sub> + <span class="intbl"><em>f'(a)</em><strong>1!</strong></span>(x-a) <sub></sub> + <span class="intbl">
<em>f''(a)</em>
<strong>2!</strong>
</span>(x-a)<sup>2</sup> + <span class="intbl">
<em>f'''(a)</em>
<strong>3!</strong>
</span>(x-a)<sup>3</sup> + ...</span></p>
</div>
<p>Now we have a way of finding our own Taylor Series:</p>
<p class="center large">For each term: take the next derivative, divide by n!, multiply by (x-a)<sup>n</sup></p>
<p>&nbsp;</p>
<div class="example">
<h3>Example: Taylor Series for cos(x)</h3>
<p>Start with:</p>
<p class="center larger"><span class="center">f(x) = f(a)<sub></sub> + <span class="intbl">
<em>f'(a)</em>
<strong>1!</strong>
</span>(x-a) <sub></sub> + <span class="intbl">
<em>f''(a)</em>
<strong>2!</strong>
</span>(x-a)<sup>2</sup> + <span class="intbl">
<em>f'''(a)</em>
<strong>3!</strong>
</span>(x-a)<sup>3</sup> + ...</span></p>
<p>The derivative of <b>cos</b> is <b>&minus;sin</b>, and the derivative of <b>sin</b> is <b>cos</b>, so:</p>
<ul>
<li>f(x) = cos(x) </li>
<li>f'(x) = &minus;sin(x)</li>
<li>f''(x) = &minus;cos(x)</li>
<li>f'''(x) = sin(x)</li>
<li>etc...</li>
</ul>
<p>And we get:</p>
<p class="center larger"><span class="center">cos(x) = cos(a) <sub></sub>&minus; <span class="intbl">
<em>sin(a)</em>
<strong>1!</strong>
</span>(x-a) <sub></sub> &minus; <span class="intbl">
<em>cos(a)</em>
<strong>2!</strong>
</span>(x-a)<sup>2</sup> + <span class="intbl">
<em>sin(a)</em>
<strong>3!</strong>
</span>(x-a)<sup>3</sup> + ...</span></p>
<p>Now put <b>a=0</b>, which is nice because <b>cos(0)=1</b> and <b>sin(0)=0</b>:</p>
<p class="center larger"><span class="center">cos(x) = 1 <sub></sub>&minus; <span class="intbl">
<em>0</em>
<strong>1!</strong>
</span>(x-0) <sub></sub> &minus; <span class="intbl">
<em>1</em>
<strong>2!</strong>
</span>(x-0)<sup>2</sup> + <span class="intbl">
<em>0</em>
<strong>3!</strong>
</span>(x-0)<sup>3</sup> + <span class="intbl">
<em>1</em>
<strong>4!</strong>
</span>(x-0)<sup>4</sup> + ...</span></p>
<p>Simplify:</p>
<p class="center larger">cos(x) = 1 &minus; x<sup>2</sup>/2! + x<sup>4</sup>/4! &minus; ... </p>
</div>
<p>Try that for sin(x) yourself, it will help you to learn.</p>
<p>Or try it on another function of your choice. </p>
<p><b>The key thing is to know the derivatives of your function f(x).</b> </p>
<p>&nbsp;</p>
<div class="words">
<p>Note: A <b>Maclaurin Series</b> is a Taylor Series where <b>a=0</b>, so all the examples we have been using so far can <b>also</b> be called Maclaurin Series.</p>
</div><p>&nbsp;</p>
<div class="questions">
<script type="text/javascript">getQ(8963, 8964, 8965, 8966, 8968, 8969, 8967, 8970, 8971, 8972);</script>&nbsp;
</div>
<div class="related">
<a href="index.html">Algebra Index</a>
</div>
<!-- #EndEditable --></div>
<div id="adend" class="centerfull noprint">
<script type="text/javascript">document.write(getAdEnd());</script>
</div>
<div id="footer" class="centerfull noprint">
<script type="text/javascript">document.write(getFooter());</script>
</div>
<div id="copyrt">
Copyright &copy; 2017 MathsIsFun.com
</div>
<script type="text/javascript">document.write(getBodyEnd());</script>
</body>
<!-- #EndTemplate -->
<!-- Mirrored from www.mathsisfun.com/algebra/taylor-series.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 29 Oct 2022 00:49:10 GMT -->
</html>