#### Blog Stats

• 37,065 hits

# Derivative of Tanh Function

Tanh (Hyperbolic Tangent) Function

${\color{Magenta}&space;g(z)=tanh(z)=\frac{e^{z}-e^{-z}}{e^{z}+e^{-z}}}$

Derivative of Tanh (Hyperbolic Tangent) Function

\begin{align*}&space;\frac{d}{dz}&space;\left&space;(&space;\frac{e^{z}-e^{-z}}{e^{z}+e^{-z}}&space;\right&space;)&=&space;\frac{e^{z}+e^{-z}}{\left&space;(&space;e^{z}+e^{-z}&space;\right&space;)^2}d\left&space;(&space;e^{z}-e^{-z}&space;\right&space;)-\frac{e^{z}-e^{-z}}{\left&space;(&space;e^{z}+e^{-z}&space;\right&space;)^{2}}d\left&space;(&space;e^{z}+e^{-z}&space;\right&space;)\\&space;&=\frac{\left&space;(&space;e^{z}+e^{-z}&space;\right&space;)\left&space;(&space;e^{z}&space;+e^{-z}\right&space;)}{\left&space;(&space;e^{z}&space;+e^{-z}\right&space;)^{2}}-&space;\frac{\left&space;(&space;e^{z}-e^{-z}&space;\right&space;)\left&space;(&space;e^{z}&space;-e^{-z}\right&space;)}{\left&space;(&space;e^{z}&space;+e^{-z}\right&space;)^{2}}\\&space;&=\frac{\left&space;(&space;e^{z}+e^{-z}&space;\right&space;)^2&space;-&space;\left&space;(&space;e^{z}&space;-e^{-z}\right&space;)^2}{\left&space;(&space;e^{z}&space;+e^{-z}\right&space;)^{2}}&space;\\&space;&=&space;1-(\frac{e^{z}-e^{-z}}{e^{z}+e^{-z}})^2&space;\\&space;&=&space;1-tanh(z)^2&space;\end{align*}

Sidebar