kill(all)$

maxima: appendix: smpson1/3 rule for integration,version 1.0
peter.vlasschaert@gmail.com,10/03/2022

given : quadratic polynoom ,need three points, three unknows :{A,B,C}

p1:y(x):=A*x^2+B*x+C;

→ integration : quadratic polynoom

p2a:'integrate(y(x),x,-h,h)=integrate(y(x),x,-h,h);

p2b:expand(ratsimp(p2a));

→ solve : u , for h/3 "rule"

p2c:rhs(p2b) = h/3*u;

→ find : u

p2c1:solve(p2c,u)[1];

p2b1:lhs(p2b) =h/3*u;

we need three points:[-h,0,h],for quadratic equation.

p3:[-h,0,h];

system : equations 
_______________

p3a1:y(p3[1]) =f0;
p3a2:y(p3[2]) =f1;
p3a3:y(p3[3]) =f2;

solve system : equations
____________________-

p4:flatten(solve([p3a1,p3a2,p3a3],[A,B,C]));

subst : u

p5:subst(p4,p2c1);

final result :simpson rule.
===================

use:p2b1

p6:subst([p5],p2b1);

------------------------------------------------------------------------------