How to maximize $f(x,y) = 3\sin x + 4\cos y$? Hello for an linear algebra course I have the question as seen below


*Among all the unit vectors
$$
u=\left(\begin{array}{l}
u_{1} \\
u_{2} \\
u_{3} \\
u_{4}
\end{array}\right) \in \mathbb{R}^{4}
$$
find the one for which the sum
$$
3 u_{1}-2 u_{2}+4 u_{3}-u_{4}
$$
is maximal.

To maximize the sum of the unit vector I have set $u_2$ and $u_4$ to $0$ since they do not contribute to the sum. Then we are left with $2$ variables that squared have to add up to $1$. Thats when I thought of the unit circle since that always adds up to one. But trigonometry is not my strongest point and I am now trying to figure out how to maximize $3\sin x + 4\cos y$ since this would be a valid unit vector and maximize the sum in the question. Or is there another way to answer this questions. Any help or suggestions are much appreciated.
Thanks in advance,
Thomas

We are given the vector ${\bf a}:=(3,-2,4,-1)$ and are looking for the unit vector ${\bf u}\in{\mathbb R}^4$ for which the scalar product
$${\bf a}\cdot{\bf u}$$
is maximal. By Schwarz' inequality we have ${\bf a}\cdot{\bf u}\leq|{\bf a}|$ for all ${\bf u}\in S^3$. Maybe you find a ${\bf u}\in S^3$ for which we equality here.
