Problem

​

Calculate the first 10 terms of the Taylor series for the function
f(x)exp(-0.1x)sin(x)
. In a common graph, plot the above Taylor polynomial of the function
f(x)
along with the function
f(x)
itself in the interval
x∈[0,2π]
The first 10 terms of the Taylor series for the function
f(x)exp(-0.1x)sin(x)
are : ​
x-0.1
2
x
-0.16166666666666665
3
x
+0.0165
4
x
+0.007504166666666667
5
x
-0.0008056388888888889
6
x
-0.0001574390873015873
7
x
+0.00001846625
8
x
+1.7981594190917109
-6
10
9
x
-2.4319554949294534
-7
10
10
x
In[]:=
f[x_]:=Exp[-0.1*x]*Sin[x];​​taylor=Normal[Series[f[x],{x,0,10}]];​​taylor
Out[]=
x-0.1
2
x
-0.161667
3
x
+0.0165
4
x
+0.00750417
5
x
-0.000805639
6
x
-0.000157439
7
x
+0.0000184663
8
x
+1.79816×
-6
10
9
x
-2.43196×
-7
10
10
x
In[]:=
Plot[{f[x],taylor},{x,0,2Pi},PlotLegends->{"f(x)","Taylor Series"}]​​
Out[]=
f(x)
Taylor Series
The Taylor series is a way to represent a function as an infinite sum of terms that are calculated from the values of the function' s derivatives at a single point . In this case, we have calculated the first 10 terms of the Taylor series for the function
f(x)exp(-0.1x)sin(x)
around the point
x0
. The resulting polynomial is :
x-0.1
2
x
-0.16166666666666665
3
x
+0.0165
4
x
+0.007504166666666667
5
x
-0.0008056388888888889
6
x
-0.0001574390873015873
7
x
+0.00001846625
8
x
+1.7981594190917109
-6
10
9
x
-2.4319554949294534
-7
10
10
x
​​​This polynomial is an approximation of the original function
f(x)
near
x0
. The more terms we include in the series, the better the approximation will be, and the larger the interval around
x0
within which the approximation is good . However, it' s important to note that the Taylor series does not always converge to the function it' s approximating, especially for values of
x
far from the point around which the series is calculated (in this case,
x0
) . This is evident from the plot we generated earlier, where the Taylor approximation starts to diverge from the original function as
x
moves away from 0.​In conclusion, the Taylor series provides a powerful tool for approximating functions with polynomials, especially near a specific point . But care must be taken when using these approximations, as they may not be accurate over large intervals or for complex functions .

We will do the same for Fourier Series and then we will compare the two cases.

The first 10 terms of the Fourier series for the function
f(x)exp(-0.1x)sin(x)
are : ​​
-0.10064660454698496+(0.025349892915823936+0.5069978583164828i)
ix
e
+(0.025349892915823936-0.5069978583164828i)
-ix
e
+(0.033399927591063826-0.004468217737934933i)
2ix
e
+(0.033399927591063826+0.004468217737934933i)
-2ix
e
-(0.012651195777478754-0.0009500272173325569i)
3ix
e
-(0.012651195777478754+0.0009500272173325569i)
-3ix
e
+(0.006762132120208066-0.0003608876381698658i)
4ix
e
+(0.006762132120208066+0.0003608876381698658i)
-4ix
e
-(0.004229960349193359-0.00017632181530609237i)
5ix
e
-(0.004229960349193359+0.00017632181530609237i)
-5ix
e
+(0.0029017904693091085-0.00009951839277424079i)
6ix
e
+(0.0029017904693091085+0.00009951839277424079i)
-6ix
e
-(0.00211641242780506-0.00006174155863569073i)
7ix
e
-(0.00211641242780506+0.00006174155863569073i)
-7ix
e
+(0.0016127564051439662-0.00004096539527274201i)
8ix
e
+(0.0016127564051439662+0.00004096539527274201i)
-8ix
e
-(0.0012701790462557336-0.000028582601365920143i)
9ix
e
-(0.0012701790462557336+0.000028582601365920143i)
-9ix
e
+(0.0010264834056544576-0.00002073913336002128i)
10ix
e
+(0.0010264834056544576+0.00002073913336002128i)
-10ix
e
​​
In[]:=
​​f[x_]:=Exp[-0.1*x]*Sin[x];​​fourier=FourierSeries[f[x],x,10];​​fourier
Out[]=
-0.100647+(0.0253499+0.506998)
-x

