Why are the weights of gaussian quadrature so smooth? I was watching this video. (https://www.youtube.com/watch?v=cKKrGr93f6c&t=616s)
In minute 10:16 he shows a plot of the weights of gaussian quadrature. Why are they so close by each other - and not oscillating as much as they would if one choose the 'naive' weights as described here: https://www.youtube.com/watch?v=nQZYBWB6q_k&t=560s
He could not even answer this question - so it might be hard to answer but maybe someone has some hint?
 A: I think you're looking at it the wrong way round. As a rule of thumb, function families that can "wiggle" more provide better fits to arbitrary data, to the point you may be overfitting after more than a few parameters. (I use the nontechnical verb "wiggle" rather than the more precise-sounding "oscillate", as that may have very specific technical implications that don't suit our purposes.) But there's more to it than that in practice, depending on the family you choose. So rather than asking why GQ wiggles less than most families that achieve a given approximation standard, ask why GQ ends up more accurate than usual for something that doesn't wiggle too much. The answer is that they're designed to optimize that.
For example, the best way to approximate $\int_0^1f(x)dx$ as $(f(a)+f(b))/2$ is not the intuitive trapezium rule $a=0,\,b=1$, but the more insightful $a,\,b=\tfrac12\pm\tfrac{1}{2\sqrt{3}}$. In particular, since width-$h$ (say) strips are common in numerical integration, we want to compare the Taylor-derived series$$\begin{align}\int_0^hf(x)dx&=\sum_{n\ge0}\frac{h^{n+1}f^{(n)}(0)}{(n+1)!},\\(f(a)+f(b))h/2&=\sum_n\frac{h^{n+1}f^{(n)}(0)(a^n+b^n)}{2\cdot n!}.\end{align}$$A high-precision approximation matches coefficients for small $n$, viz. $a^n+b^n=\frac{2}{n+1}$. The case $n=0$ is trivial, the case $n=1$ gives the unsurprising constraint $a+b=1$, the case $n=2$ implies$$a^2+b^2=\frac23\implies ab=\frac{1^2-2/3}{2}=\frac16$$(which uniquely determines $a,\,b$ up to order), and then we happily also get the case $n=3$ for free because$$a^3+b^3=(a+b)((a+b)^2-3ab)=1(1^3-2\tfrac16)=\tfrac12=\tfrac24.$$Unfortunately the $n=4$ case fails, but higher-order GQ rules can take care of that too.
