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
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)
Step by Step Solution
3.32 Rating (161 Votes )
There are 3 Steps involved in it
ANSWER Note If you have any queries related the answer please do comment I would be very ha... View full answer
Get step-by-step solutions from verified subject matter experts