+(0.0253499-0.506998)
x

+(0.0333999-0.00446822)
-2x

+(0.0333999+0.00446822)
2x

-(0.0126512-0.000950027)
-3x

-(0.0126512+0.000950027)
3x

+(0.00676213-0.000360888)
-4x

+(0.00676213+0.000360888)
4x

-(0.00422996-0.000176322)
-5x

-(0.00422996+0.000176322)
5x

+(0.00290179-0.0000995184)
-6x

+(0.00290179+0.0000995184)
6x

-(0.00211641-0.0000617416)
-7x

-(0.00211641+0.0000617416)
7x

+(0.00161276-0.0000409654)
-8x

+(0.00161276+0.0000409654)
8x

-(0.00127018-0.0000285826)
-9x

-(0.00127018+0.0000285826)
9x

+(0.00102648-0.0000207391)
-10x

+(0.00102648+0.0000207391)
10x

The Fourier series is a way to represent a periodic function as a sum of sine and cosine functions . It' s especially useful for analyzing and manipulating functions that are periodic . In this case, the Fourier series provides a representation of the function
(f(x)
in terms of complex exponentials, which are equivalent to sines and cosines .
In[]:=
Plot[{f[x],fourier},{x,0,2Pi},PlotLegends->{"f(x)","Fourier Series"}]​​
Out[]=
f(x)
Fourier Series
In this case, we have computed the first 10 terms of the Fourier series for the function
f(x)exp(-0.1x)sin(x)
. The result is a complex series, which can be interpreted as a sum of sine and cosine functions with different amplitudes and phases . Each term in the series corresponds to a specific frequency, and the coefficient of each term indicates the strength (or amplitude) and phase shift of that frequency component in the original function . It' s important to note that the Fourier series provides an exact representation of the function only if the function is periodic and satisfies certain mathematical conditions (like being piecewise smooth) . For other functions, the Fourier series provides an approximation . The more terms we include in the series, the better the approximation . In this specific case, the function
f(x)exp(-0.1x)sin(x)
is not strictly periodic, so the Fourier series provides an approximation . The quality of the approximation would depend on the specific range of
x
values we' re interested in . Finally, the Fourier series is a powerful tool in mathematics and engineering, but interpreting its results can require a good understanding of concepts like frequency, amplitude, phase, and complex numbers .

Conlusion

We have the function
f(x)exp(-0.1x)sin(x)
, which is a product of an exponential function and a sine function . This function is not strictly periodic, but it does have a periodic component due to the
sin(x)
term . The Taylor series expansion of this function provides a polynomial approximation that is particularly accurate near the point of expansion, which in our case was
x0
. As we move away from this point, the Taylor approximation becomes less accurate . This is a general property of Taylor series : they provide local approximations that are accurate within a certain radius of the point of expansion . On the other hand, the Fourier series expansion provides a representation of the function in terms of sine and cosine functions (or complex exponentials) . This captures the periodic nature of the
sin(x)
part of the function, but it' s important to note that the Fourier series is an infinite series, and we' ve only computed the first 10 terms . Therefore, the Fourier series we' ve computed is an approximation of the function, and its accuracy would improve as more terms are included . In comparing the two, the Taylor series gives a good approximation near
x0
, while the Fourier series captures the oscillatory behavior of the function . The choice between using a Taylor series or a Fourier series would depend on what aspects of the function you' re most interested in (e . g ., behavior near a specific point versus periodic behavior), and what you know about the function (e . g ., whether it' s periodic) .