A.
F[f,g]=Integrate[f*g,{x,-Pi,Pi}]; Projection[x^2,Cos[x],F]
B.
F[f_,g_]:=Integrate[f*g,{x,-Pi,Pi}]; Orthogonalize[x^2,Cos[x],F]
C.
F[f_,g_]:=Integrate[f*g,{x,-Pi,Pi}]; Projection[x^2,Cos[x],F]
D.
F[f_,g_]:=Integrate[f(x)*g(x),{x,-Pi,Pi}]; Projection[x^2,Cos[x],F]