Need help in writing this program in Javascript. Take the function f(x) = ln(sin(x)) + 1 and
Question:
Need help in writing this program in Javascript. Take the function f(x) = ln(sin(x)) + 1 and find the integral from x=0.5 to x=2.5 you will need to define four variables for me to test the program: f(x) a = 0.5 b = 2.5 n = 10 I need four answers: first, the exact answer using calculus [this will not change when I replace your variables.] and three answers using n = 10 equal sized intervals for the function f(x) using: - the trapezoidal method area of segment equals base times the average of the height at the two end points of the segment. h = (b-a)/n A = (f(x)+f(x+h))*(h/2) - Simpson's 1/3 rule area of segment = h = (b-a)/(2*n) A = (f(x)+4*f(x+h)+f(x+h+h))*(h/3) - Simpson's 3/8 rule area of segment = h = (b-a)/(3*n) A = (f(x)+3*f(x+h)+3*f(x+h+h)+f(x+h+h+h))*(3*h/8)
Business Communication Process and Product
ISBN: 978-0324542905
6th Edition
Authors: Mary Ellen Guffey