<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Calculus &#8211; BetterExplained</title>
	<atom:link href="https://betterexplained.com/articles/series/calculus/feed/" rel="self" type="application/rss+xml" />
	<link>https://betterexplained.com</link>
	<description>Math lessons that click</description>
	<lastBuildDate>Wed, 04 May 2022 22:30:39 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>Integral of Sin(x): Geometric Intuition</title>
		<link>https://betterexplained.com/articles/integral-sinx/</link>
					<comments>https://betterexplained.com/articles/integral-sinx/#disqus_thread</comments>
		
		<dc:creator><![CDATA[kalid]]></dc:creator>
		<pubDate>Wed, 20 Nov 2019 00:01:09 +0000</pubDate>
				<category><![CDATA[Calculus]]></category>
		<guid isPermaLink="false">https://betterexplained.com/?p=12244</guid>

					<description><![CDATA[You're minding your own business when some punk asks what the integral of means. Your options: Pretend to be asleep (except not in the engineering library again) Canned response: "As with any function, the integral of sine is the area under its curve." Geometric intuition: "The integral of sine is the horizontal distance along a [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>You're minding your own business when some punk asks what the integral of <img src="https://betterexplained.com/latex/310374f3e5e01fc30505.png" alt="$\sin(x)$" width="47" height="19" style="vertical-align:-4.53px" class="bex-math"></img> means. Your options:</p>

<ul>
<li>Pretend to be asleep (except not in the engineering library again)</li>
<li>Canned response: "As with any function, the integral of sine is the area under its curve."</li>
<li>Geometric intuition: "The integral of sine is the <strong>horizontal distance</strong> along a circular path."</li>
</ul>

<p>Option 1 is tempting, but let's take a look at the others.</p>

<iframe width="640" height="360" src="https://www.youtube.com/embed/6pE_WQjCSGA" frameborder="0" allowfullscreen=""></iframe>

<h2>Why "Area Under the Curve" is Unsatisfying</h2>

<p>Describing an integral as "area under the curve" is like describing a book as a list of words. Technically correct, but misses the message and I suspect you haven't done the assigned reading.</p>

<p><img decoding="async" src="https://betterexplained.com/wp-content/uploads/2019/11/Riemann_sums.png" alt="Integral of Sin(x): Geometric Intuition" class="webpexpress-processed"></p>

<p>Unless you're trapped in LegoLand, integrals mean something besides rectangles.</p>

<h2>Decoding the Integral</h2>

<p>My calculus conundrum was not having an intuition for all the mechanics.</p>

<p>When we see:</p>

<p><img src="https://betterexplained.com/latex/766bfcdf4f4c92722fb7.png" alt="$\int \sin(x) dx$" width="81" height="21" style="vertical-align:-5.53px" class="bex-math"></img></p>

<p>We can call on a few insights:</p>

<ul>
<li><p>The integral is just <a href="https://betterexplained.com/articles/a-calculus-analogy-integrals-as-multiplication/">fancy multiplication</a>. Multiplication accumulates numbers that don't change (3 + 3 + 3 + 3). Integrals add up numbers that <em>might</em> change, based on a pattern (1 + 2 + 3 + 4). But if we squint our eyes and pretend items are identical we have a multiplication.</p></li>
<li><p><img src="https://betterexplained.com/latex/310374f3e5e01fc30505.png" alt="$\sin(x)$" width="47" height="19" style="vertical-align:-4.53px" class="bex-math"></img> just a <a href="https://betterexplained.com/articles/intuitive-trigonometry/">percentage</a>. Yes, it's also fancy curve with nice properties. But at any point (like 45 degrees), it's a single <em>percentage</em> from -100% to +100%. Just regular numbers.</p></li>
<li><p><img src="https://betterexplained.com/latex/3180123ed37d6de4b4e6.png" alt="$dx$" width="20" height="13" style="vertical-align:-0.2px" class="bex-math"></img> is a tiny, <a href="https://betterexplained.com/articles/why-do-we-need-limits-and-infinitesimals/">infinitesimal part</a> of the path we're taking. 0 to <img src="https://betterexplained.com/latex/d29b4638e781db60be51.png" alt="$x$" width="11" height="9" style="vertical-align:-0.2px" class="bex-math"></img> is the full path, so <img src="https://betterexplained.com/latex/3180123ed37d6de4b4e6.png" alt="$dx$" width="20" height="13" style="vertical-align:-0.2px" class="bex-math"></img> is (intuitively) a nanometer wide.</p></li>
</ul>

<p>Ok. With those 3 intuitions, our rough (rough!) conversion to Plain English is:</p>

<blockquote>

<p>The integral of sin(x) multiplies our intended path length (from 0 to x) by a percentage</p>
</blockquote>

<p>We <em>intend</em> to travel a simple path from 0 to x, but we end up with a smaller percentage instead. (Why? Because <img src="https://betterexplained.com/latex/310374f3e5e01fc30505.png" alt="$\sin(x)$" width="47" height="19" style="vertical-align:-4.53px" class="bex-math"></img> is usually less than 100%). So we'd expect something like 0.75x.</p>

<p>In fact, if <img src="https://betterexplained.com/latex/310374f3e5e01fc30505.png" alt="$\sin(x)$" width="47" height="19" style="vertical-align:-4.53px" class="bex-math"></img> did have a fixed value of 0.75, our integral would be:</p>

<p><img src="https://betterexplained.com/latex/82213c1fe69d65a4dfeb.png" alt="$\int \text{fixedsin}(x) \ dx = \int 0.75 \ dx = 0.75 \int dx = 0.75x$" width="378" height="21" style="vertical-align:-5.53px" class="bex-math"></img></p>

<p>But the real <img src="https://betterexplained.com/latex/310374f3e5e01fc30505.png" alt="$\sin(x)$" width="47" height="19" style="vertical-align:-4.53px" class="bex-math"></img>, that rascal, changes as we go. Let's see what fraction of our path we really get.</p>

<h2>Visualize The Change in Sin(x)</h2>

<p>Now let's visualize <img src="https://betterexplained.com/latex/310374f3e5e01fc30505.png" alt="$\sin(x)$" width="47" height="19" style="vertical-align:-4.53px" class="bex-math"></img> and its changes:</p>

<p><img decoding="async" src="https://betterexplained.com/wp-content/uploads/2019/11/sine-dx-change.png" alt="Integral of Sin(x): Geometric Intuition" class="webpexpress-processed"></p>

<p>Here's the decoder key:</p>

<ul>
<li><p><img src="https://betterexplained.com/latex/d29b4638e781db60be51.png" alt="$x$" width="11" height="9" style="vertical-align:-0.2px" class="bex-math"></img> is our current angle in <a href="https://betterexplained.com/articles/intuitive-guide-to-angles-degrees-and-radians/">radians</a>. On the unit circle (radius=1), the angle is the distance along the circumference.</p></li>
<li><p><img src="https://betterexplained.com/latex/3180123ed37d6de4b4e6.png" alt="$dx$" width="20" height="13" style="vertical-align:-0.2px" class="bex-math"></img> is a tiny change in our angle, which becomes the same change along the circumference (moving 0.01 units in our angle moves 0.01 along the circumference).</p></li>
<li><p>At our tiny scale, a circle is a <a href="https://betterexplained.com/articles/prehistoric-calculus-discovering-pi/">a polygon with many sides</a>, so we're moving along a <em>line segment</em> of length <img src="https://betterexplained.com/latex/3180123ed37d6de4b4e6.png" alt="$dx$" width="20" height="13" style="vertical-align:-0.2px" class="bex-math"></img>. This puts us at a new position.</p></li>
</ul>

<p>With me? With trigonometry, we can find the exact change in height/width as we slide along the circle by <img src="https://betterexplained.com/latex/3180123ed37d6de4b4e6.png" alt="$dx$" width="20" height="13" style="vertical-align:-0.2px" class="bex-math"></img>.</p>

<p>By similar triangles, our change just just our original triangle, rotated and scaled.</p>

<ul>
<li>Original triangle (hypotenuse = 1): height = <img src="https://betterexplained.com/latex/310374f3e5e01fc30505.png" alt="$\sin(x)$" width="47" height="19" style="vertical-align:-4.53px" class="bex-math"></img>, width = <img src="https://betterexplained.com/latex/279dacec896950f1f76b.png" alt="$\cos(x)$" width="49" height="19" style="vertical-align:-4.53px" class="bex-math"></img></li>
<li>Change triangle (hypotenuse = dx): height = <img src="https://betterexplained.com/latex/8052c6ebbff8077807ef.png" alt="$\sin(x) dx$" width="67" height="19" style="vertical-align:-4.53px" class="bex-math"></img>, width = <img src="https://betterexplained.com/latex/18a3329fa78b4eb74308.png" alt="$\cos(x)  dx$" width="69" height="19" style="vertical-align:-4.53px" class="bex-math"></img></li>
</ul>

<p>Now, remember that sine and cosine are functions that return percentages. (A number like 0.75 doesn't have its orientation. It shows up and makes things 75% of their size in whatever direction they're facing.)</p>

<p>So, given how we've drawn our Triangle of Change, <img src="https://betterexplained.com/latex/8052c6ebbff8077807ef.png" alt="$\sin(x) dx$" width="67" height="19" style="vertical-align:-4.53px" class="bex-math"></img> is our horizontal change. Our plain-English intuition is:</p>

<blockquote>

<p>The integral of sin(x) adds up the horizontal change along our path</p>
</blockquote>

<h2>Visualize The Integral Intuition</h2>

<p>Ok. Let's graph this bad boy to see what's happening. With our "<img src="https://betterexplained.com/latex/8052c6ebbff8077807ef.png" alt="$\sin(x) dx$" width="67" height="19" style="vertical-align:-4.53px" class="bex-math"></img> = tiny horizontal change" insight we have:</p>

<p><img decoding="async" src="https://betterexplained.com/wp-content/uploads/2019/11/sine-integral-horizontal.png" alt="Integral of Sin(x): Geometric Intuition" class="webpexpress-processed"></p>

<p>As we circle around, we have a bunch of <img src="https://betterexplained.com/latex/3180123ed37d6de4b4e6.png" alt="$dx$" width="20" height="13" style="vertical-align:-0.2px" class="bex-math"></img> line segments (in red). When sine is small (around x=0) we barely get any horizontal motion. As sine gets larger (top of circle), we are moving up to 100% horizontally.</p>

<p>Ultimately, the various <img src="https://betterexplained.com/latex/8052c6ebbff8077807ef.png" alt="$\sin(x) dx$" width="67" height="19" style="vertical-align:-4.53px" class="bex-math"></img> segments move us horizontally from one side of the circle to the other.</p>

<p>A more technical description:</p>

<p><img src="https://betterexplained.com/latex/8c8f26da1b8abd2a66f7.png" alt="$\int_0^x \sin(x) dx = \text{horizontal distance traveled on arc from 0 to x}$" width="474" height="22" style="vertical-align:-6.45px" class="bex-math"></img></p>

<p>Aha! That's the meaning. Let's eyeball it. When moving from <img src="https://betterexplained.com/latex/7721ba6d36060e43dd1f.png" alt="$x=0$" width="44" height="14" style="vertical-align:-1.49px" class="bex-math"></img> to <img src="https://betterexplained.com/latex/ac6169e88d2d649830b3.png" alt="$x=\pi$" width="45" height="13" style="vertical-align:-1.49px" class="bex-math"></img> we move exactly 2 units horizontally. It makes complete sense in the diagram.</p>

<h2>The Official Calculation</h2>

<p>Using the Official Calculus Fact that <img src="https://betterexplained.com/latex/ab1c8b9f53ef989fb78a.png" alt="$\int \sin(x) dx = -\cos(x)$" width="171" height="21" style="vertical-align:-5.53px" class="bex-math"></img> we would calculate:</p>

<p><img src="https://betterexplained.com/latex/85d58a77e115690d9b8e.png" alt="$\int_0^\pi \sin(x) dx = -\cos(x) \Big|_0^\pi = -\cos(\pi) - -\cos(0) = -(-1) -(-1) = 1 + 1 = 2$" width="604" height="31" style="vertical-align:-11.09px" class="bex-math"></img></p>

<p>Yowza. See how awkward it is, those double negations? Why was the visual intuition so much simpler?</p>

<p>Our path along the circle (<img src="https://betterexplained.com/latex/7721ba6d36060e43dd1f.png" alt="$x=0$" width="44" height="14" style="vertical-align:-1.49px" class="bex-math"></img> to <img src="https://betterexplained.com/latex/ac6169e88d2d649830b3.png" alt="$x=\pi$" width="45" height="13" style="vertical-align:-1.49px" class="bex-math"></img>) moves from right-to-left. But the x-axis goes positive from left-to-right. When convert distance along our path into Standard Area&#x2122;, we have to flip our axes:</p>

<p><img decoding="async" src="https://betterexplained.com/wp-content/uploads/2019/11/sine-unroll-changes.png" alt="Integral of Sin(x): Geometric Intuition" class="webpexpress-processed"></p>

<p>Our excitement to put things in the official format stamped out the intuition of what was happening.</p>

<h2>Fundamental Theorem of Calculus</h2>

<p>We don't really talk about the <a href="https://betterexplained.com/calculus/lesson-11/">Fundamental Theorem of Calculus</a> anymore. (Is it something I did?)</p>

<p>Instead of adding up all the tiny segments, just do: end point - start point.</p>

<p>The intuition was staring us in the face: <img src="https://betterexplained.com/latex/279dacec896950f1f76b.png" alt="$\cos(x)$" width="49" height="19" style="vertical-align:-4.53px" class="bex-math"></img> is the anti-derivative, and tracks the horizontal position, so we're just taking a difference between horizontal positions! (With awkward negatives to swap the axes.)</p>

<p><em>That's</em> the power of the Fundamental Theorem of Calculus. Skip the intermediate steps and just subtract endpoints.</p>

<h2>Onward and Upward</h2>

<p>Why did I write this? Because I couldn't <a href="https://betterexplained.com/articles/gutcheck/">instantly figure out</a>:</p>

<p><img src="https://betterexplained.com/latex/a79450ffc412dd138052.png" alt="$\int_0^\pi \sin(x) dx = 2$" width="124" height="22" style="vertical-align:-6.45px" class="bex-math"></img></p>

<p>This isn't an exotic function with strange parameters. It's like asking someone to figure out <img src="https://betterexplained.com/latex/a853ebb3f76eb6f4f9de.png" alt="$2^3$" width="17" height="16" style="vertical-align:0px" class="bex-math"></img> without a calculator. If you claim to understand exponents, it should be possible, right?</p>

<p>Now, we can't always visualize things. But for the <em>most common</em> functions we owe ourselves a visual intuition. I certainly can't eyeball the 2 units of area from 0 to <img src="https://betterexplained.com/latex/6cbee51e8365518a121a.png" alt="$\pi$" width="11" height="8" style="vertical-align:-0.2px" class="bex-math"></img> under a sine curve.</p>

<p>Happy math.</p>

<h2>Appendix: Average Efficiency</h2>

<p>As a fun fact, the "average" efficiency of motion around the top of a circle (0 to <img src="https://betterexplained.com/latex/6cbee51e8365518a121a.png" alt="$\pi$" width="11" height="8" style="vertical-align:-0.2px" class="bex-math"></img>) is: <img src="https://betterexplained.com/latex/113ec743aa652fa83ea7.png" alt="$\frac{2}{\pi} = .6366$" width="81" height="23" style="vertical-align:-6.38px" class="bex-math"></img></p>

<p>So on average, 63.66% of your path's length is converted to horizontal motion.</p>

<h2>Appendix: Height controls width?</h2>

<p>It seems weird that height controls the width, and vice-versa, right?</p>

<p>If height controlled height, we'd have runaway <a href="https://betterexplained.com/articles/an-intuitive-guide-to-exponential-functions-e/">exponential growth</a>. But a circle needs to regulate itself.</p>

<p><img src="https://betterexplained.com/latex/e7aded5a42342d4b3f23.png" alt="$e^x$" width="18" height="13" style="vertical-align:-0.2px" class="bex-math"></img> is the kid who eats candy, grows bigger, and can therefore eat more candy.</p>

<p><img src="https://betterexplained.com/latex/310374f3e5e01fc30505.png" alt="$\sin(x)$" width="47" height="19" style="vertical-align:-4.53px" class="bex-math"></img> is the kid who eats candy, gets sick, waits for an appetite, and eats more candy.</p>

<h2>Appendix: Area isn't literal</h2>

<p>The "area" in our integral isn't literal area, it's a percentage of our length. We visualized the multiplication as a 2d rectangle in our generic integral, but it can be confusing. If you earn money and are taxed, do you visualize 2d area (income * (1 - tax))? Or just a quantity helplessly shrinking?</p>

<p>Area primarily indicates a multiplication happened. Don't let team Integrals Are Literal Area win every battle!</p>

]]></content:encoded>
					
					<wfw:commentRss>https://betterexplained.com/articles/integral-sinx/feed/</wfw:commentRss>
			<slash:comments>21</slash:comments>
		

			</item>
	<item>
		<title>Intuition for Taylor Series (DNA Analogy)</title>
		<link>https://betterexplained.com/articles/taylor-series/</link>
					<comments>https://betterexplained.com/articles/taylor-series/#disqus_thread</comments>
		
		<dc:creator><![CDATA[kalid]]></dc:creator>
		<pubDate>Thu, 24 Jan 2019 06:14:43 +0000</pubDate>
				<category><![CDATA[Calculus]]></category>
		<guid isPermaLink="false">https://betterexplained.com/?p=11904</guid>

					<description><![CDATA[Your body has a strange property: you can learn information about the entire organism from a single cell. Pick a cell, dive into the nucleus, and extract the DNA. You can now regrow the entire creature from that tiny sample. There's a math analogy here. Take a function, pick a specific point, and dive in. [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Your body has a strange property: you can learn information about the <em>entire</em> organism from a single cell. Pick a cell, dive into the nucleus, and extract the DNA. You can now regrow the entire creature from that tiny sample.</p>

<p>There's a math analogy here. Take a function, pick a specific point, and dive in. You can pull out enough data from a single point to rebuild the entire function. Whoa. It's like remaking a movie from a single frame.</p>

<p>The Taylor Series discovers the "math DNA" behind a function and lets us rebuild it from a single data point. Let's see how it works.</p>

<p><img decoding="async" src="https://betterexplained.com/wp-content/uploads/2019/01/sine-frog.png" alt="Intuition for Taylor Series (DNA Analogy)" class="webpexpress-processed"></p>

<h2>Pulling information from a point</h2>

<p>Given a function like <img src="https://betterexplained.com/latex/e486fc934e0d604d2933.png" alt="$f(x) = x^2$" width="77" height="20" style="vertical-align:-4.53px" class="bex-math"></img>, what can we discover at a single location?</p>

<p>Normally we'd expect to calculate a single value, like <img src="https://betterexplained.com/latex/a44f4b38255157d64122.png" alt="$f(4) = 16$" width="76" height="19" style="vertical-align:-4.53px" class="bex-math"></img>. But there's much more beneath the surface:</p>

<ul>
<li><img src="https://betterexplained.com/latex/146ef99c55cfa5dede83.png" alt="$f(x)$" width="35" height="19" style="vertical-align:-4.53px" class="bex-math"></img> = Value of function at point <img src="https://betterexplained.com/latex/d29b4638e781db60be51.png" alt="$x$" width="11" height="9" style="vertical-align:-0.2px" class="bex-math"></img></li>
<li><img src="https://betterexplained.com/latex/368afd59ace254ef750f.png" alt="$f'(x)$" width="41" height="19" style="vertical-align:-4.53px" class="bex-math"></img> = First derivative, or how fast the function is changing (the velocity)</li>
<li><img src="https://betterexplained.com/latex/350739c785798110a8ce.png" alt="$f''(x)$" width="44" height="19" style="vertical-align:-4.53px" class="bex-math"></img> = Second derivative, or how fast the <em>changes</em> are changing (the acceleration)</li>
<li><img src="https://betterexplained.com/latex/2ba8d4446f080fe6591a.png" alt="$f'''(x)$" width="48" height="19" style="vertical-align:-4.53px" class="bex-math"></img> = Third derivative, or how fast the <em>changes</em> in the changes are changing (acceleration of the acceleration)</li>
<li>And so on</li>
</ul>

<p>Investigating a single point reveals multiple, possibly infinite, bits of information about the behavior. (Some functions have an endless amount of data (derivatives) at a single point).</p>

<p>So, given all this information, what should we do? Regrow the organism from a single cell, of course! (<em>Maniacal cackle here.</em>)</p>

<h2>Growing a Function from a point</h2>

<p>Our plan is to grow a function from a single starting point. But how can we describe any function in a generic way?</p>

<p>The big aha moment: imagine any function, at its core, is a polynomial (with possibly infinite terms):</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/c3f9e195f6520dcc434c3212454e6dff.png' width='277' height='21' alt='\displaystyle{f(x) = c_0 + c_1 x + c_2 x^2 + c_3x^3 + \cdots}' class='tex'></p>

<p>To rebuild our function, we start at a fixed point (<img src="https://betterexplained.com/latex/a529c14e00c7eed408ea.png" alt="$c_0$" width="16" height="11" style="vertical-align:-3px" class="bex-math"></img>) and add in a bunch of other terms based on the value we feed it (like <img src="https://betterexplained.com/latex/3d79bfc7a1caa5d3ad6a.png" alt="$c_1x$" width="27" height="11" style="vertical-align:-2.71px" class="bex-math"></img>). The "DNA" is the values <img src="https://betterexplained.com/latex/aa1550c3003be1a685e1.png" alt="$c_0, c_1, c_2, c_3$" width="88" height="12" style="vertical-align:-3.51px" class="bex-math"></img> that describe our function exactly.</p>

<p>Ok, we have a generic "function format". But how do we find the coefficients for a specific function like <a href="https://betterexplained.com/articles/intuitive-understanding-of-sine-waves/">sin(x)</a> (height of angle x on the unit circle)? How do we pull out its DNA?</p>

<p>Time for the magic of 0.</p>

<p>Let's start by plugging in the function value at <img src="https://betterexplained.com/latex/7721ba6d36060e43dd1f.png" alt="$x=0$" width="44" height="14" style="vertical-align:-1.49px" class="bex-math"></img>. Doing this, we get:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/135e33269e43926435a87cdb93652f3e.png' width='249' height='19' alt='\displaystyle{f(0) = c_0 + 0 + 0 + 0 + \cdots = c_0}' class='tex'></p>

<p>Every term vanishes except <img src="https://betterexplained.com/latex/a529c14e00c7eed408ea.png" alt="$c_0$" width="16" height="11" style="vertical-align:-3px" class="bex-math"></img>, which makes sense: the starting point of our blueprint should be <img src="https://betterexplained.com/latex/1dc91764f2ad87509573.png" alt="$f(0)$" width="34" height="19" style="vertical-align:-4.53px" class="bex-math"></img>. For <img src="https://betterexplained.com/latex/d0bb25e279f003cbfca3.png" alt="$f(x) = \sin(x)$" width="106" height="19" style="vertical-align:-4.53px" class="bex-math"></img>, we can work out <img src="https://betterexplained.com/latex/08c4140bb7c232d4a520.png" alt="$c_0 = \sin(0) = 0$" width="119" height="19" style="vertical-align:-4.53px" class="bex-math"></img>. We have our first bit of DNA!</p>

<h2>Getting More DNA</h2>

<p>Now that we know <img src="https://betterexplained.com/latex/a529c14e00c7eed408ea.png" alt="$c_0$" width="16" height="11" style="vertical-align:-3px" class="bex-math"></img>, how do we isolate <img src="https://betterexplained.com/latex/ebaac3a08f9d57216abd.png" alt="$c_1$" width="16" height="11" style="vertical-align:-2.71px" class="bex-math"></img> in this equation?</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/c3f9e195f6520dcc434c3212454e6dff.png' width='277' height='21' alt='\displaystyle{f(x) = c_0 + c_1 x + c_2 x^2 + c_3x^3 + \cdots}' class='tex'></p>

<p>Hrm. A few ideas:</p>

<ul>
<li><p>Can we set <img src="https://betterexplained.com/latex/fea0f5a399f6bea754ba.png" alt="$x = 1$" width="44" height="14" style="vertical-align:-1.49px" class="bex-math"></img>? That gives <img src="https://betterexplained.com/latex/ebacb9f09209f783e2b0.png" alt="$f(1) = c_0 + c_1(1) + c_2(1^2) + c_3(1^3) + \cdots$" width="316" height="20" style="vertical-align:-4.53px" class="bex-math"></img> . Although we know <img src="https://betterexplained.com/latex/a529c14e00c7eed408ea.png" alt="$c_0$" width="16" height="11" style="vertical-align:-3px" class="bex-math"></img>, the other constants are summed together. We can't pull out <img src="https://betterexplained.com/latex/ebaac3a08f9d57216abd.png" alt="$c_1$" width="16" height="11" style="vertical-align:-2.71px" class="bex-math"></img> by itself.</p></li>
<li><p>What if we divide by <img src="https://betterexplained.com/latex/d29b4638e781db60be51.png" alt="$x$" width="11" height="9" style="vertical-align:-0.2px" class="bex-math"></img>? This gives:</p></li>
</ul>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/c4a3d8eeaa143d00694f2d17ca508080.png' width='266' height='40' alt='\displaystyle{\frac{f(x)}{x} = \frac{c_0}{x} + c_1 + c_2 x + c_3x^2 + \cdots}' class='tex'></p>

<p>Then we can set <img src="https://betterexplained.com/latex/7721ba6d36060e43dd1f.png" alt="$x=0$" width="44" height="14" style="vertical-align:-1.49px" class="bex-math"></img> to make the other terms disappear... right? It's a nice idea, except we're now dividing by zero.</p>

<p>Hrm. This approach is really close. How can we <em>almost</em> divide by zero? <a href="https://betterexplained.com/articles/an-intuitive-introduction-to-limits/">Using the derivative</a>!</p>

<p>If we take the derivative of the blueprint of <img src="https://betterexplained.com/latex/146ef99c55cfa5dede83.png" alt="$f(x)$" width="35" height="19" style="vertical-align:-4.53px" class="bex-math"></img>, we get:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/c28fa94d6c91e4ee9383422467fc97e8.png' width='357' height='21' alt='\displaystyle{f&#039;(x) = (c_0)&#039; + (c_1 x)&#039; + (c_2 x^2)&#039; + (c_3x^3)&#039; + \cdots}' class='tex'></p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/ab56957b423ff22cc67fce8ece28c207.png' width='330' height='21' alt='\displaystyle{f&#039;(x) = 0 + c_1 + (2\cdot c_2 x) + (3\cdot c_3x^2) + \cdots}' class='tex'></p>

<p>Every power gets reduced by 1 and the <img src="https://betterexplained.com/latex/a529c14e00c7eed408ea.png" alt="$c_0$" width="16" height="11" style="vertical-align:-3px" class="bex-math"></img>, a constant value, becomes zero. It's almost too convenient.</p>

<p>Now we can isolate <img src="https://betterexplained.com/latex/ebaac3a08f9d57216abd.png" alt="$c_1$" width="16" height="11" style="vertical-align:-2.71px" class="bex-math"></img> using our <img src="https://betterexplained.com/latex/7721ba6d36060e43dd1f.png" alt="$x=0$" width="44" height="14" style="vertical-align:-1.49px" class="bex-math"></img> trick:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/99182e90baa124019b19353cd9cd8400.png' width='282' height='20' alt='\displaystyle{f&#039;(0) = 0 + c_1 + (0) + (0) + \cdots = c_1}' class='tex'></p>

<p>In our example, <img src="https://betterexplained.com/latex/32ce352a1af1b55026d7.png" alt="$\sin'(x) = \cos(x)$" width="125" height="19" style="vertical-align:-4.53px" class="bex-math"></img> so we compute: <img src="https://betterexplained.com/latex/ab584dc4212357add813.png" alt="$f'(0) = \sin'(0) = \cos(0) = 1 = c_1$" width="259" height="19" style="vertical-align:-4.53px" class="bex-math"></img></p>

<p>Yay, one more bit of DNA! This is the magic of the Taylor series: by repeatedly applying the derivative and setting <img src="https://betterexplained.com/latex/0da288f667bccdebccad.png" alt="$x = 0$" width="44" height="14" style="vertical-align:-1.49px" class="bex-math"></img>, we can pull out the polynomial DNA.</p>

<p>Let's try another round:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/758acf0d00c644afb6bcd39da99ffef0.png' width='325' height='21' alt='\displaystyle{f&#039;&#039;(x) = 0 + 0 + (2\cdot c_2) + (3\cdot 2 c_3x^1) + \cdots}' class='tex'></p>

<p>After taking the second derivative, the powers are reduced again. The first two terms (<img src="https://betterexplained.com/latex/a529c14e00c7eed408ea.png" alt="$c_0$" width="16" height="11" style="vertical-align:-3px" class="bex-math"></img> and <img src="https://betterexplained.com/latex/3d79bfc7a1caa5d3ad6a.png" alt="$c_1x$" width="27" height="11" style="vertical-align:-2.71px" class="bex-math"></img>) disappear, and we can again isolate <img src="https://betterexplained.com/latex/92886d21310c43e0653a.png" alt="$c_2$" width="16" height="11" style="vertical-align:-2.71px" class="bex-math"></img> by setting <img src="https://betterexplained.com/latex/7721ba6d36060e43dd1f.png" alt="$x=0$" width="44" height="14" style="vertical-align:-1.49px" class="bex-math"></img>:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/0f41d01c03ce41ab1012296d323482a0.png' width='240' height='20' alt='\displaystyle{f&#039;&#039;(0) = 0 + 0 + 2\cdot c_2 + 0 + \cdots}' class='tex'></p>

<p>For our sine example, <img src="https://betterexplained.com/latex/55c30903ce6ba5abd3e6.png" alt="$\sin'' = -\sin$" width="95" height="16" style="vertical-align:-1.49px" class="bex-math"></img>, so:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/bdbe27dc403bfebf2c37062c58b6b2bd.png' width='301' height='20' alt='\displaystyle{f&#039;&#039;(0) = \sin&#039;&#039;(0) = -\sin(0) = 0 = 2\cdot c_2}' class='tex'></p>

<p>or <img src="https://betterexplained.com/latex/4bb7d3feb2cd5dedb58c.png" alt="$c_2 = 0$" width="49" height="15" style="vertical-align:-2.71px" class="bex-math"></img>.</p>

<p>As we keep taking derivatives, we're performing more multiplications and growing a factorial in front of each term (1!, 2!, 3!).</p>

<p><strong>The Taylor Series for a function around point x=0 is:</strong></p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/ee1eb7e64f894e2c7e52247c0280bd5e.png' width='384' height='40' alt='\displaystyle{f(x) = f(0) + f&#039;(0) x + \frac{f&#039;&#039;(0)}{2!}x^2 + \frac{f&#039;&#039;&#039;(0)}{3!}x^3 + \cdots}' class='tex'></p>

<p>(Formally, the Taylor series around the point <img src="https://betterexplained.com/latex/7721ba6d36060e43dd1f.png" alt="$x=0$" width="44" height="14" style="vertical-align:-1.49px" class="bex-math"></img> is called the MacLaurin series.)</p>

<p><strong>The generalized Taylor series, extracted from any point a is:</strong></p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/9d6eb23fb27499213acb493c30f7b495.png' width='528' height='40' alt='\displaystyle{f(x) = f(a)+{\frac {f&#039;(a)}{1!}}(x-a)+{\frac {f&#039;&#039;(a)}{2!}}(x-a)^{2}+{\frac {f&#039;&#039;&#039;(a)}{3!}}(x-a)^{3}+\cdots }' class='tex'></p>

<p>The idea is the same. Instead of our regular blueprint, we use:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/9caa9850edf20b8a852a665c2dc42eaf.png' width='415' height='21' alt='\displaystyle{f(x) = c_0 + c_1 (x - a) + c_2 (x-a)^2 + c_3(x-a)^3 + \cdots}' class='tex'></p>

<p>Since we're growing from <img src="https://betterexplained.com/latex/114fce01e54a95fb5fed.png" alt="$f(a)$" width="34" height="19" style="vertical-align:-4.53px" class="bex-math"></img>, we can see that <img src="https://betterexplained.com/latex/68bb6d686af0f8aa837b.png" alt="$f(a) = c_0 + 0 + 0 + \dots = c_0$" width="220" height="19" style="vertical-align:-4.53px" class="bex-math"></img>. The other coefficients can be extracted by taking derivatives and setting <img src="https://betterexplained.com/latex/ecdd22b8c2480a3f663e.png" alt="$x = a$" width="45" height="13" style="vertical-align:-1.49px" class="bex-math"></img> (instead of <img src="https://betterexplained.com/latex/597d1bdaeafd020ec450.png" alt="$x =0$" width="44" height="14" style="vertical-align:-1.49px" class="bex-math"></img>).</p>

<h2>Example: Taylor Series of sin(x)</h2>

<p>Plugging in derivatives into the formula above, here's the Taylor series of <img src="https://betterexplained.com/latex/310374f3e5e01fc30505.png" alt="$\sin(x)$" width="47" height="19" style="vertical-align:-4.53px" class="bex-math"></img> around <img src="https://betterexplained.com/latex/0da288f667bccdebccad.png" alt="$x = 0$" width="44" height="14" style="vertical-align:-1.49px" class="bex-math"></img>:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/30d480d58a87ebd02b26b350551de380.png' width='256' height='41' alt='\displaystyle{\sin(x) = x - \frac{x^3}{3!} + \frac{x^5}{5!} - \frac{x^7}{7!} + \dots}' class='tex'></p>

<p>And here's what that looks like:</p>

<p><img decoding="async" src="https://betterexplained.com/wp-content/uploads/sine/sine-better-models.png" alt="Intuition for Taylor Series (DNA Analogy)" class="webpexpress-processed"></p>

<p>A few notes:</p>

<p><strong>1) Sine has infinite terms</strong></p>

<p>Sine is an infinite wave, and as you can guess, needs an infinite number of terms to keep it going. Simpler functions (like <img src="https://betterexplained.com/latex/191f47c56e099eb08568.png" alt="$f(x) = x^2 + 3$" width="108" height="20" style="vertical-align:-4.53px" class="bex-math"></img>) are already in their "polynomial format" and don't have infinite derivatives to keep the DNA going.</p>

<p><strong>2) Sine is missing every other term</strong></p>

<p>If we repeatedly take the derivative of sine at x = 0 we get:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/f15abf5ff736c599cc9a4d0f779a29f2.png' width='520' height='24' alt='\displaystyle{\sin(0) \xrightarrow{\text{derive}} \cos(0) \xrightarrow{\text{derive}} -\sin(0) \xrightarrow{\text{derive}} -\cos(0) \xrightarrow{\text{derive}} \sin(0) \dots}' class='tex'></p>

<p>with values:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/d5f5ac139c78aeba48bbaa954b08806a.png' width='101' height='16' alt='\displaystyle{0, 1, 0, -1, \dots}' class='tex'></p>

<p>Ignoring the division by the factorial, we get the pattern:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/492503f56b69e9866a6413b6ad59da34.png' width='410' height='21' alt='\displaystyle{(0) + (1)x^1 + (0)x^2 + (-1)x^3 + (0)x^4 + (-1)x^5+ \dots }' class='tex'></p>

<p>So the DNA of sine is something like [0, 1, 0, -1] repeating.</p>

<p><strong>3) Different starting positions have different DNA</strong></p>

<p>For fun, here's the Taylor series of <img src="https://betterexplained.com/latex/310374f3e5e01fc30505.png" alt="$\sin(x)$" width="47" height="19" style="vertical-align:-4.53px" class="bex-math"></img> starting at <img src="https://betterexplained.com/latex/1e22e0d411fdb1561dd2.png" alt="$x =\pi$" width="45" height="13" style="vertical-align:-1.49px" class="bex-math"></img> (<a href="https://www.wolframalpha.com/input/?i=taylor+series+sin+x+at+x%3Dpi">link</a>):</p>

<p><img decoding="async" src="https://betterexplained.com/wp-content/uploads/2019/01/taylor_series_x_pi.png" alt="taylor series sin x at x=pi - Wolfram|Alpha 2019-01-18 16-45-04" class="webpexpress-processed"></p>

<p>A few notes:</p>

<ul>
<li><p>The DNA is now something like [0, -1, 0, 1]. The cycle is similar, but the starting value has changed since we're starting at <img src="https://betterexplained.com/latex/ac6169e88d2d649830b3.png" alt="$x=\pi$" width="45" height="13" style="vertical-align:-1.49px" class="bex-math"></img>.</p></li>
<li><p>Written as calculated numbers, the denominators 1, 6, 120, 5040 look strange. But they're just every other factorial: 1! = 1, 3! = 6, 5! =120, 7! = 5040. In general, the Taylor series can have gnarly denominators.</p></li>
<li>The <img src="https://betterexplained.com/latex/f4e59142dd23f9b006da.png" alt="$O(x^{12})$" width="53" height="20" style="vertical-align:-4.53px" class="bex-math"></img> term means there are other components of order (power) <img src="https://betterexplained.com/latex/6affb21ca69aa0f53bb6.png" alt="$x^{12}$" width="25" height="16" style="vertical-align:-0.2px" class="bex-math"></img> and higher. Because <img src="https://betterexplained.com/latex/310374f3e5e01fc30505.png" alt="$\sin(x)$" width="47" height="19" style="vertical-align:-4.53px" class="bex-math"></img> has infinite derivatives, we have infinite terms and the computer has to cut us off somewhere. (<em>You've had enough Tayloring for today, buddy.</em>)</li>
</ul>

<h2>Application: Function Approximations</h2>

<p>A popular use of Taylor series is getting a quick approximation for a function. If you want a tadpole, do you need the DNA for the entire frog?</p>

<p><img decoding="async" src="https://betterexplained.com/wp-content/uploads/2019/01/sine-frog.png" alt="Intuition for Taylor Series (DNA Analogy)" class="webpexpress-processed"></p>

<p>The Taylor series has a bunch of terms, typically ordered by importance:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/ee1eb7e64f894e2c7e52247c0280bd5e.png' width='384' height='40' alt='\displaystyle{f(x) = f(0) + f&#039;(0) x + \frac{f&#039;&#039;(0)}{2!}x^2 + \frac{f&#039;&#039;&#039;(0)}{3!}x^3 + \cdots}' class='tex'></p>

<ul>
<li><img src="https://betterexplained.com/latex/33cdb201016b1574080c.png" alt="$c_0 = f(0)$" width="73" height="19" style="vertical-align:-4.53px" class="bex-math"></img>, the constant term, is the exact value at the point</li>
<li><img src="https://betterexplained.com/latex/a350b811b3347ca926f8.png" alt="$c_1 = f'(0)x$" width="90" height="19" style="vertical-align:-4.53px" class="bex-math"></img>, the linear term, tells us what speed to move from our point</li>
<li><img src="https://betterexplained.com/latex/d81339af32640aa21e52.png" alt="$c_2= \frac{f''(0)}{2!}x^2$" width="97" height="26" style="vertical-align:-6.26px" class="bex-math"></img>, the quadratic term, tells us how much to accelerate away from our point</li>
<li>and so on</li>
</ul>

<p>If we only need a prediction for a few instants around our point, the initial position &amp; velocity may be good enough:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/efdfd256e95cde73f061c50626b9209c.png' width='483' height='20' alt='\displaystyle{\text{Linear model} = \text{initial point} + \text{velocity effect} = f(0) + f&#039;(0)x}' class='tex'></p>

<p>If we're tracking for longer, then acceleration becomes important:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/32cdc4341d9e885a2fa6e11b51cfda3e.png' width='545' height='17' alt='\displaystyle{\text{Quadratic model} = \text{initial point} + \text{velocity effect} + \text{acceleration effect}}' class='tex'>
<img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/af720b70459d131f58ddebc1cb150108.png' width='218' height='37' alt='\displaystyle{ = f(0) + f&#039;(0)x + \frac{1}{2}f&#039;&#039;(0)x^2}' class='tex'></p>

<p>As we get further from our starting point, we need more terms to keep our prediction accurate. For example, the linear model <img src="https://betterexplained.com/latex/e83e9a194630e44240ae.png" alt="$\sin(x) = x$" width="82" height="19" style="vertical-align:-4.53px" class="bex-math"></img> is a good prediction around <img src="https://betterexplained.com/latex/7721ba6d36060e43dd1f.png" alt="$x=0$" width="44" height="14" style="vertical-align:-1.49px" class="bex-math"></img>. As we get further out, we need to account for more terms.</p>

<p>Similarly, <img src="https://betterexplained.com/latex/c121f636bb1c71ed9c57.png" alt="$e^x \sim 1 + x$" width="83" height="14" style="vertical-align:-1.49px" class="bex-math"></img> works well for small interest rates: 1% discrete interest is 1.01 after one time period, 1% continuous interest is a tad higher than 1.01. As time goes on, the linear model falls behind because it ignores the compounding effects.</p>

<h2>Application: Comparing Functions</h2>

<p>What's a common application of DNA? Paternity tests.</p>

<p>If we have a few functions, we can compare their Taylor series to see if they're related.</p>

<p>Here's the expansions of <img src="https://betterexplained.com/latex/310374f3e5e01fc30505.png" alt="$\sin(x)$" width="47" height="19" style="vertical-align:-4.53px" class="bex-math"></img>, <img src="https://betterexplained.com/latex/279dacec896950f1f76b.png" alt="$\cos(x)$" width="49" height="19" style="vertical-align:-4.53px" class="bex-math"></img>, and <img src="https://betterexplained.com/latex/e7aded5a42342d4b3f23.png" alt="$e^x$" width="18" height="13" style="vertical-align:-0.2px" class="bex-math"></img>:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/b5ea819a6da480914052558967c23ba2.png' width='374' height='41' alt='\displaystyle{ \sin x = x - \frac{x^3}{3!} + \frac{x^5}{5!} - \dots \xrightarrow{DNA} [0, 1, 0 -1, \dots] }' class='tex'></p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/f59b17744d88deb5f02df60480907e0b.png' width='375' height='40' alt='\displaystyle{ \cos x = 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \dots \xrightarrow{DNA} [1, 0, -1, 0, \dots] }' class='tex'></p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/b40225aedb74d8648649c58ecb22cfa7.png' width='373' height='41' alt='\displaystyle{ e^x = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \dots \xrightarrow{DNA} [1, 1, 1, 1, \dots] }' class='tex'></p>

<p>There's a family resemblance in the sequences, right? Clean powers of <img src="https://betterexplained.com/latex/d29b4638e781db60be51.png" alt="$x$" width="11" height="9" style="vertical-align:-0.2px" class="bex-math"></img> divided by a factorial?</p>

<p>One problem is the sequence for <img src="https://betterexplained.com/latex/e7aded5a42342d4b3f23.png" alt="$e^x$" width="18" height="13" style="vertical-align:-0.2px" class="bex-math"></img> has positive terms, while sine and cosine alternate signs. How can we link these together?</p>

<p>Euler's great insight was realizing an <a href="https://betterexplained.com/articles/a-visual-intuitive-guide-to-imaginary-numbers/">imaginary number</a> could swap the sign from positive to negative:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/cf7a66a77e3612eab7cde26914da2c7e.png' width='590' height='202' alt='{\begin{aligned}e^{ix}&amp;=1+ix+{\frac {(ix)^{2}}{2!}}+{\frac {(ix)^{3}}{3!}}+{\frac {(ix)^{4}}{4!}}+{\frac {(ix)^{5}}{5!}}+{\frac {(ix)^{6}}{6!}}+{\frac {(ix)^{7}}{7!}}+{\frac {(ix)^{8}}{8!}}+\cdots \\[8pt]&amp;=1+ix-{\frac {x^{2}}{2!}}-{\frac {ix^{3}}{3!}}+{\frac {x^{4}}{4!}}+{\frac {ix^{5}}{5!}}-{\frac {x^{6}}{6!}}-{\frac {ix^{7}}{7!}}+{\frac {x^{8}}{8!}}+\cdots \\[8pt]&amp;=\left(1-{\frac {x^{2}}{2!}}+{\frac {x^{4}}{4!}}-{\frac {x^{6}}{6!}}+{\frac {x^{8}}{8!}}-\cdots \right)+i\left(x-{\frac {x^{3}}{3!}}+{\frac {x^{5}}{5!}}-{\frac {x^{7}}{7!}}+\cdots \right)\\[8pt]&amp;=\cos x+i\sin x.\end{aligned}} ' class='tex'></p>

<p>Whoa. Using an imaginary exponent and separating into odd/even powers reveals that sine and cosine are hiding inside the exponential function. Amazing.</p>

<p>Although this proof of <a href="https://betterexplained.com/articles/intuitive-understanding-of-eulers-formula/">Euler's Formula</a> doesn't show <em>why</em> the imaginary number makes sense, it reveals the baby daddy hiding backstage.</p>

<h2>Appendix: Assorted Aha! Moments</h2>

<p><strong>Relationship to Fourier Series</strong></p>

<p>The Taylor Series extracts the "polynomial DNA" and the <a href="https://betterexplained.com/articles/an-interactive-guide-to-the-fourier-transform/">Fourier Series/Transform</a> extracts the "circular DNA" of a function. Both see functions as built from smaller parts (polynomials or exponential paths).</p>

<p><strong>Does the Taylor Series always work?</strong></p>

<p>This gets into mathematical analysis beyond my depth, but certain functions aren't easily (or ever) approximated with polynomials.</p>

<p>Notice that powers like <img src="https://betterexplained.com/latex/0ccfd13c9ad9cf535b9a.png" alt="$x^2, x^3$" width="45" height="19" style="vertical-align:-3.51px" class="bex-math"></img> explode as <img src="https://betterexplained.com/latex/d29b4638e781db60be51.png" alt="$x$" width="11" height="9" style="vertical-align:-0.2px" class="bex-math"></img> grows. In order to have a slow, gradual curve, you need an army of polynomial terms fighting it out, with one winner barely emerging. If you stop the train too early, the approximation explodes again.</p>

<p>For example, here's the Taylor Series for <img src="https://betterexplained.com/latex/98ab825382c837a1ce1a.png" alt="$\ln(1 + x)$" width="71" height="19" style="vertical-align:-4.53px" class="bex-math"></img>. The black line is the curve we want, and adding more terms, even dozens, barely gets us accuracy beyond <img src="https://betterexplained.com/latex/387985579f743d9e2822.png" alt="$x=1.0$" width="58" height="14" style="vertical-align:-1.49px" class="bex-math"></img>. It's just too hard to maintain a gentle slope with terms that want to run hog wild.</p>

<p><img decoding="async" src="https://upload.wikimedia.org/wikipedia/commons/2/27/Logarithm_GIF.gif" alt="Intuition for Taylor Series (DNA Analogy)" /></p>

<p><a href="https://en.wikipedia.org/wiki/File:Logarithm_GIF.gif">source</a></p>

<p>In this case, we only have a radius of convergence where the approximation stays accurate (such as around <img src="https://betterexplained.com/latex/ae32346c9156b84099cc.png" alt="$|x| &lt; 1$" width="54" height="19" style="vertical-align:-4.51px" class="bex-math"></img>).</p>

<p><strong>Turning geometric to algebraic definitions</strong></p>

<p>Sine is often defined geometrically: the height of a line on a circular figure.</p>

<p><img decoding="async" src="https://betterexplained.com/wp-content/uploads/sine/sine-unit-circle.png" alt="Intuition for Taylor Series (DNA Analogy)" /></p>

<p>Turning this into an equation seems really hard. The Taylor Series gives us a process: If we know a single value and how it changes (the derivative), we can reverse-engineer the DNA.</p>

<p>Similarly, the description of <img src="https://betterexplained.com/latex/e7aded5a42342d4b3f23.png" alt="$e^x$" width="18" height="13" style="vertical-align:-0.2px" class="bex-math"></img> as "the function with its derivative equal to the current value" yields the DNA [1, 1, 1, 1], and polynomial <img src="https://betterexplained.com/latex/6a164d5d8401601a6ff6.png" alt="$f(x) = 1 + \frac{1}{1!}x + \frac{1}{2!}x^2 + \frac{1}{3!}x^3 + \dots$" width="278" height="23" style="vertical-align:-6.55px" class="bex-math"></img>. We went from a verbal description to an equation.</p>

<p>Phew! A few items to ponder.</p>

<p>Happy math.</p>

]]></content:encoded>
					
					<wfw:commentRss>https://betterexplained.com/articles/taylor-series/feed/</wfw:commentRss>
			<slash:comments>17</slash:comments>
		

			</item>
	<item>
		<title>How to Add 1 through 100 using Calculus</title>
		<link>https://betterexplained.com/articles/how-to-add-1-to-100-using-calculus/</link>
					<comments>https://betterexplained.com/articles/how-to-add-1-to-100-using-calculus/#disqus_thread</comments>
		
		<dc:creator><![CDATA[kalid]]></dc:creator>
		<pubDate>Fri, 17 Feb 2017 20:52:31 +0000</pubDate>
				<category><![CDATA[Calculus]]></category>
				<category><![CDATA[Math]]></category>
		<guid isPermaLink="false">https://betterexplained.com/?p=10127</guid>

					<description><![CDATA[Earlier we saw a few ways to add a set of numbers (1 to 10) . And the formula we found was: It seems that regular arithmetic, algebra, geometry, or even statistics could help work out the equation. But how about Calculus? Is this bringing a nuclear missile to a gun fight? Let's find out. [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Earlier we saw a few ways to <a href="https://betterexplained.com/articles/techniques-for-adding-the-numbers-1-to-100/">add a set of numbers (1 to 10)</a>.</p>

<p><img decoding="async" src="https://betterexplained.com/wp-content/uploads/2017/02/1to100Strategies.png" alt="adding 1 to 100 strategies" class="webpexpress-processed"></p>

<p>And the formula we found was:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/2e9ef5f601b25cef7278a83960a9f8f5.png' width='225' height='39' alt='\displaystyle{\text{Sum from 1 to n} = \frac{n(n+1)}{2}}' class='tex'></p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/eaa99c27dd993571240dd1f837b4c6b5.png' width='434' height='39' alt='\displaystyle{\text{Sum from 1 to 100} = \frac{100(100+1)}{2} = (50)(101) = 5050}' class='tex'></p>

<iframe src="https://instacalc.com/50284/embed" width="450" height="200" frameborder="0"></iframe>

<p>It seems that regular arithmetic, algebra, geometry, or even statistics could help work out the equation.</p>

<p>But how about Calculus? Is this bringing a nuclear missile to a gun fight?</p>

<p>Let's find out.</p>

<p>The sequence to add (1 2 3 4 5 6 7 8 9 10...) looks a lot like <img src="https://betterexplained.com/latex/4380e9965d2a076913ac.png" alt="$f(x) = x$" width="69" height="19" style="vertical-align:-4.53px" class="bex-math"></img>. At every position on the x-axis, we put in a number and get the same one out.</p>

<p>Intuitively, the integral is "repeatedly adding a bunch of stuff" -- it seems like we could put it to work. From the rules of Calculus (or <a href="http://www.wolframalpha.com/input/?i=integral+of+f(x)+%3D+x">using Wolfram Alpha</a>) we get this:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/78e3616bdf1f6f24e6385c3375512160.png' width='85' height='41' alt='\displaystyle{&#10;\int x = \frac{1}{2} x^2&#10;}' class='tex'></p>

<p>Intuitively: Add up things following the <img src="https://betterexplained.com/latex/4380e9965d2a076913ac.png" alt="$f(x) = x$" width="69" height="19" style="vertical-align:-4.53px" class="bex-math"></img> pattern and you end up with <img src="https://betterexplained.com/latex/47a831e8a17e79312cb0.png" alt="$\frac{1}{2} x^2$" width="33" height="22" style="vertical-align:-6.25px" class="bex-math"></img>.</p>

<p>Well, let's see: the actual sum from 1 to 100 is 5050. But using the Calculus equation we get:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/7263cbcdecd0ec1535ba69e0981101af.png' width='244' height='37' alt='\displaystyle{&#10;\frac{1}{2} x^2 = \frac{1}{2}100^2 = \frac{10,000}{2} = 5000&#10;}' class='tex'></p>

<p>Uh oh: there's a difference. What's going on?</p>

<p><strong>Calculus works with continuous patterns, and we used a discrete one</strong>.</p>

<p>Here's what's happening:</p>

<p><img decoding="async" src="https://betterexplained.com/wp-content/uploads/2016/07/calculus-sum-x.png" alt="calculus add area under x" class="webpexpress-processed"></p>

<p>Calculus was built to measure <em>smoothly changing functions</em>, like a line, parabola, circle, etc. The pattern we have is a jumpy staircase (going from 1 to 2 without ever passing through 1.5, or 1.1, or 1.0001). In math class, books harp on analyzing whether a function is "continuous", aka changes smoothly enough for Calculus to work.</p>

<p>So when a pattern changes smoothly, Calculus works great. If a pattern changes suddenly, Calculus can only give an approximate answer. So what's the plan?</p>

<p>Use Calculus where possible, on the smooth part, and adjust for errors in the jumpy part.</p>

<p><img decoding="async" src="https://betterexplained.com/wp-content/uploads/2017/02/1to100integral.png" alt="calculus integral of x discrete" class="webpexpress-processed"></p>

<p>The area under the line is the integral. We a bunch of triangles above the line we need to include.</p>

<ul>
<li>How many of them? 1 for each item (x)</li>
<li>How big are they? They're half a of a 1x1 square, so they have area 1/2.</li>
<li>What's the total area to add back in? <img src="https://betterexplained.com/latex/bbe4061d3958a8930807.png" alt="$x \frac{1}{2} = \frac{x}{2}$" width="65" height="22" style="vertical-align:-6.25px" class="bex-math"></img></li>
</ul>

<p>So our final formula should be</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/a83e5801e5f8b09e484bcf52a3e1f8ee.png' width='267' height='37' alt='\displaystyle{\text{Integral} + \text{Adjustment} = \frac{1}{2} x^2 + \frac{x}{2}}' class='tex'></p>

<p>Aha! Learning Calculus doesn't mean we hunt around for Official Calculus Problems.</p>

<p>Nope. Take your scenario (adding 1 to 100) and realize what Calculus brings to the table: finding patterns in smoothly changing functions. Use Calculus on the smooth parts and adjust (or ignore) the other parts.</p>

<p>(Ironically, Calculus works by making jumpy approximations for smooth functions, and is in fact "jumpy" under the hood. If you are planning on working with jumpy patterns, use <a href="http://homepages.math.uic.edu/~kauffman/DCalc.pdf">Discrete Calculus</a>.)</p>

<h2>Example: Adding the first n squares</h2>

<p>Let's take this further: what's your guess for the sum of the first 100 square numbers?</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/7ae76815ac8f2a5af6b1c260d39c045a.png' width='226' height='18' alt='\displaystyle{1^2 + 2^2 + 3^2 + 4^2 + ... + 100^2}' class='tex'></p>

<p>Hrm. Getting the exact formula is tricky. But maybe we don't need the exact count, just an estimate.</p>

<p>With Calculus, we'd say: The pattern isn't continuous, but it looks like <img src="https://betterexplained.com/latex/e486fc934e0d604d2933.png" alt="$f(x) = x^2$" width="77" height="20" style="vertical-align:-4.53px" class="bex-math"></img>. Let's integrate x^2 from 0 to 100.</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/a1683483ce3ed88c798ed6a365a1da7c.png' width='93' height='41' alt='\displaystyle{&#10;\int x^2 = \frac{1}{3} x^3&#10;}' class='tex'></p>

<p>The indefinite integral is <img src="https://betterexplained.com/latex/38d4a5529dcbd4dd684c.png" alt="$\frac{1}{3} x^3$" width="33" height="23" style="vertical-align:-6.53px" class="bex-math"></img>, the running total for how much we have. From 0 to 100 it would be</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/2e892d985ba87d8ca6ce0b52351ab5f9.png' width='240' height='38' alt='\displaystyle{&#10;\frac{1}{3}100^3 = \frac{1,000,000}{3} \sim 333,333&#10;}' class='tex'></p>

<p>That's our guess, without a calculator. And the actual answer? 338350.</p>

<p><img decoding="async" src="https://betterexplained.com/wp-content/uploads/2016/07/calculus-arithmetic-3.png" alt="calculus area under x squared" class="webpexpress-processed"></p>

<p>How close were we? 99.9%. Not bad for something we worked out by hand in a minute!</p>

<p>Truly internalizing Calculus means it helps other elements of your math understanding, even regular addition problems.</p>

<p>Happy math.</p>

<p>PS. To keep building your intuition, check out the <a href="https://betterexplained.com/guides/calculus/">Calculus Guide</a>.</p>

]]></content:encoded>
					
					<wfw:commentRss>https://betterexplained.com/articles/how-to-add-1-to-100-using-calculus/feed/</wfw:commentRss>
			<slash:comments>12</slash:comments>
		

			</item>
	<item>
		<title>Quick Insight: Easier Arithmetic With Calculus</title>
		<link>https://betterexplained.com/articles/calculus-arithmetic/</link>
					<comments>https://betterexplained.com/articles/calculus-arithmetic/#disqus_thread</comments>
		
		<dc:creator><![CDATA[kalid]]></dc:creator>
		<pubDate>Thu, 28 Jul 2016 17:39:19 +0000</pubDate>
				<category><![CDATA[Calculus]]></category>
				<category><![CDATA[Math]]></category>
		<guid isPermaLink="false">https://betterexplained.com/?p=6304</guid>

					<description><![CDATA[Let's say you had to estimate 1 + 2 + 3 + 4 + 5 + 6 + 7 + ... + 100. What would you do? Well, you could work out the exact formula : and plug in n=100 to get 5050. But we just want a rough answer. You have a list of [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Let's say you had to estimate 1 + 2 + 3 + 4 + 5 + 6 + 7 + ... + 100.</p>

<p>What would you do? Well, you could <a href="https://betterexplained.com/articles/techniques-for-adding-the-numbers-1-to-100/">work out the exact formula</a>:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/a04d774fee1506cb126cd2f1780ebd08.png' width='82' height='39' alt='\displaystyle{\frac{(n + 1)(n)}{2}}' class='tex'></p>

<p>and plug in n=100 to get 5050.</p>

<p>But we just want a rough answer. You have a list of numbers, they follow a simple pattern, and want a quick estimate. What to do?</p>

<p>The "easy" way (well, the Calculus way) is to realize 1 + 2 + 3 + 4 is about the same as <img src="https://betterexplained.com/latex/4380e9965d2a076913ac.png" alt="$f(x) = x$" width="69" height="19" style="vertical-align:-4.53px" class="bex-math"></img>. The first element is f(1) = 1, the second is f(2) = 2, and so on.</p>

<p>From here, we can take the integral:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/ab3624ac555293014221974edd769f85.png' width='85' height='41' alt='\displaystyle{ \int x = \frac{1}{2} x^2 }' class='tex'></p>

<p>We usually see the integral as a formal, elegant operation, which artfully accumulates one function and returns another. Informally, we're squashing everything together in that bad mamma-jamma and seeing how much there is.</p>

<p>The result <img src="https://betterexplained.com/latex/47a831e8a17e79312cb0.png" alt="$\frac{1}{2} x^2$" width="33" height="22" style="vertical-align:-6.25px" class="bex-math"></img> should be pretty close to what we want.</p>

<p><img decoding="async" src="https://betterexplained.com/wp-content/uploads/2016/07/calculus-sum-x.png" alt="calculus add area under x" width="626" height="364" class="alignnone size-full wp-image-6305"></p>

<p>The <em>exact</em> total is our staircase-like pattern, which accumulates to 5050.</p>

<p>The <em>approximate</em> answer is the area of that triangle, <img src="https://betterexplained.com/latex/0d2e17d521db7415f875.png" alt="$\frac{1}{2} base * height = \frac{1}{2} 100 * 100 = 5000$" width="287" height="22" style="vertical-align:-6.25px" class="bex-math"></img>. The difference is because of the corners in the staircase which overhang. <img src="https://betterexplained.com/latex/a242eb25ad9e6eaac996.png" alt="$\frac{x}{2}$" width="16" height="20" style="vertical-align:-6.25px" class="bex-math"></img> is one-half, x times (the size of overhang (1/2) times the number of pieces (x)).</p>

<p>The net result is using a smooth, easy-to-measure shape to approximate a jagged, tedious-to-measure one. (This is a bit of Calculus inception, since we usually use rectangles to approximate smooth shapes.)</p>

<h2>More Estimates</h2>

<p>This tactic works for other sequences:</p>

<p><strong>What's the sum of the first 10 square numbers? 1 + 4 + 9 + 16 + 25 + ... + 100 = ?</strong></p>

<p>Hrm. The formula is probably tricky to work out. But without our Calculus-infused Arithmetic, a quick guess would be:</p>

<p><img decoding="async" src="https://betterexplained.com/wp-content/uploads/2016/07/calculus-arithmetic-3.png" alt="calculus add square numbers x squared" width="348" height="411" class="alignnone size-full wp-image-6317" srcset="https://betterexplained.com/wp-content/uploads/2016/07/calculus-arithmetic-3.png 348w, https://betterexplained.com/wp-content/uploads/2016/07/calculus-arithmetic-3-254x300.png 254w, https://betterexplained.com/wp-content/uploads/2016/07/calculus-arithmetic-3-171x202.png 171w, https://betterexplained.com/wp-content/uploads/2016/07/calculus-arithmetic-3-200x236.png 200w" sizes="(max-width: 348px) 100vw, 348px"></p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/58862adc8bafd072bdbf3afee6780f68.png' width='93' height='41' alt='\displaystyle{\int x^2 = \frac{1}{3} x^3}' class='tex'></p>

<p>Our first hunch should be "one third of 10^3" or 333. But as we saw before, there's an "overhang" that we missed. Let's call it 10%, for an estimate of 330 + 10% ~ 370.</p>

<p>The exact answer is 385. Not bad! The <a href="https://en.wikipedia.org/wiki/Square_pyramidal_number">actual formula</a> is:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/0b4fdf93d3293470b0e5a245c3fbfa79.png' width='520' height='52' alt='\displaystyle{P_{n}=\sum _{k=1}^{n}k^{2}={\frac {n(n+1)(2n+1)}{6}}={\frac {2n^{3}+3n^{2}+n}{6}}={\frac {n^{3}}{3}}+{\frac {n^{2}}{2}}+{\frac {n}{6}} }' class='tex'></p>

<p>I'd say <img src="https://betterexplained.com/latex/46c87652e1e2b493898b.png" alt="$\frac{x^3}{3}$" width="21" height="25" style="vertical-align:-6.53px" class="bex-math"></img> isn't bad for a few seconds of work.</p>

<p><strong>Data doubles every year. What does lifetime usage look like?</strong></p>

<p>The integral (squashed-together total) of an exponential is an exponential. In Calculus terms,</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/d56d519a434746a015eab13cac55f767.png' width='78' height='41' alt='\displaystyle{\int e^x = e^x}' class='tex'></p>

<p>The key insight is that all exponential growth is just a variation of <img src="https://betterexplained.com/latex/e7aded5a42342d4b3f23.png" alt="$e^x$" width="18" height="13" style="vertical-align:-0.2px" class="bex-math"></img>. If <img src="https://betterexplained.com/latex/e7aded5a42342d4b3f23.png" alt="$e^x$" width="18" height="13" style="vertical-align:-0.2px" class="bex-math"></img> accumulates exponentially, so will <img src="https://betterexplained.com/latex/fd86eeb6f9c434755c3a.png" alt="$2^x$" width="18" height="13" style="vertical-align:0px" class="bex-math"></img>.</p>

<p>So the total usage to date will also follow an exponential pattern, doubling every year also. Contrast this with a usage pattern of "1 + 2 + 3 + 4 ..." -- we grow linearly (<img src="https://betterexplained.com/latex/4380e9965d2a076913ac.png" alt="$f(x) = x$" width="69" height="19" style="vertical-align:-4.53px" class="bex-math"></img>), but total usage accumulates quadratically (<img src="https://betterexplained.com/latex/b4532148f801817056fd.png" alt="$\frac{1}{2}x^2$" width="33" height="22" style="vertical-align:-6.25px" class="bex-math"></img>).</p>

<p>My goal is to incorporate math thinking into everyday scenarios. We start with an arithmetic question, convert it to a geometry puzzle (how big is the staircase?), and then use calculus to approximate it.</p>

<p>I know a concept is clicking when I can switch between a few styles of thought. Imagine the problem as a script: how would Spielberg, Tarantino, or Scorsese direct it? Each field takes a different look. (To learn how to think with Calculus, check out the <a href="https://betterexplained.com/guides/calculus">Calculus Guide</a>.)</p>

<p>Happy math.</p>

]]></content:encoded>
					
					<wfw:commentRss>https://betterexplained.com/articles/calculus-arithmetic/feed/</wfw:commentRss>
			<slash:comments>25</slash:comments>
		

			</item>
	</channel>
</rss>
