Let $f_1, \ldots , f_K$ be $K$ functions in $L_2(\mathbb{R})$.
I am looking for the solution set $$ \underset{g \in L_2(\mathbb{R}), \ \lVert g \rVert_2 = 1} {\arg \max} \sum_{k=1}^K \langle f_k , g \rangle^2$$ which naturally arises in my calculation.
For more context, I am considering the following problem. Consider a given 2d function $f(x,y) = \sum_{k=1}^K f_k(x) u_k(y)$ where the $f_k , u_k \in L_2(\mathbb{R})$ and the family $(u_1, \ldots , u_K)$ is orthogonal. I want to maximise the quantity $$ \langle f , h \rangle_{L_2(\mathbb{R}^2)}$$ where $f$ is given above and $$h(x,y) = g(x) \sum_{k=1}^K c_k u_k(y)$$ is normalized such that $\lVert h \rVert_2 = 1$. I somehow look for a separable version of $f$.
We can show, using the orthogonality of the $u_k$, that $$ \langle f , h \rangle_{L_2(\mathbb{R}^2)} = \sum_{k=1}^K c_k \langle f_k, g \rangle_{L_2(\mathbb{R})}, $$ we deduce using the equality case of Cauchy-Schwarz that we should pick $c_k(g) = \langle f_k,g \rangle$ (or proportional to) if $g$ is given. This leads to the initial problem that was asked, with the goal of finding the function(s) $g$.