Answer to Question #277699 in MatLAB for anil

Question #277699

Find the solution of the given equation using the Trapezoidal rule:





int(5, - 2) sqrt(x^2+1)





Take the number of intervals to be 10.

1
Expert's answer
2021-12-09T07:29:48-0500
% range of integration
a = 5;
b = -2;
N = 10; % Step number
dx = (b-a) / N;
 % Function to integrate
 f = @(x) sqrt(x^2+1);
 val = 0;
 for i=1:N-1
     x = a +i*dx;
     val = val + f(x);
 end
 val = val + (f(a) + f(b)) / 2;
 int = val * dx;
 display(int)


>> pr01
int =
  -16.9382

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS