maximum of $f(x)=\sin{(\pi Ax)}\left(\,\csc{(\pi x)}+\csc{(\pi (\frac{1}{A}-x))}\,\right)$ 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$.



 A: It took me a good chunk of the day and a bunch of headaches, but I was able to write an informal proof that that $f(x)=\sin{(\pi Ax)}\left(\,\csc{(\pi x)}+\csc{(\pi (\frac{1}{A}-x))}\,\right)$ has a maximum at $x=\frac{1}{2A}$ for any $A$ not only for integers >= 2, but for all reals $A < -1$ or $A > 1$.
The trick to proving this is we have to prove f(x)' is 0 and f(x)'' is negative. 
Let $A$ be any number for the reals excluding 0 and 
$f(x) = \sin( \pi A x)\csc(\pi x) + \sin(x \pi A)\csc( \pi(\frac{1}{A} - x))$. 
Now we are going to derive f(x). 
By deriving f(x), we get that:
$f'(x) =  A \pi \cos( \pi A x) \csc( \pi x) 
    - \pi\sin(\pi A x)\csc( \pi x)\cot(\pi x) 
    + \pi A\cos(\pi A x)\csc(\pi (\frac{1}{A}-x))
    +  \pi\sin(\pi Ax)\csc(\pi(\frac{1}{A}-x))\cot( \pi(\frac{1}{A}-x))$
Which reduces to:
$f'(x) =  \pi A \cos(\pi Ax)(\csc(\pi x) + \csc(\pi(\frac{1}{A} - x)) + \pi\sin(\pi Ax)(\csc(\pi(\frac{1}{A}-x))\cot(\pi(\frac{1}{A}-x) - \csc(\pi x)\cot(\pi x))$ 
Now we will substitute in $x = \frac{1}{2A}$ and get:
$f'(x) = \pi A \cos(\pi A(\frac{1}{2A}))(\csc(\pi(\frac{1}{2A})) + \csc(\pi(1/A - (\frac{1}{2A})) + \pi \sin(\pi A(\frac{1}{2A}))(\csc(\pi(1/A-(\frac{1}{2A})))\cot(\pi(1/A-(\frac{1}{2A})) - \csc(\pi(\frac{1}{2A}))\cot(\pi(\frac{1}{2A}))$
Which simplified looks like:
$f'(x) =  \pi A\cos(\frac{\pi}{2})(\csc(\frac{\pi}{2}) + \csc(\frac{\pi}{2A})) 
+ \pi \sin(\frac{\pi}{2})(\csc(\frac{\pi}{2A})\cot(\frac{\pi}{2A}) - \csc(\frac{\pi}{2A})\cot(\frac{\pi}{2A}))$
Since $cos({\pi}{2})) = 0$ and $\csc(\frac{\pi}{2A})\cot(\frac{\pi}{2A}) - \csc(\frac{\pi}{2A})\cot(\frac{\pi}{2A}) = 0$, we can further reduce the problem to:
$f'(x) =  \pi A(0)(\csc(\frac{\pi}{2}) + \csc(\frac{\pi}{2A})) + \pi \sin(\frac{\pi}{2})(0)$
So $f'(x) = 0$ for any real A that does not equal 0 so by definition, $\frac{1}{2A}$ is a critical point.
Now to prove that $x = \frac{1}{2A}$ is a maximum bigger headache.
In order to prove $x =\frac{1}{2A}$ is a maximum, we must prove $f(x)'' < 0$. 
We now have to take the derivative of f(x)' and after much simplification, substituting  $x = \frac{1}{2A}$, and further simplifying, we get:
$f(x)'' = 2\pi^2\sin(\frac{\pi}{2})(\csc(\frac{\pi}{2A})(-A^2+2\cot(\frac{\pi}{2A})^2+1)$
(I have all the work, it's just a lot to post.)
Now $2\pi^2\sin(\frac{\pi}{2})(\csc(\frac{\pi}{2A})> 0$ for all reals except $A=0$,  so when $-A^2+2\cot(\frac{\pi}{2A})^2+1 < 0$ then $\frac{1}{2A}$ is a maximum.
Plugging in $-A^2+2\cot(\frac{\pi}{2A})^2+1$ into Wolfram Alpha, when $-1<=A<=1$ then $-A^2+2\cot(\frac{\pi}{2A})^2+1 > 0$ and when  $A < -1$ or $A > 1$ then $-A^2+2\cot(\frac{\pi}{2A})^2+1 < 0$.
So since f(x)'' is negative and f(x)' is 0, by definition $x=\frac{1}{2A}$ is a maximum for
all reals except for -1 <= A <= 1.
QED
(Thanks to Maple and Wolfram Alpha for helping derive and simplify the derivatives and checking the work.)
A: 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.
