How can I calculate the root mean square error of two functions like
\begin{align*} f(x) &= \sin(x)\\ g(x) &= x-\frac{1}{6}x^3 \end{align*}
in $[0, 2\pi]$ range?
How can I calculate the root mean square error of two functions like
\begin{align*} f(x) &= \sin(x)\\ g(x) &= x-\frac{1}{6}x^3 \end{align*}
in $[0, 2\pi]$ range?
You need to use an integral, as we are now dealing with infinitely many points. Thus we have $$\sqrt{\frac{\int_0^{2\pi}(\sin(x)-(x-\frac{1}{6}x^3))^2dx}{\int_0^{2\pi}dx}}$$ The square root of the mean square of the difference between the two functions.