CommandstanhOn this pagetanh tanh (num) The tanh function returns the hyperbolic tangent of num: tanh(x)=ex−e−xex+e−x.\displaystyle \tanh (x)=\frac{e^{x}-e^{-x}}{e^{x}+e^{-x}}.tanh(x)=ex+e−xex−e−x. In complex expressions, num is complex, and tanh(num) returns a complex value. See Also sinh, cosh, coth