Notes on Taylor and Maclaurin Series
21–30 of 34 posts
Re: Notes on Taylor and Maclaurin Series
#22This is very much in the spirit of 3Blue1Brown. Very nice work.
Re: Notes on Taylor and Maclaurin Series
#23Earlier quoted context omitted.
Yes! The workhorse numerical technique is Chebyshev approximation. Remez exchange usually starts with it, for fine-tuning with respect to a "maximum error" norm, but it also works quite well by itself, and can be computed efficiently (even with a high degree) even from a function you can only evaluate numerically. A really good place to read up on it is the documentation for Chebfun. https://www.chebfun.org/docs/guid…
Chebyshev’s polynomials seem to have eclipsed his semi-iterative method for solving linear systems, which is too bad IMO.
Re: Notes on Taylor and Maclaurin Series
#24All interests I had in Taylor/Macluarin series were promptly beat out of me when having to manually calculate hundreds of them in Calculus courses :). The Remez algorithm linked at the end still inspires curiosity though. Any other "numerically more useful" approximation algorithms folks want to highlight? The Padé approximant looks like another interesting candidate to read about.
Weird. When I was doing boxing, having to run sprints every training session, doing dozens of pushups, situps and what not did not beat the interest I had in boxing :).
Of course this "interested in applying concepts to solve the problem, not calculating the values in said solution" lean is probably why I was in a computer program instead of a math program in the first place :).
Re: Notes on Taylor and Maclaurin Series
#25Something that seems to be frequently lacking in discussions of convergence in introductory texts on Taylor series is the possibility that the series DOES converge, but NOT to the approximated function. It's not sufficient to conclude that the derived Taylor series must converge to cos(x) because it always converges, since any of the infinitely many functions that match cosine's derivatives at x = 0 will have the sam…
As you say, there's no guarantee that even a convergent Taylor series[0] converges to the correct value in any interval around the point of expansion. Though the series is of course trivially[1] convergent at the point of expansion itself, since only the constant term doesn't vanish.
The typical example is f(x) = exp(-1/x²) for x ≠ 0; f(0) = 0. The derivatives are mildly annoying to compute, but they must look like f⁽ⁿ⁾(x) = exp(-1/x²)pₙ(1/x) for some polynomials pₙ. Since exponential growth dominates all polynomial growth, it must be the case that f(0) = f'(0) = f"(0) = ··· = 0. In other words, the Taylor series is 0 everywhere, but clearly f(x) ≠ 0 for x ≠ 0. So the series converges only at x = 0. At all other points it predicts the wrong value for f.
The straight-forward real-analytic approach to resolve this issue of goes through the full formulation of Taylor's theorem with an explicit remainder term[2]:
f(x) = Σⁿf⁽ᵏ⁾(a)(x-a)ᵏ/k! + Rₙ(x),
where Rₙ is the remainder term. To clarify, this is a _truncated_ Taylor expansion containing terms k=0,...,n.
There are several explicit expressions for the remainder term, but one that's useful is
Rₙ(x) = f⁽ⁿ⁺¹⁾(ξ)(x-a)ⁿ⁺¹/(n+1)!,
where ξ is not (a priori) fully known but guaranteed to exist in [min(a,x), max(a,x)]. (I.e the closed interval between a and x.)
Let's consider f(x) = cos(x) as an easy example. All derivatives look like ±sin(x) or ±cos(x). This lets us conclude that |f⁽ⁿ⁺¹⁾(ξ)| ≤ 1 for all ξ∈(-∞, ∞). So |Rₙ(x)| ≤ (x-a)ⁿ⁺¹/(n+1)! for all n. Since factorial growth dominates exponential growth, it follows that |Rₙ(x)| → 0 as n → ∞ regardless of which value of a we choose. In other words, we've proved that f(x) - Σⁿf⁽ᵏ⁾(a)(x-a)ᵏ/k! = Rₙ(x) → 0 as n → ∞ for all choices of a. So this is a proof that the value of the Taylor series around any point is in fact cos(x).
Similar proofs for sin(x), exp(x), etc are not much more difficult, and it's not hard to turn this into more general arguments for "good" cases. Trying to use the same machinery on the known counterexample exp(-1/x²) is obviously hopeless as we already know the Taylor series converges to the wrong value here, but it can be illustrative to try (it is an exercise in frustration).
A nicer, more intuitive setting for analysis of power series is complex analysis, which provides an easier and more general theory for when a function equals its Taylor series. This nicer setting is probably the reason the topic is mostly glossed over in introductory calculus/real analysis courses. However, it doesn't necessarily give detailed insight into real-analytic oddities like exp(-1/x²) [3].
[0]: For reference, the Taylor series of a function f around a is: Σf⁽ᵏ⁾(a)(x-a)ᵏ/k!. (I use lack of upper index to indicate an infinite series as opposed to a sum with finitely many terms.)
[1]: At x = a, the Taylor series expansion is f(a) = Σⁿf⁽ᵏ⁾(a)(a-a)ᵏ/k! = f(a) + f'(a)·0 + f"(a)·0² + ··· = f(a). All the terms containing (x-a) vanish.
[2]: https://en.wikipedia.org/wiki/Taylor%27s_theorem#Taylor's_th...
[3]: Something very funky goes on with this function as x → 0 in the complex plane, but this is "masked" in the real case. In the complex case, this function is said to have an essential singularity at x = 0.
Re: Notes on Taylor and Maclaurin Series
#26One of the things that has always seemed rather magical to me is the Taylor series of the exponential function for very large negative values. We know that a number like e^-100 is a number extremely close to zero. Yet when you write out the Taylor series you see an alternating some of increasingly large, seemingly arbitrary numbers (at least for ~100 terms): e^-100 = 1 - 100 + 5000 - 166,666.6 + 4,166,666.6 - ... If…
The whole polynomial functions that give the truncations of the exponential Taylor series are also well-behaved in a way that's really surprising if you haven't thought about it before. For example, if you plot 1, 1 + x + x^2/2, 1 + x + x^2/2 + x^3/6 + x^4/24, and so on, you'll see that they actually don't oscillate at all as you might expect for negative inputs (for the reason you're saying), but rather they're very…
Re: Notes on Taylor and Maclaurin Series
#27In complex analysis, all differentiable (in a region) functions are infinitely differentiable, and are the same as their Taylor series. Real analysis is a zoo of weird exceptions. Including 1/e^(-1/x^2) away from 0, 0 at 0. Its Maclaurin series is just 0, which is clearly not the function we wrote down. I can't explain why real analysis fit my brain and complex analysis doesn't. But to me complex analysis looks like,…
Complex analysis is far too nice. There are so many theorems where my first thought was "there's no way that's true". Picard's great theorem is totally insane. As is even its little brother, and even Liouville's theorem. The proofs aren't even that long. They just feel totally false.
I think it is because being holomorphic is so much stronger even than C^\infty (continuous with all derivatives continuous) real much less just continuous or merely integrable.
Re: Notes on Taylor and Maclaurin Series
#28In complex analysis, all differentiable (in a region) functions are infinitely differentiable, and are the same as their Taylor series. Real analysis is a zoo of weird exceptions. Including 1/e^(-1/x^2) away from 0, 0 at 0. Its Maclaurin series is just 0, which is clearly not the function we wrote down. I can't explain why real analysis fit my brain and complex analysis doesn't. But to me complex analysis looks like,…
Complex analysis is far too nice. There are so many theorems where my first thought was "there's no way that's true". Picard's great theorem is totally insane. As is even its little brother, and even Liouville's theorem. The proofs aren't even that long. They just feel totally false.
But once you have the machine...
-----
Fundamental Theorem of Algebra: Every nonconstant polynomial over the complex numbers has a complex root.
Proof: Suppose that p(z) is a polynomial over the complex numbers with no root.
Consider the function 1/p(z). If p(z) had no roots, then 1/p(z) is entire. But we can bound it for everything outside of a large circle because the leading term dominates the others. And since the large circle is compact, we can bound p(z) away from 0 inside the circle. Between the two, 1/p(z) is bounded, and so much be constant by Liouville's theorem.
But 1/p(z) is only constant if p(z) is constant. Therefore any complex polynomial with no complex roots must be constant.
-----
I'm convinced by the proof. But part of me still says that it is magic.
Re: Notes on Taylor and Maclaurin Series
#29Earlier quoted context omitted.
Weird. When I was doing boxing, having to run sprints every training session, doing dozens of pushups, situps and what not did not beat the interest I had in boxing :).
The big difference is probably that I wasn't taking the math classes out of interest in being great at computations. Just like manually doing long division of the factorial denominator wouldn't have made me any better able to apply Taylor series, finding the 3rd derivative of a random trig function manually (well, for some reason a trig reference table was allowed but not a CAS) dozens of times didn't make me any bet…
To build competence at these problems, you need to exercise the basic skills, of which computational skills are a big part. If you don't exercise your computational skills, you can't become good at mathematics in the sense of (1), (2), or (3). The same way you can't get to be good at boxing without doing a lot of pushups.
Now, not all teachers are good. Many certainly try to force students to do too much computational practice, compared to their level. But both as a student and later as a prof, I discovered that there is value is doing really dumb and complicated calculations by hand sometimes during your education. The reason is that many times when people your computational algorithm fails, you have to do the dirty thing by hand to figure out what went wrong. And depending on what you do, computing the 3rd derivative of a random trig function manually correctly with nuances is exactly what you need to do [1].
Well, not everyone. Many/most people do jobs that only require low levels of maths, and they might never need to do any of that. But a math course taught to everyone has to take a cookie cutter approach and that usually requires setting a high enough bar, so people who have to do the hard math at their job, have those skills. This is an unfortunate fact of resource optimization.
[1] I am an industry researcher now, and have to do all kinds of these crappy calculations.
Re: Notes on Taylor and Maclaurin Series
#30Earlier quoted context omitted.
The big difference is probably that I wasn't taking the math classes out of interest in being great at computations. Just like manually doing long division of the factorial denominator wouldn't have made me any better able to apply Taylor series, finding the 3rd derivative of a random trig function manually (well, for some reason a trig reference table was allowed but not a CAS) dozens of times didn't make me any bet…
Let me state my point explicitly: You are probably referring to real math as one of (1) building abstraction, (2) doing proofs of theorems, (3) solving applied math problems. To build competence at these problems, you need to exercise the basic skills, of which computational skills are a big part. If you don't exercise your computational skills, you can't become good at mathematics in the sense of (1), (2), or (3). T…
What I mean by randomly calculate in this case is be given a random trig equation, be told to hand calculate an nth level Taylor series, compute the numerical answer to a few values, and move on to the next problem until you've done hundreds in the course. I do NOT mean running through dozens practice problems to get better at learning when/how to apply Taylor series (though that did come in a later course, it thankfully didn't need to be done by hand just as nobody was expecting you to calculate sqrt(5.7) by hand to learn calculus either).
This no doubt makes me a great calculator of 5th derivatives of trig functions but, except for the first few perhaps, at the expense of dozens of hours of being great at actually applying tricks to do things with what the Taylor series spits out instead. Like you say, the math course has to give cookie cutter training sometimes not about the direct concept at hand but that means you can be shit out of luck if that cookie cutter training wasn't relevant for boxing even though the topic itself can be.