Your body has a strange property: you can learn information about theentireorganism 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.
这里有一个数学类比。取一个函数,选一个特定的点,然后开始研究。您可以从单个点提取足够的数据来重建整个函数。哇。这就像用一帧重拍一部电影。
泰勒级数发现了一个函数背后的“数学DNA”,并让我们从一个单一的数据点重建它。让我们看看它是如何工作的。
Pulling information from a point
Given a function like $f(x) = x^2$, what can we discover at a single location?
Normally we'd expect to calculate a single value, like $f(4) = 16$. But there's much more beneath the surface:
- $f(x)$ = Value of function at point $x$
- $f'(x)$ = First derivative, or how fast the function is changing (the velocity)
- $f''(x)$ = Second derivative, or how fast thechangesare changing (the acceleration)
- $f'''(x)$ = Third derivative, or how fast thechangesin the changes are changing (acceleration of the acceleration)
- And so on
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).
So, given all this information, what should we do? Regrow the organism from a single cell, of course! (Maniacal cackle here.)
Growing a Function from a point
我们的计划是从一个单一的起点增长一个函数。但是我们如何用一般的方式描述任何函数呢?
The big aha moment: imagine any function, at its core, is a polynomial (with possibly infinite terms):
To rebuild our function, we start at a fixed point ($c_0$) and add in a bunch of other terms based on the value we feed it (like $c_1x$). The "DNA" is the values $c_0, c_1, c_2, c_3$ that describe our function exactly.
好的,我们有一个通用的“函数格式”。But how do we find the coefficients for a specific function likesin(x)(height of angle x on the unit circle)? How do we pull out its DNA?
Time for the magic of 0.
Let's start by plugging in the function value at $x=0$. Doing this, we get:
除了$c_0$以外,每个术语都消失了,这是有意义的:我们的蓝图的起点应该是$f(0)$。美元f (x) = \ sin (x)美元,我们可以计算出美元c_0 = \ sin(0) = 0美元。我们有了第一个DNA!
Getting More DNA
现在我们知道了c0,我们如何在这个方程中分离出c_1 ?
Hrm. A few ideas:
我们能设x = 1美元吗?让美元f (1) = c_0 + c₁(1)+ c₂(1 ^ 2)+ c_3 (1 ^ 3) + \ cdots $。虽然已知$c_0$,但其他常数相加。我们不能单独提出c ?
如果除以$x$呢?This gives:
Then we can set $x=0$ to make the other terms disappear... right? It's a nice idea, except we're now dividing by zero.
Hrm. This approach is really close. How can wealmostdivide by zero?Using the derivative!
If we take the derivative of the blueprint of $f(x)$, we get:
Every power gets reduced by 1 and the $c_0$, a constant value, becomes zero. It's almost too convenient.
Now we can isolate $c_1$ using our $x=0$ trick:
In our example, $\sin'(x) = \cos(x)$ so we compute: $f'(0) = \sin'(0) = \cos(0) = 1 = c_1$
耶,再来一点DNA!这就是泰勒级数的神奇之处:通过反复求导并使$x = 0$,我们可以提取出多项式DNA。
Let's try another round:
After taking the second derivative, the powers are reduced again. The first two terms ($c_0$ and $c_1x$) disappear, and we can again isolate $c_2$ by setting $x=0$:
For our sine example, $\sin'' = -\sin$, so:
或者说$c = 0$。
As we keep taking derivatives, we're performing more multiplications and growing a factorial in front of each term (1!, 2!, 3!).
The Taylor Series for a function around point x=0 is:
(Formally, the Taylor series around the point $x=0$ is called the MacLaurin series.)
The generalized Taylor series, extracted from any point a is:
The idea is the same. Instead of our regular blueprint, we use:
Since we're growing from $f(a)$, we can see that $f(a) = c_0 + 0 + 0 + \dots = c_0$. The other coefficients can be extracted by taking derivatives and setting $x = a$ (instead of $x =0$).
Example: Taylor Series of sin(x)
Plugging in derivatives into the formula above, here's the Taylor series of $\sin(x)$ around $x = 0$:
And here's what that looks like:
A few notes:
1) Sine has infinite terms
正弦是一个无限的波,正如你所猜测的,需要无限个数的项来维持它。更简单的函数(如$f(x) = x^2 + 3$)已经是它们的“多项式格式”,没有无限的导数来保持DNA的运行。
2) Sine is missing every other term
If we repeatedly take the derivative of sine at x = 0 we get:
with values:
Ignoring the division by the factorial, we get the pattern:
So the DNA of sine is something like [0, 1, 0, -1] repeating.
3) Different starting positions have different DNA
For fun, here's the Taylor series of $\sin(x)$ starting at $x =\pi$ (link):
A few notes:
DNA现在是[0,-1,0,1]。循环是类似的,但是起始值改变了,因为我们从$x=\pi$开始。
分母1、6、120、5040写成计算过的数字,看起来很奇怪。但它们只是其他的阶乘:1!= 1, 3 !5 = 6日!= 120, 7 != 5040。一般来说,泰勒级数的分母可能很复杂。
- The $O(x^{12})$ term means there are other components of order (power) $x^{12}$ and higher. Because $\sin(x)$ has infinite derivatives, we have infinite terms and the computer has to cut us off somewhere. (You've had enough Tayloring for today, buddy.)
Application: Function Approximations
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?
The Taylor series has a bunch of terms, typically ordered by importance:
- $c_0 = f(0)$, the constant term, is the exact value at the point
- $c_1 = f'(0)x$, the linear term, tells us what speed to move from our point
- $c_2= \frac{f''(0)}{2!}x^2 $, the quadratic term, tells us how much to accelerate away from our point
- and so on
If we only need a prediction for a few instants around our point, the initial position & velocity may be good enough:
If we're tracking for longer, then acceleration becomes important:
As we get further from our starting point, we need more terms to keep our prediction accurate. For example, the linear model $\sin(x) = x$ is a good prediction around $x=0$. As we get further out, we need to account for more terms.
Similarly, $e^x \sim 1 + x$ 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.
Application: Comparing Functions
DNA的常见应用是什么?亲子鉴定。
If we have a few functions, we can compare their Taylor series to see if they're related.
Here's the expansions of $\sin(x)$, $\cos(x)$, and $e^x$:
序列上有家族相似性,对吧?$x$的净幂除以一个阶乘?
One problem is the sequence for $e^x$ has positive terms, while sine and cosine alternate signs. How can we link these together?
Euler's great insight was realizing animaginary numbercould swap the sign from positive to negative:
哇。使用虚指数和分离成奇数/偶数次幂揭示了正弦和余弦隐藏在指数函数中。很神奇的。
Although this proof ofEuler's Formuladoesn't showwhythe imaginary number makes sense, it reveals the baby daddy hiding backstage.
附录:什锦啊哈!Moments
Relationship to Fourier Series
The Taylor Series extracts the "polynomial DNA" and theFourier Series/Transformextracts the "circular DNA" of a function. Both see functions as built from smaller parts (polynomials or exponential paths).
泰勒级数总是成立吗?
这涉及到超出我深度的数学分析,但某些函数不容易(或从来没有)用多项式逼近。
Notice that powers like $x^2, x^3$ explode as $x$ 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.
例如,这是$\ln(1 + x)$的泰勒级数。这条黑线就是我们想要的曲线,添加更多的项,即使是几十项,也很难让我们的精确度超过$x=1.0$。对于那些想要肆意发展的术语来说,要保持一个平缓的坡度太难了。
在这种情况下,我们只有在近似保持准确的情况下才有收敛半径(例如大约$|x| < 1$)。
Turning geometric to algebraic definitions
Sine is often defined geometrically: the height of a line on a circular figure.
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.
Similarly, the description of $e^x$ as "the function with its derivative equal to the current value" yields the DNA [1, 1, 1, 1], and polynomial $f(x) = 1 + \frac{1}{1!}x + \frac{1}{2!}x^2 + \frac{1}{3!}x^3 + \dots $. We went from a verbal description to an equation.
Phew! A few items to ponder.
快乐数学。
Other Posts In This Series
- A Gentle Introduction To Learning Calculus
- Understanding Calculus With A Bank Account Metaphor
- Prehistoric Calculus: Discovering Pi
- A Calculus Analogy: Integrals as Multiplication
- Calculus: Building Intuition for the Derivative
- How To Understand Derivatives: The Product, Power & Chain Rules
- How To Understand Derivatives: The Quotient Rule, Exponents, and Logarithms
- An Intuitive Introduction To Limits
- Intuition for Taylor Series (DNA Analogy)
- Why Do We Need Limits and Infinitesimals?
- Learning Calculus: Overcoming Our Artificial Need for Precision
- 关于是否0.999…= 1
- Analogy: The Calculus Camera
- Abstraction Practice: Calculus Graphs
- Quick Insight: Easier Arithmetic With Calculus
- How to Add 1 through 100 using Calculus
- Integral of Sin(x): Geometric Intuition