I am facing a problem where you have to find the minimum of the function \begin{equation} f(a_1,...,a_n) = \sum_{i=1}^n \frac{1}{a_i} \end{equation} constrained to \begin{equation} \sum_{i=1}^n a_i = 2m \end{equation} and \begin{equation} a_1 \leq m \leq a_n \end{equation} where $a_1$ and $a_n$ are respectively the smallest and the largest element and $a_i>0\ \forall i$. Can we find the minimum of $f(a_1,...,a_n)$ without resorting to non-linear optimization methods?
ADDITIONAL THOUGHTS:
I already faced a similar problem without the constraints on $a_1$ and $a_n$ that can be solved through Cauchy-Schwarz inequality. If we apply C-S trying to exclude one of the elements, say $a_j$, we find \begin{equation} \sum_{i=1}^n \frac{1}{a_i} \geq \frac{(n-1)^2}{2m- a_j} + \frac{1}{a_j}\ . \end{equation} which according to Monte Carlo simulations takes the minimum when $a_j=m$. In fact, the result should be \begin{equation} f(a_1,...,a_n) \geq \frac{(n-1)^2}{m} + \frac{1}{m} \end{equation} meaning that the minimum of $f(a_1,...,a_n)$ is reached when one of the elements is exactly $m$.
You're almost there -- your Monte Carlo simulations do in fact indicate the optimal solution. Here's a full proof:
If $n=1$, the conditions can't be satisfied. If $n=2$, the conditions are always satisfied, and so the optimum is $2/m$ when $a_1=a_2=m$. Otherwise, $a_1\leq m$ since $$a_1\leq \frac{a_1+\cdots+a_n}n=\frac{2m}n\leq m,$$ and so the only nontrivial condition is $a_n\geq m$.
Applying Cauchy-Schwarz gives $$\left(\sum_{i=1}^{n-1}\frac1{a_i}\right)\left(\sum_{i=1}^{n-1}a_i\right)\geq (n-1)^2,$$ and so $$\sum_{i=1}^n\frac1{a_i}\geq \frac{(n-1)^2}{2m-a_n}+\frac1{a_n}.$$ Equality is reached if and only if $a_1=\cdots=a_{n-1}=\frac{2m-a_n}{n-1}$. So, the minimum is reached by $$\min_{m\leq x\leq 2m}\left(\frac{(n-1)^2}{2m-x}+\frac1x\right).$$ Let this function be $f(x)$. We may compute that, for $m\leq x\leq 2m$, $$f'(x)=\frac{(n-1)^2}{(2m-x)^2}-\frac1{x^2}\geq \frac{(n-1)^2}{m^2}-\frac1{m^2}=\frac{n(n-2)}{m^2}>0,$$ and so $f(x)$ is minimized when $x=m$.