Approximations for e^x, sin and cos

In summary: What is De Moivre's Theorem?De Moivre's Theorem is a mathematical theorem that states that any polynomial whose coefficients in any power of x converge is equal to a certain constant.
  • #1
hedlund
34
0
I had a question on a math test which said that you should find an approximation for [tex] e^x [/tex] which is very good for [tex] x \approx 0 [/tex]. First I declared the function [tex] f(x) = e^x [/tex]. We have the interesting thing that [tex] f(x) = f'(x) = f''(x) = f'''(x) \ldots \ \forall x [/tex]. And because of this we have [tex] f(0) = f'(0) = f''(0) = f'''(0) \ldots [/tex]. Next I defined the function [tex] g(x) = ax^3+bx^2+cx+d[/tex] and if we want [tex] g(x) \approx f(x) [/tex] for [tex] x \approx 0 [/tex]. Using this it leads to that [tex] d=1 [/tex], [tex] c=1 [/tex], [tex] b = 1/2 [/tex], [tex] a=1/6 [/tex]. So [tex] g(x) = x^3/6 + x^2/2 + x + 1 [/tex]. This formula is good for [tex] x \approx 0 [/tex]. So I tried with [tex] h(x) = ax^4+bx^3+cx^2+dx+e [/tex] which leads to [tex] h(x) = x^4/24 + x^3/6 + x^2/2+x+1 [/tex] which is better. I found a pattern, we have for an [tex] j [/tex] degree polynom the formulas [tex] \sum_{u=0}^{j} \frac{ x^u}{u!} [/tex]. But graphing [tex] e^x [/tex] and a polynom of [tex] j [/tex] degree we get better and better result when [tex] j \to \infty [/tex]. So on my test I wrote done that a good approximation for [tex] e^x [/tex] for [tex] x \approx 0 [/tex] would be [tex] \sum_{u=0}^{\infty} \frac{x^u}{u!} [/tex]. I've just started calculus and that stuff, so I don't know if this is the answer my teacher wanted. I only know of factioral and sums because I got to study discreet math instead of psychology. Using the same technique as I used for finding an approximation for [tex] e^x [/tex] I gave formulas for [tex] \cos{x} [/tex] and [tex] \sin{x} [/tex]. The formulas are [tex] \sin{x} \approx \sum_{u=0}^{\infty} \frac{ \left( - 1 \right)^u \cdot x^{2u+1}}{ \left( 2u+1 \right)!} [/tex] and [tex] \cos{x} \approx \frac{\left(-1 \right)^u \cdot x^{2u}}{ \left( 2u \right)!} [/tex]. Are these formulas used for anything? And most important, are they correct - when I graph them they seem to be correct.
 
Physics news on Phys.org
  • #2
What you have are the "Taylor series" for ex, sin(x), and cos(x).
If you got those without knowing the general formula to start with, I'm impressed!
 
  • #3
HallsofIvy said:
What you have are the "Taylor series" for ex, sin(x), and cos(x).
If you got those without knowing the general formula to start with, I'm impressed!

I only used that the derivate of e^x is e^x, the derivate of sin(x) is cos(x) and that the derivate of cos(x) is -sin(x). I used equation systems to get approximations for third and fourth degree polynoms and thought I saw a pattern - and plotted and it seemed to mix. This "Taylor series", are they of any use to anyone and are my formulas correct?
 
  • #4
They are supremely important, and yes, the formulas (the infinite series) are correct for ANY choice of x (not only small).
 
Last edited:
  • #5
You can use the series for e^x to approximate things like the integral of e^-x^2.

The series of sin and cos were used to make the trig tables before calculators.
 
  • #6
I had math today, and after the lesson was over my teacher told me to stay in class. She said that she had started correcting the tests, and that she was impressed with the formulas. So I guess that is good ... :smile:
 
  • #7
I must say that I'm impressed with your doing that without knowing about Taylor series. Basically, a Taylor series is an approximation of a function using infinite polynomials. They can be centered around various numbers, and are of the following form, where a is the center of the number:

[tex]f(x) = f(a) + f'(a)(x-a) + \frac{f''(a)(x-a)^2}{2!} + \frac{f'''(a)(x-a)^3}{3!}+...+\frac{f^{(n)}(a)(x-a)^n}{n!}+...[/tex]

Using zero as a center, as you did, is a special case also known as a Maclaurin series. Though not all Taylor series converge for all values, the ones for e^x, sin x, and cos x do. In fact, you can easily prove De Movire's Theorem using Taylor series.
 
  • #8
