Question
Please use the programming language of C, using the compiler of Dev C++ (Not necessary). In your Calculus course you will learn that the function
Please use the programming language of C, using the compiler of Dev C++ (Not necessary).
In your Calculus course you will learn that the function ln(1 + x) can be approximated by a polynomial of degree n as follows: ln(1 + x) x 1 2 x2 + 1 3 x3 1 4 x4 + 1 5 x5 + + (1)(n+1)xn/n This is called a power series approximation. Write a program, powerseries.c, to check the accuracy of this formula. Your program must prompt the user for the value of x (where |x| < 1) and the degree, n, of the polynomial to use. Your program should then write the values of x, n, the approximation, the actual value and the percent relative error to the output file powerseriesout.txt. For marking purposes use x = 0.9 and n = 40. Here is a sample input and output: x = 0.900000 n = 5 approximate value = 0.692073 actual value = 0.641854 relative error = 7.824064 percent
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started