According to the definition of $\tanh(x)$ on a scalar, we have $\tanh(x) = \frac{e^x - e^{-x}}{e^x + e^{-x}} = \frac{2}{1 + e^{-2x}} - 1$. Now if X is a matrix instead of a scalar, then is it true that $\tanh(X) = (e^X + e^{-X})^{-1}(e^X - e^{-X}) = 2(1 + e^{-2X})^{-1} - 1$?
Thanks!