TITLE: maximum of $f(x)=\sin{(\pi Ax)}\left(\,\csc{(\pi x)}+\csc{(\pi (\frac{1}{A}-x))}\,\right)$
QUESTION [8 upvotes]: Let a function $f(x)$ be 
$f(x)=\sin{(\pi Ax)}\left(\,\csc{(\pi x)}+\csc{(\pi (\frac{1}{A}-x))}\,\right)$
where $A\geq 2$ is a positive integer and $\csc{(x)}=\frac{1}{\sin{(x)}}$.
I want to prove that on the interval $x\in[0, \frac{1}{2A}]$, $f(x)$ has its maximum at $x=\frac{1}{2A}$.
To prove that, I think we have two approaches.
First, prove it directly.
Second, prove that $f(x)$ is an increasing function  on the interval $x\in[0, \frac{1}{2A}]$.
When $A=2$, we are able to take the second approach thanks to a user named egreg.
Prove that $\sin{(\pi 2x)}\left(\,\csc{(\pi x)}+\csc{(\pi (0.5-x))}\,\right)$ is an increasing function
Now could anybody prove it generally?
I am not sure for any $A$, $f(x)$ is increasing on the interval $x\in[0, \frac{1}{2A}]$ (maybe true?), but strongly believe the maximum is $f(\frac{1}{2A})$.
The followings are graphs of $f(x)$ when $A=2, 3, 4$, respectively, where $\frac{1}{2A}=0.25, 0.1667, 0.125$.

REPLY [2 votes]: Here is a very transparent answer, short and sweet.
$f(\frac{1}{2A}) = \sin(\frac{\pi}{2})[\csc(\frac{\pi}{2A})+\csc(\pi(\frac{1}{A}-\frac{1}{2A}))]=2\csc(\frac{\pi}{2A})$
Now let let $0\le\varepsilon<\frac{1}{2A}$, then compute 
$$f(\frac{1}{2A}-\varepsilon)= \sin(\pi A(\frac{1}{2A} - \varepsilon))[\csc(\pi(\frac{1}{2A}-\varepsilon)) + \csc(\pi(\frac{1}{2A}+\varepsilon))] =$$
Use two trig identities on the first term, to yield
$$=\cos(A \pi \varepsilon) [\csc(\pi(\frac{1}{2A}-\varepsilon)) + \csc(\pi(\frac{1}{2A}+\varepsilon))] $$
Now what can we say?  If $\varepsilon = 0$, we get back our orginal term.  So lets look at each individual bit.... after a moments thought, we see that each of the functions (the cosine is one function and the sum of the csc is the other) are each maximized when $\varepsilon=0$, because we are not maximizing them individually when $\varepsilon \neq 0$ we have that the full expression is not maximized for $\varepsilon \neq 0$ because in general we know (if you don't, you should)
$$\max\{f*g\} \le \max\{f\}*\max\{g\}$$
So maximizing the RHS of this inequality (in our case) gives our original function at $\frac{1}{2A}$ (this is easy to see), so it follows that this inequality is equality and we're done.  The LHS can get no better than the right hand side, which is obtained at $\varepsilon = 0$, so the max is realized the two coincide.