Solution. Let
\begin{align*} f(x) = \tanh(x) = \frac{\sinh(x)}{\cosh(x)} = \frac{e^x - e^{-x}}{e^x + e^{-x}}. \end{align*}
\begin{align*} \frac{e^x - e^{-x}}{e^x + e^{-x}} = \frac{g(x)}{h(x)}, \end{align*}
\begin{align*} f'(x) = \frac{d}{dx} \tanh(x) = \frac{g'(x)h(x) - g(x)h'(x)}{h(x)^2}. \end{align*}
\begin{align*} g'(x) = e^x + e^{-x} \quad \text{and} \quad h'(x) = e^x - e^{-x}. \end{align*}
\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*}