Root mean square error of two functions

1.3k Views Asked by At

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?

1

There are 1 best solutions below

4
On

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.