# Hyperbolic functions both produce error and result already existant when inserted in preamble

I'm trying to write hyperbolic functions like sech, csch, etc,

Since amsmath doesn't recognize them in the form \sech, \csch, ...

I wrote a preamble like \DeclareMathOperator{\sech}{sech} but I get this error:

! LaTex Error: Command \tanh already defined. Or name \end... illegal, see p. 192 of the manual.

how should I write the hyperbolic functions?

• Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}.
– user31729
Mar 18, 2015 at 17:10
• after this comment I worked it out: tanh and coth were already defined, sech and csch neededd to be defined in the preamble
– maja
Mar 18, 2015 at 17:18
• Barbara Beeton already answered: The standard hyperbolic function macros are there, \sech etc are quite rare, in my point of view, so they weren't defined.
– user31729
Mar 18, 2015 at 17:19

not all the hyperbolic functions are defined in amsmath (actually, in amsopn.sty). only \sinh, \cosh, \tanh and \coth are defined there.
you can define the others exactly like you've shown for \sech, and can check in amsopn.sty if you encounter any other conflicts.
amsopn.sty was never meant to be exhaustive. it covers only the operator names found most frequently in ams publications as of the time it was compiled. there are surely many other possibilities.
• after having read this answer first in the comments I worked it out: tanh and coth were already defined, sech and csch needed to be defined in the preamble. thanks