Second Order Gauss Quadrature

At various points in my life, long division, the unit circle, completing the square, projectile motion, the work-energy balance and most recently, Pulse-Width-Modulation, have all been things that I thought were the coolest thing I’ve ever learned. However, in the details of the least interesting part of a very unassuming idea in numerical methods, I have found something way way more interesting than anything I’ve ever learned ever. This is the closest thing to magic I think I’ve ever seen.

This is the fact that second order Gauss Quadrature is third order accurate. What does that mean? Well consider the equation below

Screen Shot 2018-11-08 at 12.39.35 AM.png

Looks like a pretty rough function to deal with! Integrating it over almost any range would be pretty much impossible, if integrating by hand. But weirdly, the following absurdly cool relationship is true:

Screen Shot 2018-11-08 at 12.36.56 AM.png

All that’s to say that as second order Gauss Quadrature is third order accurate, you can find the value of a third order or lower function integrated from -1 to 1 just by summing the original function’s value at -1/sqrt(3) and 1/sqrt(3). Which is absurd! It’s an incredibly great approximation method using just two points!