\DeclareMathOperator*{\tg}{tan}

so that whenever you write "\tg" in the LaTeX code is will appear as "tan" in the document.