Question: Please use Python. Given is the list of instructions, the problem itself, and the equations for cos(x), sin(x), and exp(x). For parts that require written

Please use Python. Given is the list of instructions, the problem itself, and the equations for cos(x), sin(x), and exp(x).

Please use Python. Given is the list of instructions, the problem itself,

and the equations for cos(x), sin(x), and exp(x). For parts that requirewritten explanation, use the print() function to print your answers to the

For parts that require written explanation, use the print() function to print your answers to the screen when the script is run. Remember that unlike with using the python interpreter (e.g. Python in "live" mode by running Python in the shell prompt window), commands will not print out to the screen automatically when run through a scripting file. Make sure that your scripts run without error in order to get credit. Do not hesitate to ask for help if needed! Problem 2 Taylor (Maclaurin) series functions (8 pts) We want to write a Python script that can compute the sum of the Maclaurin series for sin(x), cos(x) and exp(x) for a given value of x and a given value of terms that need to be added. You will do this by writing 3 functions: sine_series, cosine_series and exp_series, respectively. However, you are not allowed to use the math.factorial command nor the sum command, so you will need to write two separate functions for these that you can call inside your 3 functions. Once you have written these 3 functions, you can write 3 much shorter and simpler func- tions, sine_series_simple, cosine_series_simple and exp_series_simple that do the same but can make use of the math.factorial and sum commands, and make use of list comprehension to calculate things very simply. To check if your functions are working properly, you should pick any value of x and a large value of terms that need to be added (more than 20), and compute the sum of the sin(x), cos(x) and exp(x) using the 3 different functions and compare their results (which should be identical) to the simpler functions by printing these numbers with some explanation. sin(2) - 1/230+ (2j + 1)! j=0 8 cos (x) = (-1)7025 (2j)! j=0 exp() : - j! ]=0

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 Databases Questions!