\documentclass{article}
\usepackage{latexml}
\lxDeclare[role=ID]{$a$}%
\lxDeclare[role=ID]{$b$}%
\lxDeclare[role=ID]{$c$}%
\lxDeclare[role=ID]{$d$}%
\lxDeclare[role=ID]{$e$}%
\lxDeclare[role=ID]{$x$}%
\lxDeclare[role=ID]{$y$}%
\lxDeclare[role=FUNCTION]{$f$}%
\lxDeclare[role=FUNCTION]{$p$}%
\lxDeclare[role=FUNCTION]{$g$}%
\lxDeclare[role=FUNCTION]{$h$}%
\lxDeclare[role=OPFUNCTION]{$F$}%
\lxDeclare[role=OPFUNCTION]{$G$}%
\lxDeclare[role=OPFUNCTION]{$H$}%

\makeatletter
\def\apply{\iflatexml\@APPLYFUNCTION\fi}
\makeatother
\begin{document}
\section{Basic Functions}
\[ g(a) = g(b) \]
\[ f(a) = g(h(c)) \]
\[ h(c) = \sin a^2 \]
\[ \sin f(a) \]

\section{Trigonometric functions}
\[ \sin a + \tan b \]
\[ \sin a \cos b \neq \sin(a\cos b)\]
% Parses wrong ? but how to clarify?
\[ \sin 2\pi \neq \log 2x^2 \]
\[ \log \sin x \]
\[ \sin \log x \]
\[ \nabla \log x \]

\section{Probability functions}
\[ p (x,y|\Theta) \]
\[ p (y |x,\Theta) \]
\[ f \left( a \middle| b \right) \]

\section{Missing arguments}
% Presumably these are products
\[ f g h \]
\[ f g h a \]
\section{Operator-like functions}
% But these are applied!
\[ F G H \]
\[ F G H a \]

\[ f'(a) = a^2 \]
\[ f^2(a) = g^b(2) \]

\[ f  \apply g x \]
\[ f \apply (x) \]

\section{Scripts}
\[ \ln a = \log_e a = \ln_{+} b\]

\section{Advanced argument patterns}
\[ f ( a < b )  \]
\[ f ( a : b )  \]
\[ f ( a \leftrightarrow b )  \]
\[ f( \rightarrow , \leftarrow) \]


\end{document}
