In another question (see here) appeared the expression $ \cos ~ x(5-4\sin~x) $, that I interpreted as $ \cos(~x(5-4\sin(x))~) $, erroneously because everybody understood it as $ (\cos(x))~(5-4\sin(x)) $.
However, it seems that the correct interpretation of $ \cos~2x $ is $ \cos(2x) $. I do not known which one is the correct one for $ \cos~xy $.
Please, are you so kind of explain a few the rules of precedence when trigonometric functions appears ?
Googling internet it appears references to PEMDAS/BODMAS/BIDMAS, but it seems these ones doesn't includes the trigonometric functions.
The expression is definitely ambiguous, as you know. Unfortunately, there are no actual rules of precedence, though there are some conventions. $\cos 2x$ is $\cos(2x)$ and $\cos xy$ is $\cos(xy)$. If an author wanted $(\cos x)y$ he or she would surely write $y \cos x$.
Since you can't ask the author what was meant in the post you link to, you have to guess. In choosing between $$ (\cos(x)) (5 - \sin(4x)) $$ and $$ \cos(x (5 - \sin(4x)) $$ the former is more likely. Products of trigonometric functions are common, but compositions are much less so.
In the particular example in the link, the first is clearly what's meant. The second leads to an integral no one could reasonably ask about.