{"id":7,"date":"2014-02-06T17:40:00","date_gmt":"2014-02-06T23:40:00","guid":{"rendered":"http:\/\/charles-oneill.com\/blog\/?p=7"},"modified":"2014-09-01T20:50:11","modified_gmt":"2014-09-02T01:50:11","slug":"l-squared-error-for-a-fourier-sine-series","status":"publish","type":"post","link":"https:\/\/charles-oneill.com\/blog\/l-squared-error-for-a-fourier-sine-series\/","title":{"rendered":"L Squared Error for a Fourier Sine Series"},"content":{"rendered":"<p><em>How close is my Fourier Sine series to a function f(x)?<\/em><\/p>\n<p>Answer: \\( L_2(N) = -\\frac{1}{2} a_n^2 + \\int_\\Omega f^2(x) dx \\)<\/p>\n<p>This question came up recently while discussing PDE (partial differential equations) solution techniques. The final result is quite interesting.<\/p>\n<p>Our sine series approximates the function f(x) over the domain \\(\\Omega\\) as $$f(x) \\approx \\sum {{a_n}\\sin (n \\pi x)}$$ You can determine the coefficients with the formula. $$ a_n = 2\\int_\\Omega f(x) \\sin(n \\pi x) dx$$<br \/>\nOne good measure of the error between the sine series and the function is the \\(L_2\\), pronounced &#8220;el squared&#8221;, error. $$ L_2 =\\int_{\\Omega} \\left( u(x) &#8211; f(x) \\right)^2 dx $$<br \/>\nSubstitute for the sine series to obtain. $$ L_2 = \\int_{\\Omega} \\left({{a_n}sin (n \\pi x)}- f(x) \\right)^2 dx $$<br \/>\nExpand the terms to obtain $$ L_2 = \\int_{\\Omega} a_n^2 \\sin^2(n \\pi x) dx\u00a0 -2\\int_{\\Omega} a_n f(x) \\sin(n \\pi x) dx + \\int_{\\Omega} f^2(x) dx $$<\/p>\n<p>Now, these integrals are particularly interesting. The first integral is a constant \\(0.5 a_n^2\\). The second contains the definition of \\(a_n\\). The third only contains the function \\(f^2(x)\\). This simplifies to $$L_2(N) = -\\frac{1}{2} a_n^2 +\\int_\\Omega f^2(x) dx$$<\/p>\n<p>Interestingly, if we let the error become zero, the following is an identity $$ a_n^2 = 2 \\int_\\Omega f^2(x) dx$$ Knowledge of this identity will allow you to quickly compute integrals of squared trig functions.<\/p>\n<p>Neat! Do you have any interesting Fourier results? Let me know in the comments.<\/p>\n\n","protected":false},"excerpt":{"rendered":"<p>How close is my Fourier Sine series to a function f(x)? Answer: This question came up recently while discussing PDE (partial differential equations) solution techniques. The final result is quite interesting. Our sine series approximates the function f(x) over the domain as $$f(x) \\approx \\sum {{a_n}\\sin (n \\pi x)}$$ You can determine the coefficients with [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/charles-oneill.com\/blog\/wp-json\/wp\/v2\/posts\/7"}],"collection":[{"href":"https:\/\/charles-oneill.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/charles-oneill.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/charles-oneill.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/charles-oneill.com\/blog\/wp-json\/wp\/v2\/comments?post=7"}],"version-history":[{"count":9,"href":"https:\/\/charles-oneill.com\/blog\/wp-json\/wp\/v2\/posts\/7\/revisions"}],"predecessor-version":[{"id":112,"href":"https:\/\/charles-oneill.com\/blog\/wp-json\/wp\/v2\/posts\/7\/revisions\/112"}],"wp:attachment":[{"href":"https:\/\/charles-oneill.com\/blog\/wp-json\/wp\/v2\/media?parent=7"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/charles-oneill.com\/blog\/wp-json\/wp\/v2\/categories?post=7"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/charles-oneill.com\/blog\/wp-json\/wp\/v2\/tags?post=7"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}