Taylor Series Lab


Having some trouble starting this in c++ language


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.
1. In series (A) use -0.9. In series (B) use 0.9/2.9.
Last edited on
Topic archived. No new replies allowed.