Game Development Reference
In-Depth Information
usually chosen to be x = 0. 25 Then the Taylor series polynomial with, say,
four terms is evaluated. This approximation is highly accurate. Stopping
at the x 7 term is su cient to calculate sinx to about five and a half decimal
digits for −1 < x < +1.
All this trivia concerning approximations is interesting, but our real
reason for bringing up Taylor series is to use them as nontrivial examples
of differentiating polynomials with the power rule, and also to learn some
interesting facts about the sine, cosine, and exponential functions. Let's use
the power rule to differentiate the Taylor series expansion of sin(x). It's not
that complicated—we just have to differentiate each term by itself. We're
not even intimidated by the fact that there are an infinite number of terms:
x − x 3
3! + x 5
x 7
7! + x 9
Differentiating Taylor
series for sin(x)
dx sinx = d
d
9! +
dx
5!
= d
dx x − d
x 3
3! + d
x 5
5!
d
dx
x 7
7! + d
x 9
9! +
(Sum rule)
dx
dx
dx
= 1 − 3x 2
3!
+ 5x 4
4!
7x 6
7!
+ 9x 8
9!
+
(Power rule)
= 1 − x 2
2! + x 4
x 6
6! + x 8
8! +
(11.11)
4!
In the above derivation, we first used the sum rule, which says that to
differentiate the whole Taylor polynomial, we can differentiate each term
individually. Then we applied the power rule to each term, in each case
multiplying by the exponent and decrementing it by one. (And also re-
membering that
d
dx x = 1 for the first term.) To understand the last step,
remember the definition of the factorial operator: n! = 1 × 2 × 3 × × n.
Thus the constant in the numerator of each term cancels out the highest
factor in the factorial in the denominator.
Does Equation (11.11) the last look familiar? It should, because it's
the same as Equation (11.10), the Taylor series for cosx. In other words,
we now know the derivative of sinx, and by a similar process we can also
obtain the derivative of cosx. Let's state these facts formally. 26
25 In this special case, the Taylor series is given the more specific name of Maclaurin
series.
26 We emphasize that we have not proven that these are the correct derivatives, because
we started with the Taylor series expansion, which is actually defined in terms of the
derivatives.
Search WWH ::




Custom Search