kill(all)$

Maxima :appendix :Trapezoidal rule version 1,0
peter.vlasschaert@gmail.com,03/03/2022

ref :internet : https://en.wikipedia.org/wiki/Trapezoidal_rule
ref :Geogebra :https://www.geogebra.org/m/VTrYdaZt                             "interactive use"

→ first step : Rectangle (Area of Reactangle > Area ofTrapezium )

Rectangle : AreaR

p1:AreaR=h*b;

→second step : AreaTri (Tri =Triangle) = AreaR /2

rem : full symmetric : remove rhs AreaTri = remove  lhs AreaTri

p2:AreaTri = (b-a)/2*h;

→ thrid step : Area of  Trapezium ( = AreaTr)

p3a: AreaTr = lhs(p1)-lhs(p2);
p3b:lhs(p3a) = ratsimp(rhs(p1)-rhs(p2));

→ fourth step :Trapezoidal rule 

a:f(x[i]);
b:f(x[i+1]);

p4a:lhs(p3a) =ev(rhs(p3b),nouns);

h:x([i+1])-x([i]);

p4b:ev(p4a,nouns);

rem . x([i+1]) = x([i])+h

final : equation
===========

p5: rhs(p3b) =rhs(p4b);

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

rem : Geogebra file : see website 
          Png          file : see website

Geogebra : download and online;https://www.geogebra.org/