Ta có: $S+4P=4(S^2-2P)\Leftrightarrow S+12P=4S^2$$\Rightarrow 12P=4S^2-S$
$\Rightarrow -60PS=4S^2-20S^3$
$A=20S(S^2-3P)-6(S^2-2P)+2013$
$=20S^3-60PS-6S^2+12P+2013$
$=3S^2-S+2013=f(S)$
Mặt khác $4S^2-S=12P\le 12.\frac{S^2}{4}=3S^2$
$\Leftrightarrow S^2-S\le 0\Leftrightarrow S(S-1)\le 0\Leftrightarrow S\le 1$ (do $S>0$)
$A=f(S)\le f(1)=2015$
Dấu bằng có khi $a=b=\frac{1}{2}$