Maximizing and minimizing dot products Given 2 vectors $u,v \in \mathbb{R^n}$ such that $\|u\| = 1$ and $\sum_{i=1}^n v_i= c$ where $c<1$, I would like to maximize $$\sum_{i=1}^n u_i v_i \log (v_i)$$ and minimize
$$\sum_{i=1}^n u_i v_i \log (u_i)$$.
The answer in my opinion is $-c\log(c)$ if $c<1/e$ (and $c\log(c)$ for the minimum). I think so because on $[-1/e, 1/e]$ the function is monotonic (not sure of that). However I can't find formal proof of that, and I'll be glad for help

A hint could be to write the expressions as functions $f$ and $g$:
$$f({\bf u},{\bf v}) =  \sum_{i=1}^n u_i v_i \log (v_i) \\
g({\bf u}, {\bf v}) = \sum_{i=1}^n u_i v_i \log (u_i)$$
and then use partial differentiation and set the gradient of both to 0 and see where it leads. If necessary (and possible) then add the constraint that the hessians (matrices of partial second order differentials) should be positive resp. negative definite.
For the equality constraints as Giuseppe proposed we can add lagrange multipliers $$\lambda_1\|{\bf v}^t{\bf 1}-c\|, \lambda_2 \|{\bf u}^t{\bf u}-1\|$$
And maybe a barrier function for $c<1$ constraint if $c$ is also an unknown.
As we want the gradients to be zero vectors a candidate total function to minimize would be:
$$\min_{\bf u,v}\left\{\|\nabla f({\bf u , v})\| + \|\nabla g({\bf u,v})\| + \lambda_1\|{\bf v}^t{\bf 1}-c\| + \lambda_2 \|{\bf u}^t{\bf u}-1\|\right\}$$
For some suitable norm(s).
