Summing the total error of a Taylor series over an interval

25 Views Asked by At

Just for fun, I played around with a Maclaurin series for $\sin(x)$. I did this on Desmos, which I know will have numerical precision errors. I discovered that:

$$T(x) = x-\frac{x^{3}}{3!}+\frac{x^{5}}{5!}-\frac{x^{7}}{7!}+\frac{x^{9}}{9!}-\frac{x^{11}}{11!}+\frac{x^{13}}{13!}-\frac{x^{15}}{15!}+\frac{x^{17}}{17!}-\frac{x^{19}}{19!}$$

was the first Maclaurin expansion of $\sin(x)$ that had an error $\epsilon \approx 0.001$ at $x=2\pi$. Again, just out of interest, I defined a remainder function $R(w) = |\sin(w)-T(w)|$ and I asked Desmos to take the integral of this for $w\in \left\{-2\pi, 2\pi\right\}$ and it gave me a sum that was actually half that of $R(2\pi)$; this answer is clearly wrong - if anything, the total should be over twice $R(2\pi)$.

I suspect my error lies in the beginner's mistake of believing that an integral is the same as a sum - I know it's an area, but I don't know how I might calculate (approximately) a sum of $R$ from the "area under the curve" of $R$. How might I go about this, if it's even possible?