# Find the maximum of $f(x, y) = \sum_{k = 1}^{n} x_k y_k$ subject to $\sum_{k=1}^{n} x_k^2 = 1$ and $\sum_{k=1}^{n} y_k^2 = 4$

Find the maximum of $$f(x, y) = \sum_{k = 1}^{n} x_k y_k$$ subject to $$\sum_{k=1}^{n} x_k^2 = 1$$ and $$\sum_{k=1}^{n} y_k^2 = 4$$

I just applied Cauchy Schwarz inequality to find

$$-4 \leq |f(x, y)| \leq 4.$$

So I believe the maximum is $$4$$ and the minimum is $$-4$$. The maximum is attained when $$x = (1, 1)$$ and $$y = (2, 2)$$. The minimum can attained when $$x = (-1 , -1)$$ and $$y = (2, 2)$$.

Is this enough to prove that my bounds are optimal? If not, how can I do so?

• Your $y$ does not satisfy $\sum y_k^2 = 4$. – kccu May 20 at 19:05
• Why have you deleted your previous question I really tried to help you. – callculus May 20 at 19:21
• @callculus I undeleted it. My original post is the correct answer, so I didn't think it was necessary to leave it up. – gallileo22 May 20 at 19:29
• @gallileo22 In my view the right answer depends on some assumptions which I´ve asked for. The question itself is interesting. – callculus May 20 at 19:37

Cauchy-Schwarz actually gives you a bound of 2, not 4. In this case $$x_i = \frac{1}{\sqrt{n}}$$ and $$y_i = \frac{2}{\sqrt{n}}$$ suffice for the maximum, and negating all the $$x_i$$ produces the minimum.