CellPrint[TextCell[Quiet[cdf =Manipulate[Column[{ "Al aproximar "<>integre<>" obtenemos: "(*<>"≈"TraditionalForm@formulas[[u]]*), Dynamic@SuFunc}],
Style[proposito,Bold,10],Spacer[{100,3}],
 (*Inicio contadores *)
{{ff, Tan[x^2],"f(x) = "},ControlType->InputField},
{{puntoA,0,"a = "},ControlType->InputField},
{{puntoB,Pi/4,"b = "},ControlType->InputField},
{{ene,1,"n = "},1,5,1,ControlType->PopupMenu},
{{usemath,0,"Resp. usando Math."},{0,1},ControlType->Checkbox},
Button["Calcular", Dynamic@ SuFunc]
(* Fin contadores *)
,Alignment->Center,Deployed->True,AppearanceElements->"ResetButton",LocalizeVariables->True,ContinuousAction->False,FrameLabel->{{None,None},{Column[{,Row[{Style["Autores: Juan Félix Ávila Herrera y Enrique Vílchez Quesada",Bold,10,RGBColor[0,0,0.5]]}],Row[{Style["Escuela de Informática | Universidad Nacional de Costa Rica",Bold,10,RGBColor[0.5,0.1,0]]}]},Center],Style["Cuadratura de Gauss", Bold,14, RGBColor[0,0.33,0.33]]}},
Initialization:>(
ClearAll["Global`*"];
escriba[lista_]:=Style[Row@lista,Black];
resultado =0;
integre = ToString[TraditionalForm@Defer[(∫_a^b)f[x]\[DifferentialD]x]];
escriba[lista_]:=Style[Row@lista,Black];
 f[t_]:=ff/.x->t;

exacto := If[usemath==1, NIntegrate[ ff, {x, puntoA, puntoB}],1];

 
 
proposito ="Propósito: Usar integración de Gauss para aproximar "<>integre;
SuFunc := Module[{pn, w, L, c, d,     gg, sol, i, x, n, resp, aux, val, conmath},
resp[x_] := If[val =x; val==Round[val], x,escriba@{x," ≈ ",ToString[Sign[x] AccountingForm[Abs@N@x]]}];
n=ene;
pn[x_] =Expand@Simplify@D[((((x^2-1))^n)/((2^n)n!)), {x, n}];
sol = Sort[x/.NSolve[pn[x]==0, x, Reals]];

 w[i_] := sol[[i]];

L[j_] :=
(∏_(i=1)^n)If[i==j, 1, (((x-w[i]))/(w[j]-w[i]))];

c[i_] := (∫_(-1)^1)L[i]\[DifferentialD]x;
d =Table[{w[i], c[i]}, {i, 1, n}];
gg[t_] := f[(((b-a)t+a+b)/2)]((b-a)/2)/.{a->puntoA, b->puntoB};
conmath={}; 
If[usemath==1,  conmath ={"\nUsando Mathematica: " ,  integre ,  " = " ,  exacto},conmath= {} ];
aux ={ N[(∑_(i=1)^ene)c[i] gg[w[i]], 10]    } ;
aux = Join[aux, conmath];
escriba@aux
 
];
Dynamic@SuFunc
)]],"Text"]]