Taylor Series

For the discussion of math. Duh.

Moderators: gmalivuk, Moderators General, Prelates

User avatar
superglucose
hermaj's new favourite
Posts: 2353
Joined: Wed Sep 12, 2007 1:59 am UTC
Location: Domain of Azura
Contact:

Taylor Series

Postby superglucose » Mon May 10, 2010 4:25 am UTC

Ok, infinite sequences and series is fine. Power Series are weird and I'm not sure what the point of them is, but ok. Turning functions into power series seems pretty easy too... just remember that 1/(1-x) = sum(x^n) and then do some fancy substitutions, derivations, and integrations and you can find any of them. No problem, again.

Now, what the hell are these Taylor Series? I've sat through three lectures on them and stared at the book dozens of times, and it keeps saying things like "Clearly if e^x has a power series representation, then it would be x^n/n!" and then "Well, does it have a power series representation? To prove that it does, what we're going to do is say that lim(X^n/n!) as n-> infinity = 0. Voila! Proved!"

So one billion internet bucks to someone who can explain to me what the hell a Taylor Series is, why it's useful, and why I should care about it. My (terrible) math book stops just shy of saying what it is, and Wikipedia is written by pseudo-intellectuals looking to impress each other (at least, the math and physics portions I've found) so those sources aren't helpful in the slightest.
Image

Yesila
Posts: 221
Joined: Sun Dec 16, 2007 11:38 am UTC

Re: Taylor Series

Postby Yesila » Mon May 10, 2010 5:04 am UTC

Taylor series can be thought of as a method to determine what the power series for a function is. the 1/(1-x) trick is great when it works quickly and easily... but that's not always the case.

With taylor series we start off by assuming that a function does have a power series representation (centered at some value a). So:

[math]f(x)=c_0+c_1 (x-a) + c_2 (x-a)^2 + \dots[/math]

We now notice that if this is true and we set x=a... we get [imath]f(a)=c_0[/imath] All the other terms are zero so we know what the first coefficient of the power series is. We then take a derivative,

[imath]f^\prime(x)= c_1+2 c_2 (x-a) + 3 c_3 (x-a)^2 + \dots[/imath]

the [imath]c_0[/imath] term goes away, the powers on the [imath](x-a)[/imath] terms go down by one and when we set [imath]x=a[/imath] this time... we get [imath]f^\prime(a)=c_1[/imath]. Repeat again and we find

[imath]f^{\prime\prime}(x)= 2 c_2 + (3)(2)(x-a) + (4)(3)(x-a)^2 + \dots[/imath]

So [imath]f^{\prime\prime}(a)=2 c_2[/imath], we solve for [imath]c_2.[/imath] etc . After we get board of doing this we start to realize that there is a pattern and we get the formula for the taylor coefficients that I'm sure you book has...


Of course we made a MAJOR assumption to get to this point. We assumed that the function actually has a power series expansion at x=a... Not all functions have one centered at any point. (consider 1/x centered at 0 for an easy counterexample) But taylor series can still be a nice powerful tool to get us going and if we know that a function does have a power series expansion about a... we now know a algorithmic way to find as many coefficients as we want to compute.

[imath]f(x)=e^x[/imath] centered at a=0 is a nice one to start out with because the derivatives are all the same and so the coefficients are easy to compute. Another "nice" place to gain some trust that this taylor series things actually works is to use it with some polynomials... the power series end up terminating (as they should) pretty soon, but it's kinda fun to use this powerful tool to come up with a way to factor an (x-a) out of a polynomial... complete overkill but still fun.


I don't know if it'll help any but here's a handout that I made the last time I taught this class. It's in a Fill-in-the-blank format, so some parts (especially those towards the end) are sometimes harder to do than others since the intention was that I was doing it during my lecture.... but the beginning part I think can be done without outside influence.
Attachments
h1110.ps
(105.16 KiB) Downloaded 113 times

User avatar
ConMan
Shepherd's Pie?
Posts: 1690
Joined: Tue Jan 01, 2008 11:56 am UTC
Location: Beacon Alpha

Re: Taylor Series

Postby ConMan » Mon May 10, 2010 5:16 am UTC

