Sum of trigonometric functions Do somebody know the closed form of the following sum (m is an integer)
$$f(\beta)=\sum _{k=1}^{2m+1} \sin^{2 m+1}\left[\frac{-\beta+k \pi
}{1+2 m}\right]$$
If instead of $n=1+2m$ we put $n=2m$, then the above sum do not depends on $\beta$ and is equal to $\frac{2 \Gamma(1/2+m)}{\sqrt{\pi} \Gamma(m)}$. 
I need the maximum of $f(\beta)$, it seems that it is achieved in $0$ or in $\pi/2$ but I don't have the proof. 
Indeed I need the maximum $M_{k,q}$ of this integral (at least for q=1)
$$F_k(\beta)=\int_0^{2\pi
}\left(1-
\cos\left(\frac{2\beta}{k+1}+s\right)\right)^{\frac{(k+1)q-2}{2}}\left|
\cos\frac{(1+k) (s-\pi)}{2}\right|^q ds.$$
It is related to the sharp inequality $$|f^{(k)}(z)|\le (1-|z|^2)^{1-q-kq}M_{k,q}\|\Re f\|_{p}$$ where $f$ is an analytic function in the unit disk and the corresponding norm is the Hardy norm. For $n=1+k$ an even integer I have the proof...
 A: Some further manipulation past my answer of a week ago yields a formula that should reduce the proof of the observed behavior to routine (if not entirely pleasant) estimates.  Whereas $f$ is constant at $2/B(\frac12,\frac{n}2)$ for even $n$, in the present case of odd $n$ the maximum exceeds $2/B(\frac12,\frac{n}2)$ by a tiny amount that is very nearly
