Question: % SIMPSON'S COMPOSITE ALGORITHM 4 . 1 % % To approximate I = integral ( ( f ( x ) dx ) ) from a
SIMPSON'S COMPOSITE ALGORITHM
To approximate I integral fx dx from a to b:
INPUT: endpoints a b; even positive integer n
OUTPUT: approximation XI to I.
symsOKABNHXIXIXINNI,XXIsx;
TRUE ;
FALSE ;
fprintf'This is Simpsons Method.
;
fprintf'Input the function Fx in terms of x
;
fprintf'For example: cosx
;
s inputs;
F inlinesx;
OK FALSE;
while OK FALSE
fprintf'Input lower limit of integration and ;
fprintf'upper limit of integration
;
fprintfon separate lines
;
A input;
B input;
if A B
fprintf'Lower limit must be less than upper limit
;
else
OK TRUE;
end
end
OK FALSE;
while OK FALSE
fprintf'Input an even positive integer N
;
N input;
if N && remN
OK TRUE;
else
fprintf'Input must be even and positive
;
end
end
if OK TRUE
STEP
H BAN;
STEP
XI FA FB;
summation of fxI
XI;
summation of fxI
XI;
STEP
NN N ;
for I :NN
STEP
X A I H;
STEP
if remI
XI XI FX;
else
XI XI FX;
end
end
STEP
XI XI XI XI H ;
STEP
fprintf
The integral of F from f to f is
A B;
fprintff
XI;
end
Please input the correct info to compute the following:
Integral of x lnx dx n
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
