(* gausscheck.wl -- Calculations to Check Gauss Quadrature *)

p=x^2-3*x+4
4-3 x+x^2
Integrate[p,{x,-1,1}]
p3=5*x^3-2*x^2+x-16
Integrate[p3,{x,-1,1}]

-(100/3)
n=4
2*n-1
p7=x^7-5*x^6+x^4-2*x^3+2
Integrate[p7,{x,-1,1}]

p8=2*x^8-x^7+13*x^4
Integrate[p8,{x,-1,1}]

pt=1+x+1/2*x^2+1/6*x^3+1/24*x^4+
    1/120*x^5+1/720*x^6+1/5040*x^7+
   1/40320*x^8
pt/.x->1

N[Exp[1],15]
N[pt/.x->1,15]
Integrate[pt,{x,-1,1}]

pt