Dburghoff said:
I must say that I'm impressed with your doing that without knowing about Taylor series. Basically, a Taylor series is an approximation of a function using infinite polynomials. They can be centered around various numbers, and are of the following form, where a is the center of the number:

[tex]f(x) = f(a) + f'(a)(x-a) + \frac{f''(a)(x-a)^2}{2!} + \frac{f'''(a)(x-a)^3}{3!}+...+\frac{f^{(n)}(a)(x-a)^n}{n!}+...[/tex]

Using zero as a center, as you did, is a special case also known as a Maclaurin series. Though not all Taylor series converge for all values, the ones for e^x, sin x, and cos x do. In fact, you can easily prove De Movire's Theorem using Taylor series.

What is De Moivre's Theorem? Never heard of it, maybe I've worked with it but not knowing that it was De Moivre's Theorem ...
 
  • #9
de Moivre's theorem: (cos(x) + isin(x))^n = cos(nx) + isin(nx). It can also be proved easily using Euler's formula...
 
  • #10
Muzza said:
de Moivre's theorem: (cos(x) + isin(x))^n = cos(nx) + isin(nx). It can also be proved easily using Euler's formula...
Which is most easily proven with Taylor series. :wink:
 
Last edited:
  • #11
Actually, (cos(x)+ i sin(x))n= cos(nx)+ i sin(nx) can be proved directly without using Taylor series or Euler's formula:

