Question: This lab will be available until December 6 th , 1 1 : 5 9 PM CST See Canvas for more details. The Taylor series

This lab will be available until December 6th,11:59 PM CST
See Canvas for more details. The Taylor series expansion of the natural logarithm function, ln(x), is given by
ln(x)=(x-1)-(x-1)22+(x-1)33-(x-1)44+(x-1)55dots
This expansion is valid for values of x where xxln(x)0. Write a program named approximatingIn.py that takes as input from the user a
value for x and a value for tolerance. If the value for xis outside the valid range, continue to take input until the user enters a valid value.
Then, have your program calculate the natural log function using this expansion. Stop the summation when the next term is less than the
tolerance. Finally, have your program print the exact value ofln(x) using the math module, as well as the difference between the values.
Example output using inputs 1.5 and 0.001:
Enter a value for x: 1.5
Enter the tolerance: 0.001
ln(1.5)is approximately 0.40580357142857143
ln(1.5)is exactly 0.4054651081081644
The difference is0.0003384633204070453
Example output using inputs 0,2 and 0.0001 :
Enter a value for x: 0
Out of range! Try again: 2
Enter the tolerance: 0.0001
ln(2.0)is approximately 0.6930971830599583
ln(2.0)is exactly 0.6931471805599453
The difference is4.999749998702008e-05
This lab will be available until December 6 th ,

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!