College Math Teaching

April 28, 2023

Taylor Polynomials without series (advantages, drawbacks)

Filed under: calculus, series, Taylor polynomial., Taylor Series — oldgote @ 12:32 am

I was in a weird situation this semester in my “applied calculus” (aka “business calculus”) class. I had an awkward amount of time left (1 week) and I still wanted to do something with Taylor polynomials, but I had nowhere near enough time to cover infinite series and power series.

So, I just went ahead and introduced it “user’s manual” style, knowing that I could justify this, if I had to (and no, I didn’t), even without series. BUT there are some drawbacks too.

Let’s see how this goes. We’ll work with series centered at c =0 (expand about 0) and assume that f has as many continuous derivatives as desired on an interval connecting 0 to x .

Now we calculate: \int^x_0 f'(t) dt = f(x) -f(0) , of course. But we could do the integral another way: let’s use parts and say u = f'(t), dv = dt \rightarrow du = f''(t), v = (t-x) . Note the choice for v and that x is a constant in the integral. We then get f(x) -f(0)=\int^x_0 f'(t) dt = (f'(t)(t-x)|^x_0 -\int^x_0f''(t)(t-x) dx . Evaluation:

f(x) =f(0)+f'(0)x -\int^x_0f''(t)(t-x) dx and we’ve completed the first step.

Though we *could* do the inductive step now, it is useful to grind through a second iteration to see the pattern.

We take our expression and compute \int^x_0f''(t)(t-x) dx  by parts again, with u = f''(t), dv =t-x \rightarrow du =f'''(t), v = {(t-x)^2 \over 2!} and insert into our previous expression:

f(x) =f(0)+f'(0)x - (f''(t){(t-x)^2 \over 2!}|^x_0 + \int^x_0 f'''(t){(t-x)^2 \over 2!} dt which works out to:

f(x) = f(0)+f'(0)x +f''(0){x^2 \over 2} + \int^x_0 f'''(t){(t-x)^2 \over 2!} dt and note the alternating sign of the integral.

Now to use induction: assume that:

f(x) = f(0)+f'(0)x +f''(0){x^2 \over 2} + ....f^{(k)}(0){x^k \over k!} + (-1)^k \int^x_0 f^{(k+1)}(t) {(t-x)^k \over k!} dt

Now let’s look at the integral: as usual, use parts as before and we obtain:

(-1)^k (f^{(k+2)}(t) {(t-x)^{k+1} \over (k+1)!}|^x_0 - \int^x_0 f^{(k+2)}(t) {(t-x)^{k+1} \over (k+1)!} dt ). Taking some care with the signs we end up with

(-1)^k (-f^{(k+1)}(0){(-x)^{k+1} \over (k+1)! } )+ (-1)^{k+1}\int^x_0 f^{(k+2)}(t) {(t-x)^{k+1} \over (k+1)!} dt which works out to (-1)^{2k+2} (f^{(k+1)}(0) {x^{k+1} \over (k+1)!} )+ (-1)^{k+1}\int^x_0 f^{(k+2)}(t) {(t-x)^{k+1} \over (k+1)!} dt .

Substituting this evaluation into our inductive step equation gives the desired result.

And note: NOTHING was a assumed except for f having the required number of continuous derivatives!

BUT…yes, there is a catch. The integral is often regarded as a “correction term.” But the Taylor polynomial is really only useful so long as the integral can be made small. And that is the issue with this approach: there are times when the integral cannot be made small; it is possible that x can be far enough out that the associated power series does NOT converge on (-x, x) and the integral picks that up, but it may well be hidden, or at least non-obvious.

And that is why, in my opinion, it is better to do series first.

Let’s show an example.

Consider f(x) = {1 \over 1+x } . We know from work with the geometric series that its series expansion is 1 -x +x^2-x^3....+(-1)^k x^k + .... and that the interval of convergence is (-1,1) But note that f is smooth over [0, \infty) and so our Taylor polynomial, with integral correction, should work for x > 0 .

So, nothing that f^{(k)} = (-1)^k(k!)(1+x)^{-(k+1)} our k-th Taylor polynomial relation is:

f(x) =1-x+x^2-x^3 .....+(-1)^kx^k +(-1)^k \int^x_0 (-1)^{k+1}(k+1)!{1 \over (1+t)^{k+2} } {(t-x)^k \over k!} dt

Let’s focus on the integral; the “remainder”, if you will.

Rewrite it as: (-1)^{2k+1} (k+1) \int^x_0 ({(t -x) \over (t+1) })^k {1 \over (t+1)} dt .

Now this integral really isn’t that hard to do, if we use an algebraic trick:

Rewrite ({(t -x) \over (t+1) })^k  = ({(t+1 -x-1) \over (t+1) })^k = (1-{(x+1) \over (t+1) })^k

Now the integral is a simple substitutions integral: let u = 1-{(x+1) \over (t+1) } \rightarrow du = (x+1)( {1 \over (t+1)})^2 dt so our integral is transformed into:

(-1) ({k+1 \over x+1}) \int^0_{-x} u^{k} du = (-1) {k  \over (k+1)(x+1)} (-(-x)^{k+1}) = (-1)^{k+1} {k+1 \over (k+1)(x+1)} x^{k+1} =(-1)^{k+1}{1 \over (x+1)}x^{k+1}

This remainder cannot be made small if x \geq 1 no matter how big we make k

But, in all honesty, this remainder could have been computed with simple algebra.

{1 \over x+1} =1-x+x^2....+(-1)^k x^k + R and now solve for R algebraically .

The larger point is that the “error” is hidden in the integral remainder term, and this can be tough to see in the case where the associated Taylor series has a finite radius of convergence but is continuous on the whole real line, or a half line.

April 16, 2023

Annoying calculations: hypergeometric expectation and variance

Filed under: statistics — Tags: — oldgote @ 10:17 pm

April 11, 2023

Annoying calculations in Statistics: correlation coefficient is always between -1 and 1.

Filed under: linear albegra, statistics — Tags: , — oldgote @ 9:24 pm

Yes, I misspelled “Cauchy-Schwarz” in the video.

April 3, 2023

One benefit of teaching service courses

Filed under: editorial, pedagogy — oldgote @ 1:55 am

This caught my eye. Pay attention to how the professor responds.

He seemed genuinely rattled at being laughed at in public. And notice how he responded with “Hey, I am the expert here!”

I wonder if he has a lot of experience teaching courses in which many of the students really don’t want to be there, but have to be.

And that is what I have learned from teaching such courses: if you are going to given an answer that seems to go against the “common sense” of the student, it is a good thing to have a ready made reply such as “I can see why you might think that, but here is where it goes wrong…”

I don’t want to get too much into the details because this is a math teaching blog, not a biology blog. But it appears to me that he might have said “ok, in many cases, you can tell, but not in every case, and this is why…”

But instead, the professor pulled the “credentials card.”

Having some experience with a, well, disinterested audience (if not outright hostile at times) can be a good thing.

Blog at WordPress.com.