(Ninja'd by Yesila.)

Suppose we want to approximate some function (which we assume is sufficiently well-behaved for us to do this) with a polynomial of degree n. In particular, we want to build the polynomial that, in the neighbourhood of some point x0, is the "best" approximation for our given function - for a given definition of "best".

One particular criterion to determine the "best" approximation is to calculate the residual Rn(x) - i.e. the difference between the function and its polynomial approximation - and attempt to bound it by an additional polynomial term, which we then try to minimise in the neighbourhood of x0.

It turns out that this "best" polynomial approximation is the truncated Taylor series for the function calculated about x0. And, when our function is swb, we can show that the residual term shrinks as the degree of the polynomial increases - i.e. our approximation keeps getting better as we add more terms to it. In fact, for a particular class of functions we can show that Rn(x) -> 0 as n -> infinity, so that the infinite power series that is formed as the limit of the polynomials can be considered to equal the function itself.
pollywog wrote:
Wikihow wrote:* Smile a lot! Give a gay girl a knowing "Hey, I'm a lesbian too!" smile.
I want to learn this smile, perfect it, and then go around smiling at lesbians and freaking them out.

User avatar
superglucose
hermaj's new favourite
Posts: 2353
Joined: Wed Sep 12, 2007 1:59 am UTC
Location: Domain of Azura
Contact:

Re: Taylor Series

Postby superglucose » Mon May 10, 2010 5:20 am UTC

Yesila wrote:Taylor series can be thought of as a method to determine what the power series for a function is. the 1/(1-x) trick is great when it works quickly and easily... but that's not always the case.

So let me get this straight: the Taylor Series is NOT a series in and of itself, but a method of FINDING a power series for a given function? Were they drunk when they named it?

ConMan wrote:Suppose we want to approximate some function (which we assume is sufficiently well-behaved for us to do this) with a polynomial of degree n.


Edit: you've lost me. Why would we want to approximate some function with a polynomial of degree n if we already have the function? It's like handing me a protractor and a tape measure and asking me to use the protractor to figure out how tall I am. I understand there might be an application, but what is it? Why do I care? And how the hell does N become infinite?

In any case, after reading that very first part of Yesila's thing and trying to figure out, I have gotten all of the practice problems correct.
Image

User avatar
Torn Apart By Dingos
Posts: 817
Joined: Thu Aug 03, 2006 2:27 am UTC

Re: Taylor Series

Postby Torn Apart By Dingos » Mon May 10, 2010 5:27 am UTC

Taylor series are essentially polynomials of infinite degree. Polynomials are the simplest functions to deal with, and therefore it is convienient to write functions as power series if possible. For one thing, it allows us to calculate numerically functions to arbitrary precision: it is unclear, for example, how to even calculate sin(1) without using a calculator, but using Taylor series, we may just take the first ten terms of the Taylor expansion of sin, plug in 1, and we'll have a pretty damn good approximation (we can even calculate an upper bound of the error to guarantee we are close to the real answer). Also, power series are simple to integrate (assuming there are no convergence issues): just integrate termwise. Another practical use: it makes many limits easy to compute. For example, to compute the limit of (e^x-1)/sin x as x tends to 0, we can expand the numerator and denominator into taylor series, divide both by x, and then set x to 0, leaving a single term, which is our limit.

Taylor series can be used to derive Euler's formula [imath]e^{ix}=\cos x+i\sin x[/imath]: expand [imath]e^{ix}[/imath] in a Taylor series, and recognize that the real terms make up the taylor series for cos and the imaginary terms make up the taylor series for sin (there's some technicalities involved: we need to know that it's even okay to plug complex numbers into these functions - some books define [imath]e^{ix}[/imath] to be equal to this expression, but doing formal manipulations with Taylor series in this way suggests that if [imath]e^{ix}[/imath] were to be defined at all, it should be equal to precisely [imath]\cos x+i\sin x[/imath]).

ThomasS
Posts: 585
Joined: Wed Dec 12, 2007 7:46 pm UTC

Re: Taylor Series

Postby ThomasS » Mon May 10, 2010 5:42 am UTC

superglucose wrote:So let me get this straight: the Taylor Series is NOT a series in and of itself, but a method of FINDING a power series for a given function? Were they drunk when they named it?

No. "A Taylor series" is a particular instance of a series constructed from some function using the method described. So if we are being careful with terminology [imath]\sum_n \frac{x^n}{n!}[/imath] is the Taylor series of [imath]e^x[/imath] centered at 0. That is, we choose [imath]a=0[/imath] in the formula/argument presented by Yesila. [imath]e^x[/imath] has other Taylor series centered at other locations.(Note that the word "series" can be either singular or plural, a chapter in a book labeled "Taylor series" probably intends the plural.) The phrase Maclaurin series is another name for a Taylor series centered at 0.

superglucose wrote:Edit: you've lost me. Why would we want to approximate some function with a polynomial of degree n if we already have the function? It's like handing me a protractor and a tape measure and asking me to use the protractor to figure out how tall I am. I understand there might be an application, but what is it? Why do I care? And how the hell does N become infinite?

For a simple example, consider that a computer doesn't inherently know how to compute say [imath]\sin(2.5)[/imath]. However a computer can add and multiply. So in fact it is typical for computers and calculators to use Taylor series internally when asked to find such things.

aleph_one
Posts: 140
Joined: Sun Oct 28, 2007 4:27 pm UTC
Location: Cambridge, MA

Re: Taylor Series

Postby aleph_one » Mon May 10, 2010 5:46 am UTC

I'll take your "why you should care about it" and raise you to "why Taylor series are amazing, awesome, holy-crap-is-that-really-possible?"

By representing a function as an infinite polynomial, the Taylor series allows one to evaluate a function on any object on which addition, multiplication, and limits have been defined. As a result, function such as sin, ln, and exp can be defined on objects such as complex number, matrices, and linear operators, though of course convergence still has to be considered.. So, you can take sin(i) or the exponential of the derivative operator (which equals the shift operator! - this is exactly what Taylor series say).

A second striking result of the Taylor expansion is that an analytic function is determined completely by its local properties at a point (i.e. its sequence of derivatives). So, for instance, of could take any fragment piece of the sine function, no matter how tiny, and uniquely recover the whole sine function, in all its glorious waviness (if we require that the result be analytic - granted, the whole statement is a bit cheap, since analytic means "representable by Taylor series", but most everyday functions are analytic).
Last edited by aleph_one on Mon May 10, 2010 5:50 am UTC, edited 1 time in total.

phr34k
Posts: 58
Joined: Mon Dec 31, 2007 5:59 am UTC

Re: Taylor Series

Postby phr34k » Mon May 10, 2010 5:48 am UTC

EDIT: Ninja'd but whatever.

superglucose wrote:So let me get this straight: the Taylor Series is NOT a series in and of itself, but a method of FINDING a power series for a given function? Were they drunk when they named it?

This is not quite correct.

Power series are simply things of the form a_0+a_1x+a_2x^2+... or a_0+a_1(x-x_0)+a_2(x-x_0)+..., the latter being centered at x_0.

Taylor series are power series that represent functions, in the sense that on some domain the power series converges to the function f. It is called a Taylor series to emphasize the fact that this particular power series represents some function on some domain.

superglucose wrote:Edit: you've lost me. Why would we want to approximate some function with a polynomial of degree n if we already have the function? It's like handing me a protractor and a tape measure and asking me to use the protractor to figure out how tall I am. I understand there might be an application, but what is it? Why do I care? And how the hell does N become infinite?


Quick, what is e?

Well, I can approximate it as 1, as 1+1, as 1+1+1/2, as 1+1+1/2!+1/3!, as 1+1+1/2!+1/3!+1/4!, (the margin of error on the last thing is e/4! actually, which is pretty good). This approximation comes from the taylor series of e^x. Similarly, you can answer questions such as what sin(5) is or ln(7), etc.

and N doesn't exactly become infinite. Rather, you can obviously add, multiply, integrate and differentiate taylor series, and this happens to correspond to adding, multiplying, integrating and differentiating the functions they represent. So when you treat the series like an 'infinite' polynomial, you are actually keeping track of all the data you need to approximate the function to any degree of accuracy that you wish. So in some sense the taylor series is a compact way of expressing what the function is in a computable/estimatable way that also allows you to do all the algebra and analysis you would want to do on the function. So yeah, extremely useful.

User avatar
ConMan
Shepherd's Pie?
Posts: 1690
Joined: Tue Jan 01, 2008 11:56 am UTC
Location: Beacon Alpha

Re: Taylor Series

Postby ConMan » Mon May 10, 2010 6:12 am UTC

And actually, the comments that Taylor series can (with some conditions) be manipulated just like finite polynomials means that you can do things with them to prove other useful properties of functions, series and other things.

For example, as stated above, the Taylor series of exp(x), sin(x) and cos(x) can be used to show Euler's formula - exp(ix) = cos(x) + i sin(x), which in turn can greatly simplify many trigonometric identities by changing them to exponential ones. You can also use the fact that Taylor series are termwise differentiable and integrable to find the Taylor series of functions that aren't easy to directly calculate - such as ln(1+x), which you can find the Taylor series for by integrating the one for 1/(1+x), and from that show that 1+1/2+1/3+... = ln(2).
pollywog wrote:
Wikihow wrote:* Smile a lot! Give a gay girl a knowing "Hey, I'm a lesbian too!" smile.
I want to learn this smile, perfect it, and then go around smiling at lesbians and freaking them out.

User avatar
PM 2Ring
Posts: 3700
Joined: Mon Jan 26, 2009 3:19 pm UTC
Location: Sydney, Australia

Re: Taylor Series

Postby PM 2Ring » Mon May 10, 2010 6:42 am UTC

superglucose wrote:Power Series are weird and I'm not sure what the point of them is, but ok.

Power series give us a common ground where we can work with all sufficiently well-behaved functions on an equal footing. Without such common ground, we'd have to treat polynomial functions, rational functions, exponential functions, trigonometric functions, etc as separate types of entities that can't even be compared easily.

superglucose wrote:"Clearly if e^x has a power series representation, then it would be x^n/n!" and then "Well, does it have a power series representation? To prove that it does, what we're going to do is say that lim(X^n/n!) as n-> infinity = 0. Voila! Proved!"

We don't just say that limit equals zero, we prove it. This is a fairly important result, and IIRC it can be proved just using the limit definition of [imath]e = \lim_{n \rightarrow \infty} (1 - 1/n)^n[/imath] and that [imath]d/dx(e^x) = e^x[/imath] (which itself follows fairly easily from the limit definition of e).

superglucose wrote:Wikipedia is written by pseudo-intellectuals looking to impress each other (at least, the math and physics portions I've found) so those sources aren't helpful in the slightest.

IMHO, the Wikipedia mathematics and physics articles are quite good, but they often tend to assume a fair degree of background knowledge, so they function more as a summary of a topic and in many cases are not a good place to learn a topic from scratch.

User avatar
NathanielJ
Posts: 882
Joined: Sun Jan 13, 2008 9:04 pm UTC

Re: Taylor Series

Postby NathanielJ » Mon May 10, 2010 11:01 am UTC

PM 2Ring wrote:IMHO, the Wikipedia mathematics and physics articles are quite good, but they often tend to assume a fair degree of background knowledge, so they function more as a summary of a topic and in many cases are not a good place to learn a topic from scratch.


This is an important point that has to be stressed. People often complain about Wikipedia being awful for learning math, but that's not the point of Wikipedia. Wikipedia, as its name suggests, is meant to be an encyclopedia. It's a reference. You wouldn't try to learn French from Wikipedia (even though it has several great articles on it), so I don't see why you would try to learn math from it.

Edit: While I'm here...

Why would we want to approximate some function with a polynomial of degree n if we already have the function?


In addition to what others have already said, you don't need to "already have the function" in order to find a Taylor series. You just need to know the value of the function and its derivatives at a single point. So maybe you don't know what f(x) itself looks like, but you know that it has a Taylor series (with some radius of convergence) and you know the value of f(0), f'(0), f''(0), f'''(0), and so on.

Boom. You know the function, thanks to Taylor series.

This comes up, for example, when solving some differential equations. Differential equations (and integrals, for that matter) don't generally have nice solutions, so Taylor series solutions are one way around that. Integrate sin(x)/x for me. After you spend all day and all night trying to do that (and fail), what you can do instead is take the Taylor series for sin(x), divide each term by x, then integrate term-by-term, and realize that you now have a Taylor series for the antiderivative of sin(x)/x. There is *no way* to write this function in terms of other well-known functions like ln(x) and sqrt(x) that you're comfortable with, so a Taylor series is in some sense the best you can do.
Homepage: http://www.njohnston.ca
Conway's Game of Life: http://www.conwaylife.com

User avatar
Torn Apart By Dingos
Posts: 817
Joined: Thu Aug 03, 2006 2:27 am UTC

Re: Taylor Series

Postby Torn Apart By Dingos » Mon May 10, 2010 11:56 am UTC

NathanielJ wrote:This is an important point that has to be stressed. People often complain about Wikipedia being awful for learning math, but that's not the point of Wikipedia. Wikipedia, as its name suggests, is meant to be an encyclopedia. It's a reference. You wouldn't try to learn French from Wikipedia (even though it has several great articles on it), so I don't see why you would try to learn math from it.
Does anyone say that? I think most mathematical articles on Wikipedia are excellent, and it's my understanding that that's the general consensus. It's not just a reference. It usually has very good explanations and motivations. I think the article on Taylor series is fine (although this particular article spreads a little thin on motivation, but then again so do most textbooks). You shouldn't learn math from any encyclopedia though (most of all because you need a fixed and consistent set of definitions to be able to prove anything). A site that's bad to learn mathematics from, however, is Mathworld, which is just a reference and most of the time is indecipherable unless you've already once learnt the stuff you're reading about.

User avatar
Dason
Posts: 1311
Joined: Wed Dec 02, 2009 7:06 am UTC
Location: ~/

Re: Taylor Series

Postby Dason » Mon May 10, 2010 10:53 pm UTC

ConMan wrote: 1+1/2+1/3+... = ln(2).

Might want to watch out a little more with the signs. This really confused me for a second (it has been a while since I've done anything with the taylor series for ln(1+x)) and then I was like "No, thats just a lie".
double epsilon = -.0000001;

User avatar
BlackSails
Posts: 5315
Joined: Thu Dec 20, 2007 5:48 am UTC

Re: Taylor Series

Postby BlackSails » Mon May 10, 2010 11:43 pm UTC

superglucose wrote:Edit: you've lost me. Why would we want to approximate some function with a polynomial of degree n if we already have the function? It's like handing me a protractor and a tape measure and asking me to use the protractor to figure out how tall I am. I understand there might be an application, but what is it? Why do I care? And how the hell does N become infinite?

In any case, after reading that very first part of Yesila's thing and trying to figure out, I have gotten all of the practice problems correct.


Lets say you have some very nasty function. Very terrible indeed. But lets also assume you only need to work with it in some small domain. For concreteness, lets talk about the simple pendulum. The position of this pendulum is a function that you cant write down in terms of normal functions. However, if you say "well, lets assume that we are only making small motions around the center (ie, the pendulum's maximum angle is small), then you can use the taylor series of sin(x) to say that "for small x, sin(x)~=x", and now your differential equation is trivially solvable.

This sort of thing continues in physics all the way up to quantum field theory.

User avatar
ConMan
Shepherd's Pie?
Posts: 1690
Joined: Tue Jan 01, 2008 11:56 am UTC
Location: Beacon Alpha

Re: Taylor Series

Postby ConMan » Tue May 11, 2010 4:20 am UTC

Dason wrote:
ConMan wrote: 1+1/2+1/3+... = ln(2).

Might want to watch out a little more with the signs. This really confused me for a second (it has been a while since I've done anything with the taylor series for ln(1+x)) and then I was like "No, thats just a lie".

Oops, you're completely correct. 1+1/2+1/3+... is a divergent series, whereas 1-1/2+1/3-1/4+... = ln(2).
pollywog wrote:
Wikihow wrote:* Smile a lot! Give a gay girl a knowing "Hey, I'm a lesbian too!" smile.
I want to learn this smile, perfect it, and then go around smiling at lesbians and freaking them out.

Yesila
Posts: 221
Joined: Sun Dec 16, 2007 11:38 am UTC

Re: Taylor Series

Postby Yesila » Tue May 11, 2010 6:02 am UTC

superglucose wrote:
Yesila wrote:Taylor series can be thought of as a method to determine what the power series for a function is. the 1/(1-x) trick is great when it works quickly and easily... but that's not always the case.

So let me get this straight: the Taylor Series is NOT a series in and of itself, but a method of FINDING a power series for a given function? Were they drunk when they named it?

No they most defiantly are a series. I just said to think of them that way because in the context of a person just learning about power series in general, and how Taylor series fit in you'll be seeing that 99% of the time every Taylor series of a function you deal with is the power series for that same function. So in a quest to try and figure out how Taylor series and power series are different... You'll have a hard time.

The real answer to what a Taylor series is, is that "it is what it is". Take the value of a function and the value of it's derivatives at a point and write down a particular series, that is the Taylor series. In your context this Taylor series will be interesting exactly when it is equal to the function that generated it, (which will happen that 99% of the time for the problems you will see in a calc II book).

Again in the context of your class every time you see a problem that says "find the Taylor series of f(x) centered at x=a" you get to translate that as 'take a bunch of derivatives of f(x), plug in x=a, multiply those by (x-a)^n/n! and add them all up.' So when I said that you can think of Taylor series as a method for finding a power series, I was saying that in the context of doing your homework and test problems.

Of course if your teacher is a jerk (like I am) they will throw in a few questions where you'll need to be able to know a bit more that that... but after you've done a slew of "standard" problems those ones that require a bit of thought won't be so bad either.


Return to “Mathematics”

Who is online

Users browsing this forum: No registered users and 10 guests