Primers • Derivative of the tanh function
- Prove that the derivative of the tanh function with respect to the input \(z\) is:
- Recall that the tanh function is given by:
- Per the quotient rule of derivatives,
- Set \(f=\sinh(z) , g=\cosh(z)\) to get:
- Now,
- Thus,
- Now,
Proof:
\[1-\frac{\sinh^{2}(z) }{\cosh^{2}(z) }=\frac{\cosh^{2}(z) -\sinh^{2}(z) }{\cosh^{2}(z) }\] \[\operatorname{since}\left(\cosh^{2}(z) \right)-\left(\sinh^{2}(z) \right)=1\] \[\frac{1}{\cosh^{2}(z) }=\operatorname{sech}^{2} z\]Thus,
\[\boxed{\frac{d \tanh(z) }{d z}=1-\tanh^{2}(z) =\frac{1}{\cosh^{2}(z) }}\]