Question

1. Use the Trapezoidal Rule to numerically integrate the following polynomial from a = 0.5 to b = 1.5 f(x) = 0.2 + 25x – 200x

0 0
Add a comment Improve this question Transcribed image text
Answer #1

anes f(x) = 0.2 +25%-2003 +675x3_900 x4 + 90b azos to b=1.5 Exact value = 49.3567 Formule for trapezoidal rule: I I= (f(x) +

for nez halsos, os Is toros 566 -0.5) - 3.325 : q= 1.0 F(x,-1.0 - 0.2 = 1-5 → Flix=1.5) = 347.075 .I- {f(x) +f(x) + 2 (F(X.)

166.9694-49-36677 xloo 49.3667 = 35.6SY Relative emer is decreasing segments are increasing as the no. of

MatLab program:

clear
clc
% function
f=@(x) 0.2+25*x-200*x^2+675*x^3-...
        900*x^4+400*x^5;
% limits
a=0.5;
b=1.5;
A=49.3667;
fprintf('\nSolution by analytical method');
fprintf(' is %f',A);
% no. of segments
nn=[1 2 3];
for k=1:length(nn)
    n=nn(k);
    h=(b-a)/n;
    for i=1:n+1
        x(i)=a+(i-1)*h;
        y(i)=f(x(i));
    end
    I=0;
%formula I=(h/2)*(y0+yn+2(y1+y2+.....yn-1)
I=(h/2)*(2*sum(y(2:end-1))+y(1)+y(n+1));
fprintf('\n\nn=%d\n',n);
fprintf('\nSolution I=%f',I);
Er=abs((A-I)/A)*100;
fprintf('\nTrue percent error is %f%%',Er);
end

Screenshot:

1 clear 2 clc 3% function 4 f=@(x) 0.2+25*x-200*x^2+675*x^3-... 5 900*x^4+400*x^5; 6% limits 7 a=0.5; 8 b=1.5; 9 A=49.3667; 1

Save the above program and execute it.

Result:

Solution by analytical method is 49.366700 n=1 Solution I=175.200000 True percent error is 254.895101% n=2 Solution I=87.7000

I hope this will help you.

Add a comment
Know the answer?
Add Answer to:
1. Use the Trapezoidal Rule to numerically integrate the following polynomial from a = 0.5 to...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT