You are currently viewing Find the derivative of Hyperbolic Tangent
derivative of tanh(x)

Find the derivative of Hyperbolic Tangent

The derivative of \tanh(x) is \text{sech}^2(x).

Solution. Let
\begin{align*}
f(x) = \tanh(x) = \frac{\sinh(x)}{\cosh(x)} = \frac{e^x - e^{-x}}{e^x + e^{-x}}.
\end{align*}
We will use the quotient rule, where we let
\begin{align*}
\frac{e^x - e^{-x}}{e^x + e^{-x}} = \frac{g(x)}{h(x)},
\end{align*}
such that we can determine
\begin{align*}
f'(x) = \frac{d}{dx} \tanh(x) =  \frac{g'(x)h(x) - g(x)h'(x)}{h(x)^2}.
\end{align*}
We know that \frac{d}{dx} e^x = e^x and that \frac{d}{dx} e^{-x} = -e^{-x}. So we get
\begin{align*}
g'(x) = e^x + e^{-x} \quad \text{and} \quad h'(x) = e^x - e^{-x}.
\end{align*}
So wrapping everything together, we get
\begin{align*}
f'(x) &= \frac{d}{dx} \tanh(x) \\
&=  \frac{g'(x)h(x) - g(x)h'(x)}{h(x)^2} \\
&=  \frac{(e^x + e^{-x})(e^x + e^{-x}) - (e^x - e^{-x})(e^x - e^{-x})}{(e^x + e^{-x})^2} \\
&=  \frac{e^{2x} + e^{-2x} + 2 - (e^{2x} - e^{-2x} - 2 )}{(e^x + e^{-x})^2} \\
&=  \frac{4}{(e^x + e^{-x})^2} \\
&=  \frac{2^2}{(e^x + e^{-x})^2} \\
&= \text{sech}^2(x).
\end{align*}
So, the derivative of \tanh(x) is \text{sech}^2(x).

Leave a Reply