(cos(x)+ i sin(x))2= cos2(x)+ 2i sin(x)cos(x)- sin2(x)= (cos2(x)- sin[sup[2][/sup](x))+ i (2sin(x)(cos(x))
which is equal to cos(2x)+ i sin(2x) by trig identities. The general formula can be done by induction.
 
  • #12
Actually, (cos(x)+ i sin(x))n= cos(nx)+ i sin(nx) can be proved directly without using Taylor series or Euler's formula:

(cos(x)+ i sin(x))2= cos2(x)+ 2i sin(x)cos(x)- sin2(x)= (cos2(x)- sin2(x))+ i (2sin(x)(cos(x))
which is equal to cos(2x)+ i sin(2x) by trig identities. The general formula can be done by induction.
 
  • #14
HallsofIvy said:
Actually, (cos(x)+ i sin(x))n= cos(nx)+ i sin(nx) can be proved directly without using Taylor series or Euler's formula:

(cos(x)+ i sin(x))2= cos2(x)+ 2i sin(x)cos(x)- sin2(x)= (cos2(x)- sin2(x))+ i (2sin(x)(cos(x))
which is equal to cos(2x)+ i sin(2x) by trig identities. The general formula can be done by induction.
That only proves De Moivre's for natural numbers, though. I believe (and correct me if I'm wrong) that you must use Taylor series / Euler's formula to prove it for all reals.
 
Last edited:
  • #15
hedlund said:
I had a question on a math test which said that you should find an approximation for [tex] e^x [/tex] which is very good for [tex] x \approx 0 [/tex]. First I declared the function [tex] f(x) = e^x [/tex]. We have the interesting thing that [tex] f(x) = f'(x) = f''(x) = f'''(x) \ldots \ \forall x [/tex]. And because of this we have [tex] f(0) = f'(0) = f''(0) = f'''(0) \ldots [/tex]. Next I defined the function [tex] g(x) = ax^3+bx^2+cx+d[/tex] and if we want [tex] g(x) \approx f(x) [/tex] for [tex] x \approx 0 [/tex]. Using this it leads to that [tex] d=1 [/tex], [tex] c=1 [/tex], [tex] b = 1/2 [/tex], [tex] a=1/6 [/tex]. So [tex] g(x) = x^3/6 + x^2/2 + x + 1 [/tex]. This formula is good for [tex] x \approx 0 [/tex]. So I tried with [tex] h(x) = ax^4+bx^3+cx^2+dx+e [/tex] which leads to [tex] h(x) = x^4/24 + x^3/6 + x^2/2+x+1 [/tex] which is better. I found a pattern, we have for an [tex] j [/tex] degree polynom the formulas [tex] \sum_{u=0}^{j} \frac{ x^u}{u!} [/tex]. But graphing [tex] e^x [/tex] and a polynom of [tex] j [/tex] degree we get better and better result when [tex] j \to \infty [/tex]. So on my test I wrote done that a good approximation for [tex] e^x [/tex] for [tex] x \approx 0 [/tex] would be [tex] \sum_{u=0}^{\infty} \frac{x^u}{u!} [/tex]. I've just started calculus and that stuff, so I don't know if this is the answer my teacher wanted. I only know of factioral and sums because I got to study discreet math instead of psychology. Using the same technique as I used for finding an approximation for [tex] e^x [/tex] I gave formulas for [tex] \cos{x} [/tex] and [tex] \sin{x} [/tex]. The formulas are [tex] \sin{x} \approx \sum_{u=0}^{\infty} \frac{ \left( - 1 \right)^u \cdot x^{2u+1}}{ \left( 2u+1 \right)!} [/tex] and [tex] \cos{x} \approx \frac{\left(-1 \right)^u \cdot x^{2u}}{ \left( 2u \right)!} [/tex]. Are these formulas used for anything? And most important, are they correct - when I graph them they seem to be correct.

Can you reveal a bit how you get coefficients of expansion? It is most important part of your post, but it is not quite clear.
Thanks
 
  • #16
Sure. I will show the method for the approximate h(x) = ax^3 + bx^2 + cx + d, we have f(x) = e^x, and f'(x) = e^x, f''(x) = e^x and so on. We want h(x) = f(x), h'(x) = f'(x), h''(x) = f''(x) and so on. First we conclude that f(0) = 1, h(0) must be equal to 1, this gives d=1. So h(x) = ax^3+bx^2+cx+1. Next we have h'(x) = 3*ax^2+2*bx+c+1 and h'(0) should be equal to 1, this gives c=1. h(x) = ax^3+bx^2+x+1. Next we have h''(x) = 3*2*ax+2b, so h''(0) = 1 gives b=1/2, so h(x) = ax^3+x^2/2+x+1. Next we ge h'''(x) = 3*2*a, so h'''(0) = 1 => a = 1/6 so h(x) = x^3/6 + x^2/2 + x + 1. I tried for fourth degree polynom on my test and saw that j(x) = x^4/24 + x^3/6 + x^2/2 + x + 1. So it's obvius that if we want v(x) be a function that is very good as approximate for e^x. It's obivus that [tex] v(x) = \sum_{n=0}^{j} x^n \cdot s [/tex] where s should be dependent on n. So I saw the series 1, 1, 2, 6, 24 which is n! for n=0,1,2,3,4. So I concluded that [tex] v(x) = \lim_{j \to \infty} \sum_{n=0}^{j} \frac{x^n}{n!} [/tex]. Hope that explains it, if my texts is a mess it's because I've worked for 14 hours
 
Last edited:

Related to Approximations for e^x, sin and cos

What is the Taylor series approximation for e^x?

The Taylor series approximation for e^x is given by the sum of the infinite series: e^x = 1 + x + x^2/2! + x^3/3! + ... + x^n/n!, where n represents the number of terms used in the approximation. This series can be used to calculate e^x for any value of x, but the accuracy of the approximation depends on the number of terms used.

How accurate is the Taylor series approximation for e^x?

The accuracy of the Taylor series approximation for e^x depends on the number of terms used in the series. The more terms that are included, the more accurate the approximation will be. However, even with just a few terms, the Taylor series approximation can provide a fairly accurate estimate of e^x.

What is the Maclaurin series approximation for sin(x) and cos(x)?

The Maclaurin series approximation for sin(x) is given by the sum of the infinite series: sin(x) = x - x^3/3! + x^5/5! - x^7/7! + ... + (-1)^n * x^(2n+1)/(2n+1)!, where n represents the number of terms used in the approximation. The Maclaurin series approximation for cos(x) is given by the sum of the infinite series: cos(x) = 1 - x^2/2! + x^4/4! - x^6/6! + ... + (-1)^n * x^(2n)/(2n)!, where n represents the number of terms used in the approximation. Again, the accuracy of these approximations depends on the number of terms used.

How do I determine the number of terms to use in a Taylor series approximation?

The number of terms to use in a Taylor series approximation depends on the desired level of accuracy. Generally, the more terms that are used, the more accurate the approximation will be. However, it is also important to consider the computational resources and time needed for a larger number of terms. Experimentation and trial and error may be necessary to determine the optimal number of terms for a given approximation.

Can Taylor series approximations be used for values outside of the domain of the original function?

Yes, Taylor series approximations can be used to calculate values outside of the domain of the original function. However, the accuracy of the approximation may decrease as the values move further away from the domain. It is important to verify the convergence of the series for the specific value being approximated before relying on the approximation for values outside of the original function's domain.

Similar threads

Replies
3
Views
1K
  • Calculus
Replies
6
Views
1K
Replies
11
Views
2K
Replies
3
Views
419
Replies
1
Views
2K
Replies
1
Views
1K
Replies
14
Views
1K
Replies
5
Views
482
Replies
3
Views
1K
Replies
6
Views
1K
Back
Top