Question: Hi, could you please answer this question with ((((((python))))). I wanna all steps. n-1 f Exercise 3: Integration You will have seen in mathematics that

Hi, could you please answer this question with ((((((python))))).
I wanna all steps.
n-1 f Exercise 3: Integration You will have seen in mathematics that the integral of a function f(x) over the range a to b is the equivalent of finding the area under the curve describe by function f(x). To a first approximation this area can be found using the trapezoid rule f(a)+f(b) which is given by 1 = The accuracy can be improved by splitting the separation between a and b up inton 21b-a ( 1 a 2h function to evaluate the integral of x2 between and 1 and 5 with a segment width of 0.01 and the integral of exp(-x2) between -20.0 and 20.0 with a segment width of 0.001. Call your function inte(). Your function should take as its arguments a function which calculates f(x) the function you want integrate (call this argument fx), the upper and lower limits of the integration and the segment width for the integration. You also need to write two other functions to represent f(x). One should evaluate x2 and the other exp(-x2), but both these functions should take a single argument x. (ans 41.33, VTT). i1 small segments where each small segment has a width h. The integral then becomes = 5(x:x)=f(x). Write a = i=0 Exercise 4: In Exercise 3 the integration function, inte(), you wrote took another function, fx, as one of its arguments. This argument function, fx, took a single argument, x. In this exercise you will extend the integration function inte() so that the argument function, fx, can accept several arguments as well. To do this 1) Copy the function inte() and paste it in your program file and call it inte1(). 2) Add another argument at the end of the existing arguments and call this argument args. 3) Create another function called kineng outside the function inte1(). Define this function to take the arguments vel and mass. Innide the function kineng add the line ks = mass*vel and then return ks. n-1 f Exercise 3: Integration You will have seen in mathematics that the integral of a function f(x) over the range a to b is the equivalent of finding the area under the curve describe by function f(x). To a first approximation this area can be found using the trapezoid rule f(a)+f(b) which is given by 1 = The accuracy can be improved by splitting the separation between a and b up inton 21b-a ( 1 a 2h function to evaluate the integral of x2 between and 1 and 5 with a segment width of 0.01 and the integral of exp(-x2) between -20.0 and 20.0 with a segment width of 0.001. Call your function inte(). Your function should take as its arguments a function which calculates f(x) the function you want integrate (call this argument fx), the upper and lower limits of the integration and the segment width for the integration. You also need to write two other functions to represent f(x). One should evaluate x2 and the other exp(-x2), but both these functions should take a single argument x. (ans 41.33, VTT). i1 small segments where each small segment has a width h. The integral then becomes = 5(x:x)=f(x). Write a = i=0 Exercise 4: In Exercise 3 the integration function, inte(), you wrote took another function, fx, as one of its arguments. This argument function, fx, took a single argument, x. In this exercise you will extend the integration function inte() so that the argument function, fx, can accept several arguments as well. To do this 1) Copy the function inte() and paste it in your program file and call it inte1(). 2) Add another argument at the end of the existing arguments and call this argument args. 3) Create another function called kineng outside the function inte1(). Define this function to take the arguments vel and mass. Innide the function kineng add the line ks = mass*vel and then return ks
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
