yego.me
💡 Stop wasting time. Read Youtube instead of watch. Download Chrome Extension

Trick involving Maclaurin expansion of cosx


3m read
·Nov 11, 2024

The first three nonzero terms of the McLaurin series for the function ( f(x) = x \cos(x) ).

So one thing that you're immediately going to find, let's just remind ourselves what a McLaurin series looks like. Our ( f(x) ) can be approximated by the polynomial. We're going to evaluate ( f ) at zero. That's why it's a McLaurin series; it's going to be centered at zero. It's a Taylor series centered at zero plus ( f'(0) \cdot x ) plus ( \frac{f''(0) \cdot x^2}{2} + \frac{f'''(0) \cdot x^3}{3!} ) and we keep going on and on and on forever.

What you're immediately going to find is when you start taking the derivatives of ( f ) and then the second, third, fourth, and fifth derivatives, you're actually going to have to take a bunch of derivatives here. Every time you're going to have to apply the product rule. This is going to get very hairy very, very fast.

So there's actually a trick to this problem. What we want to do, we could find the McLaurin series. We can find the first three nonzero terms of the McLaurin series for ( \cos(x) ) and then just multiply that by ( x ). Because, you know, if we just have ( x \cos(x) ), you could use the same thing as ( x \times ).

Or another way of saying it is the first three terms of the McLaurin expansion for this is just going to be ( x ) times the first three terms of the McLaurin expansion for ( \cos(x) ). So let's do that. To do that, let's think about the various derivatives of ( \cos(x) ).

So if ( f(x) ), let me use a different letter here for the function, if ( g(x) = \sin(x) ), then ( g(0) = 1 ). The first derivative would be equal to ( \sin(x) ), so the first derivative evaluated at zero is zero. The sine of anything or, negative sine of zero, I should say, is going to be zero.

Then the second derivative, well, the derivative of sine is cosine, so it's negative sine. The second derivative evaluated at zero is going to be equal to -1. You might start seeing a pattern here. The third derivative of ( \sin(x) ) is equal to ( \cos(x) ). If I evaluate the third derivative at zero, I'm going to get zero again.

When I take the derivative of this, when I take the fourth derivative, I get back to cosine. The fourth derivative is the same thing as the function, so the fourth derivative evaluated at zero, this is also going to be zero. The fifth derivative evaluated at zero, this cycles. This is going to be the sixth derivative evaluated at zero, this is going to be the seventh derivative evaluated at zero.

So what are the first three nonzero terms? Let's see, it's going to be this one, it's going to be this one, and it is going to be this one. We have, or let me just do it for ( \cos(x) ), so let me write this down. You might already know the first three nonzero terms of the McLaurin series for ( \cos(x) ), but I'm finding it here for us.

So ( \cos(x) ) is approximately equal to... The first term here is just ( \cos(0) ), so that's just 1. Then the next one is going to be our second derivative, so it's ( -\frac{1}{2!} x^2 ). This is the one that involves the second derivative, ( x^2 ). Then we're going to involve the fourth derivative and the coefficient ( 1 ). So it's going to be ( +\frac{1}{4!} x^4 ).

If it involves the fourth derivative, well, it's going to be divided by four factorial. So it's going to be times ( x^4 ). And there you have it. These are the first three nonzero terms of the McLaurin series for ( \cos(x) ).

Then we can say ( x \cos(x) ), so ( x \cdot \cos(x) ). I'm just going to multiply each of these things by ( x ). So I'm multiplying one side, the thing, but I'm multiplying both sides by ( x ). So I'm getting ( x - \frac{1}{2!} x^3 + \frac{1}{4!} x^5 ) and we're done.

Even though this might have seemed a little hairy and a bit of a long process, and some people have it somewhat committed to memory, what the McLaurin series expansion of ( \cos(x) ) and ( \sin(x) ) are, and sometimes ( e^x ) as well. Then this could be a very fast process where you just multiply that by ( x ).

But as you can see, even finding that McLaurin series expansion for ( \cos(x) ) isn't too bad. If you had done it the other way, if you just tried to take the first, second, third, fourth, fifth, or all the way to the fourth derivative of this and evaluate at zero, it would have gotten very, very, very hairy.

More Articles

View All
Beginning sentences with conjunctions | The parts of speech | Grammar | Khan Academy
Hey grammarians! Uh, some of you may have been raised like me with the superstition that it wasn’t okay to start a sentence with a conjunction, uh, like for, and, or, nor, or, or, but. But I’m here to tell you not to bury the lead—totally fine! Like, you …
Why your $1 is REALLY worth $5 (Real Estate Investing Mind Trick)
This is also why when you’re investing in real estate, how you should look at every one dollar is actually being worth five dollars. Because this is how much it’s actually truly worth. So this is something I catch myself doing all the time and I thought I…
We are in the "First Inning" of the Real Estate Crash - Billionaire Real Estate Investor
So, we’ve seen discounts already of, let’s say, 10-15%. Are we going to see discounts of 50%? Are we going to see buildings just turned over to the banks? I mean, what does it look like in terms of the bottom for this market? Billionaire real estate inves…
Introduction to residuals and least squares regression
So I’m interested in finding the relationship between people’s height in inches and their weight in pounds. I’m randomly sampling a bunch of people, measuring their height, measuring their weight, and then for each person, I’m plotting a point that repres…
Catalysts | Reaction rates and equilibrium | High school chemistry | Khan Academy
In this video we’re going to talk a little bit about catalysts. So let’s first imagine that we have two reactants, and I’m going to simplify things with these overly simplified drawings. So let’s say you have this reactant right over here, and I’m drawin…
Rube Goldberg WITH FIRE TORNADO! - Smarter Every Day 17
[Music] Hey it’s me, Destin. Welcome to Smarter Every Day. So a few years ago, I messed up and put a video of me playing with my chicken on the Internet, and now everybody says “Hey, aren’t you the chicken man?” His head stays rock solid in one position.…