This is LaTeX code:
[latex]
P=\frac{ma}{2}+\frac{nb}{2}
[/latex]