Find the maximum value of $T=\frac{2}{3}(\cos 2A-\cos 2B)-\tan\frac{C}{2}$ Let $ABC$ be a triangle. Find the maximum value of 
$$T=\frac{2}{3}(\cos 2A-\cos 2B)-\tan\frac{C}{2}$$
Please give me some hints. I don't know where to start
Thanks

Hint. 
$$T=-\frac43\sin(A+B)\sin(A-B)-\frac{1}{\tan\frac{A+B}{2}}.$$
If $A+B\ge \pi/2$,
$$T\le \frac43\sin(A+B)-\frac{1}{\tan\frac{A+B}{2}},$$
where equality holds for $A-B=-\pi/2$. 
If $A+B<\pi/2$,
$$T\le \frac43\sin^2(A+B)-\frac{1}{\tan\frac{A+B}{2}},$$
where equality holds for $A=0$. 
Note that if you set $t=\tan\frac{A+B}{2}$, $$\sin (A+B)=\frac{2t}{1+t^2}.$$
Use derivatives with respect to $t$.
