Consider the problem of approximating ln(1.9) with ten digits
of accuracy, using either of the following Taylor series:
(A) ln(1-x) = − ∑ xk/k
(B) ln[(1+x)/(1-x)] = 2 ∑ x2k-1/(2k-1)
( both sums run from k=1 to infinity )
(Note that ln(1.9) is approximately 0.641853886172 )
1. To get ln(1.9), what value of x do you have to use
in series (A) ? in series (B) ?
2. Which series do you expect to be more efficient for computing
ln(1.9) ? (...before you do the rest !)
3. Write a code to determine how many terms you need in series (A).
Your code should print out:
- the number of terms needed,
- the value obtained from the series,
- the error.
4. Modify your code to do the same using series (B)
[ comment out and modify ].
5. Which series is more efficient for computing ln(1.9) ?
Briefly explain why.