- #1
asif zaidi
- 56
- 0
Problem Statement
Compute the Taylor Series expansion of f(x) = exp(-x^2) around 0 and use it to find an approximate value of the integral (from 0 to 0.1) of exp(-t^2) dt
Solution
Part1:
First to compute the Taylor Series - I am pretty sure about this step so I will not give details. But if I am wrong, please correct.
Taylor Series = 1 - (x^2) + (x^4)/2! - (x^6)/3! + ... --- EQUATION 1
And a closed form solution is from Sum (i from 0 to inf) of (-1^i)* (x^2*i)/i!
Part2:
This is the part I am not doing right - maybe I am not approaching the problem in the right way.
To solve the integral evaluate the Taylor Series in equation 1 above at 0.1 and 0 and subtract. Also, I took just the first 4 terms of equation 1. Is there a way I can determine how many terms I should take?
At x = 0.1: Equation 1 is evaluated to 0.99004983375
At x = 0.0: Equation 1 is evaluated to 1.000000000000
Subtracting above gives me an integral value of -0.00995016625.
So my two questions are:
1- Now this I know is clearly wrong as the value should be positive but I cannot figure out what I am doing wrong. The absolute value above is right but why am I getting a negative. I tried above method for positive exponentials and it worked but any negative exponential, I am always getting the negative answer.
2- How do I determine how many terms I should use in my Taylor Series expression.
Thanks
Asif
Compute the Taylor Series expansion of f(x) = exp(-x^2) around 0 and use it to find an approximate value of the integral (from 0 to 0.1) of exp(-t^2) dt
Solution
Part1:
First to compute the Taylor Series - I am pretty sure about this step so I will not give details. But if I am wrong, please correct.
Taylor Series = 1 - (x^2) + (x^4)/2! - (x^6)/3! + ... --- EQUATION 1
And a closed form solution is from Sum (i from 0 to inf) of (-1^i)* (x^2*i)/i!
Part2:
This is the part I am not doing right - maybe I am not approaching the problem in the right way.
To solve the integral evaluate the Taylor Series in equation 1 above at 0.1 and 0 and subtract. Also, I took just the first 4 terms of equation 1. Is there a way I can determine how many terms I should take?
At x = 0.1: Equation 1 is evaluated to 0.99004983375
At x = 0.0: Equation 1 is evaluated to 1.000000000000
Subtracting above gives me an integral value of -0.00995016625.
So my two questions are:
1- Now this I know is clearly wrong as the value should be positive but I cannot figure out what I am doing wrong. The absolute value above is right but why am I getting a negative. I tried above method for positive exponentials and it worked but any negative exponential, I am always getting the negative answer.
2- How do I determine how many terms I should use in my Taylor Series expression.
Thanks
Asif