$$\frac{S \epsilon \text{Cos}[\tau ]}{\sqrt{\lambda }}+\frac{\text{g2} S^2 \epsilon ^2 (-3+\text{Cos}[2 \tau ])}{6 \lambda }+\epsilon ^3 \left(\frac{\left(-\frac{1}{54} \text{g2}^2 S \left(32+19 S^2\right) \lambda +Z \left(\frac{35 \text{g2}^4}{27}-\frac{7 \text{g2} \text{g4}}{4}+\frac{5 \text{g5}}{8}-\frac{\text{g2}^2 \lambda }{6}+\frac{\lambda ^2}{24}\right)\right) \text{Cos}[\tau ]}{\lambda ^{5/2}}+\frac{S^3 \left(4 \text{g2}^2-3 \lambda \right) \text{Cos}[3 \tau ]}{72 \lambda ^{3/2}}\right)$$
I have copied this from Mathematica as tex file. But the problem is I need to write the $\cos[x]$ as $\cos x$.
How can I do it?

\text{Cos}[...]into\cos ...– egreg Jun 12 '13 at 15:22