< f , g >= ∫ a b f ( x ) g ( x ) d x {\displaystyle <f,g>=\int _{a}^{b}f(x)g(x)\ dx\!}
< f , g >= ∫ − 2 10 x cos ( x ) d x {\displaystyle <f,g>=\int _{-2}^{10}x\cos(x)\ dx\!}
Using integration by parts;
< f , g >= [ x sin ( x ) + cos ( x ) ] − 2 10 {\displaystyle <f,g>=[x\sin(x)+\cos(x)]_{-2}^{10}}
< f , g >= − 7.68 {\displaystyle <f,g>=-7.68\!}
‖ f ‖ =< f , f > 1 / 2 = ∫ a b f 2 ( x ) d x {\displaystyle \|f\|=<f,f>^{1/2}=\int _{a}^{b}f^{2}(x)\ dx\!}
= ∫ − 2 10 [ cos ( x ) ] 2 d x {\displaystyle =\int _{-2}^{10}[\cos(x)]^{2}\ dx\!}
= [ .5 ( x + sin ( x ) cos ( x ) | − 2 10 ] 1 / 2 {\displaystyle =[.5(x+\sin(x)\cos(x)|_{-2}^{10}]^{1/2}}
‖ f ‖ = 2.457 {\displaystyle \|f\|=2.457\!}
‖ g ‖ = ∫ a b g 2 ( x ) d x {\displaystyle \|g\|=\int _{a}^{b}g^{2}(x)\ dx\!}
= ∫ − 2 10 x 2 d x {\displaystyle =\int _{-2}^{10}x^{2}\ dx} = [ x 3 / 3 ] − 2 10 {\displaystyle =[x^{3}/3]_{-2}^{10}}
‖ g ‖ = 1008 3 {\displaystyle \|g\|={\frac {1008}{3}}\!}
c o s ( θ ) = < f , g > ‖ f ‖ ‖ g ‖ {\displaystyle cos(\theta )={\frac {<f,g>}{\|f\|\|g\|}}\!}
c o s ( θ ) = − 7.68 1008 3 ( 2.457 ) {\displaystyle cos(\theta )={\frac {-7.68}{{\frac {1008}{3}}(2.457)}}}
θ = 89.47 {\displaystyle \theta =89.47} The two functions are nearly orthogonal.