$$
\frac{4}{\pi} \phantom. \frac1{n+2} \frac2{n+4} \frac3{n+6} \cdots \frac{n}{3n} = \frac4\pi n! \frac{n!!}{(3n)!!}
= (27+o(1))^{-n/2}
$$
for large $n$.  Here and later we use "$u!!$" only for positive odd $u$ to mean the product of all odd integers in $[1,u]$; that is, $u!! := u!/(2^v v!)$ where $u=2v+1$.
Recall the previous notations: we take $n=2m+1$ and
$$
g(x) = f(x+\frac\pi2) = g(-x) = -g(x+n\pi),
$$
which has a finite Fourier expansion in cosines of odd multiples of $X := x/n$, namely
$$
f(x) = (-1)^m 2^{-n} \sum_{j=0}^n (-1)^j {n\choose j} \frac{\cos \phantom. tX}{\sin \frac{\pi t}{2n}}
$$
where $t = n-2j$.  Even before we use this expansion, we deduce from the original formula
$$
f(\beta)=\sum_{k=1}^n \sin^n\frac{-\beta+k \pi}{n}
$$
that $f(\beta)-f(\beta+\pi) = 2\phantom.\sin^n (\beta/n)$, from which it follows that $g(x)$ is maximized somewhere in $|x| \leq \pi/2$, but that changing the optimal $x$ by a small integral multiple of $\pi$ reduces $g$ by a tiny amount; this explains the near-maxima I observed at $x=\pm\pi$ for $2|m$, and indeed the further oscillations for both odd and even $m$ that I later noticed as $n$ grows further.
This also suggests that in and near the interval $|x| \leq \pi/2$ our function $g$ should be very nearly approximated for large $n$ by an even periodic function $\tilde g(x)$ of period $\pi$. We next outline the derivation of such an approximation, with $\tilde g$ having an explicit cosine-Fourier expansion
$$
\tilde g(x) = g_0 + g_1 \cos 2x + g_2 \cos 4x + g_3 \cos 6x + \cdots
$$
where $g_0 = 2/B(\frac12,\frac{n}2)$ and, for $l>0$,
$$
g_l = (-1)^{m+l-1} \frac4\pi \frac{n!}{2l+1} \frac{((2l-1)n)!!}{((2l+1)n)!!}
$$
with the double-factorial notation defined as above.  Thus
$$
\tilde g(x) = g_0 + (-1)^m \frac{4n!}\pi \left(\frac{n!!}{(3n)!!} \cos 2x - \frac13 \frac{(3n)!!}{(5n)!!} \cos 4x + \frac15 \frac{(5n)!!}{(7n)!!} \cos 6x - + \cdots \right).
$$
For large $n$, this is maximized at $x=0$ or $x=\pm\pi/2$ according as $m$ is even or odd.  Since we already know by symmetry arguments that $g'(0) = g'(\pm \pi/2) = 0$, this point or points will also be where $g$ is maximized, once it is checked that $g - \tilde g$ and its first two derivatives are even tinier there.
The key to all this is the partial-fraction expansion of the factor $1 / \sin (\pi t /2n)$ in the Fourier series of $g$, obtained by substituting $\theta = \pi t / 2n$ into
$$
\frac1{\sin \pi\theta} = \frac1\pi \sum_{l=-\infty}^\infty \frac{(-1)^l}{\theta-l}
$$
with the conditionally convergent sum interpreted as a principal value or Cesàro limit etc.  I already noted in the previous note that the main term, for $l=0$, yields the convolution of $\cos^n (x/n)$ with a symmetrical square wave, which is thus maximized at $x=0$ and almost constant near $x=0$; we identify the constant with $2/B(\frac12,\frac{n}2)$ using the known product formula for $\int_{-\pi/2}^{\pi/2} \cos^n X \phantom. dX$.  The new observation is that each of the error terms $(-1)^l/(\theta-l)$ likewise yields the convolution with a square wave of $(-1)^l \cos(2lx) \phantom. \cos^n(x/n)$.  If we approximate this square wave with a constant, we get the formula for $g_l$ displayed above, via the formula for the $n$-th finite difference of a function $1/(j_0-j)$.  The error in this approximation is still tiny (albeit not necessarily negative) because $\cos^n (x/n)$ is minuscule when $x$ is within $\pi/2$ of the square wave's jump at $\pm \pi n / 2$.
I've checked these approximations numerically to high precision (modern computers and gp make this easy) for $n$ as large as $100$ or so, in both of the odd congruence classes mod $4$, and it all works as expected; for example, when $n=99$ we have $f(0) - g_0 = 2.57990478176660\ldots \cdot 10^{-70}$, which almost exactly matches the main term $g_1 = (4/\pi) \phantom. 99! \phantom. 99!!/297!!$ but exceeds it by $5.9110495\ldots \cdot 10^{-102}$, which is almost exactly $g_2 = (4/\pi) \phantom. 99! \phantom. 297!!/(3 \cdot 495!!)$ but too large by $7.92129\ldots \cdot 10^{-120}$, which is almost exactly $g_3 = (4/\pi) \phantom. 99! \phantom. 495!!/(5 \cdot 693!!)$, etc.; and likewise for $n=101$ except that the maximum occurs at $\beta = \pi/2$ and is approximated by an alternating sum $g_1 - g_2 + g_3 \ldots$ (actually here this approximation is exact because $x=0$). 
A: This seems to be a hard problem.  What follows is not a proof, but some observations that may eventually lead to a proof.
There seems to be no simple "closed form"; I can numerically confirm that the maximum seems to occur at $\beta=0,\pi$ or $\beta=\pi/2$ according as $m$ is odd or even, but do not have a proof.  Numerical observation also indicates that $f(\beta)$, which is an even function of $\beta -\frac\pi2$ and anti-invariant under trranslation by $n\pi$, stays very close to the maximum for nearly half of its period (and thus close the minimum for nearly another half); and in particular that when $m$ is even, $f(\beta)$ comes extremely close to its maximum at $\beta = -\pi/2$ and $\beta = 3\pi/2$.  This suggests that proving the inequality is going to be quite hard.  It also suggests that there's a good reason for this behavior, and that (as already suggested in the "meta thread") the proposer of the problem please provide the context where this $f(\beta)$ arises, to help understand this curious behavior.
Let $n=2m+1$ and $g(x) = f(x+\frac\pi2)$, so $g$ is an even function and satisfies $g(x+n\pi) = -g(x)$.  Hence $g$ has a Fourier expansion as a linear combination of $\lbrace\cos(tx/n) : t=1,3,5,\ldots,n\rbrace$.  Using the complex-exponential formula for the sine (as suggested in a comment by R.May) yields the explicit expansion
$$
f(x) = (-1)^m 2^{-n} \sum_{j=0}^n (-1)^j {n\choose j} \frac{\cos \phantom. tX}{\sin \frac{\pi t}{2n}}
$$
with $t=n-2j$ and $X=x/n$.  If we try to understand the behavior as $n \rightarrow \infty$, we might imagine (the following is only heuristic!) that the binomial distribution ${n\choose j} / 2^n$ behaves like the matched Gaussian $(\pi n / 2)^{-1/2} \exp(-t^2/(2n))$, while $\sin(\pi t/(2n))$ behaves like $\pi t/(2n)$.  Then our sum would be
$$
\left(\frac{32n}{\pi^3}\right)^{1/2} \left(
 \exp\Bigl(\frac{-1^2}{2n}\Bigr) \cos X
- \exp\Bigl(\frac{-3^2}{2n}\Bigr) \frac{\cos 3X}{3}
+ \exp\Bigl(\frac{-5^2}{2n}\Bigr) \frac{\cos 5X}{5}
- \exp\Bigl(\frac{-7^2}{2n}\Bigr) \frac{\cos 7X}{7}
+ - \cdots
\right).
$$
For large $n$, if we ignore the exponentials we get a square wave of amplitude
$$
(32n/\pi^3)^{1/2} (\pi/4) = (2n/\pi)^{1/2};
$$
restoring the exponentials amounts to smoothing that square wave by applying a heat kernel for time proportional to $1/n$, which yields a function that stays very close to the square wave except near the jumps while never exceeding the original amplitude — which indeed looks a lot like what happens for the actual trigonometric sum.
Is there a rigorous way to show that our sort-of-discrete approximation by a trigonometric polynomial to this "heat-smoothed square wave" behaves similarly, and to verify that its maximum occurs at $x=0$ or $x=\pm\pi/2$ according to the parity of $m$?  Note that the Gaussian approximation to near-central binomial coefficients, and the linear approximation to $\sin(\pi t/(2n))$, are much too rough for direct estimates to work.
[added a bit later] Come to think of it, multiplying the $t$-th Fourier coefficient by $2^{-n} {n \choose j}$ amounts to convolution with $\cos^n(x)$, which does exactly what we want.  Dealing with the coefficients $1/\sin(\pi t/(2n))$ may be harder, but it feels like only one or two more ideas might be needed, at least for the case $2|m$ where the maximum occurs exactly at $x=0$.
