# Derivative of Hyperbolic Tangent

In this tutorial we shall prove the derivative of the hyperbolic tangent function.

Let the function be of the form $y = f\left( x \right) = \tanh x$

By the definition of the hyperbolic function, the hyperbolic tangent function is defined as
$\tanh x = \frac{{{e^x} – {e^{ – x}}}}{{{e^x} + {e^{ – x}}}}$

Now taking this function for differentiation, we have
$\tanh x = \frac{{{e^x} – {e^{ – x}}}}{{{e^x} + {e^{ – x}}}}$

Differentiating both sides with respect to the variable $x$, we have
$\frac{d}{{dx}}\tanh x = \frac{d}{{dx}}\left( {\frac{{{e^x} – {e^{ – x}}}}{{{e^x} + {e^{ – x}}}}} \right)$

Using the quotient formula for differentiation, we have
$\frac{d}{{dx}}\left( {\tanh x} \right) = \frac{{\left( {{e^x} + {e^{ – x}}} \right)\frac{d}{{dx}}\left( {{e^x} – {e^{ – x}}} \right) – \left( {{e^x} + {e^{ – x}}} \right)\frac{d}{{dx}}\left( {{e^x} – {e^{ – x}}} \right)}}{{{{\left( {{e^x} + {e^{ – x}}} \right)}^2}}}$

Using the formula of exponential differentiation $\frac{d}{{dx}}{e^x} = {e^x}$, we have
$\begin{gathered} \frac{d}{{dx}}\left( {\tanh x} \right) = \frac{{\left( {{e^x} + {e^{ – x}}} \right)\left( {{e^x} + {e^{ – x}}} \right) – \left( {{e^x} + {e^{ – x}}} \right)\left( {{e^x} + {e^{ – x}}} \right)}}{{{{\left( {{e^x} + {e^{ – x}}} \right)}^2}}} \\ \Rightarrow \frac{d}{{dx}}\left( {\tanh x} \right) = \frac{{{{\left( {{e^x} + {e^{ – x}}} \right)}^2} – {{\left( {{e^x} + {e^{ – x}}} \right)}^2}}}{{{{\left( {{e^x} + {e^{ – x}}} \right)}^2}}} \\ \Rightarrow \frac{d}{{dx}}\left( {\tanh x} \right) = \frac{{\left( {{e^{2x}} + {e^{ – 2x}} + 2{e^x}{e^{ – x}}} \right) – \left( {{e^{2x}} + {e^{ – 2x}} – 2{e^x}{e^{ – x}}} \right)}}{{{{\left( {{e^x} + {e^{ – x}}} \right)}^2}}} \\ \Rightarrow \frac{d}{{dx}}\left( {\tanh x} \right) = \frac{{\left( {{e^{2x}} + {e^{ – 2x}} + 2} \right) – \left( {{e^{2x}} + {e^{ – 2x}} – 2} \right)}}{{{{\left( {{e^x} + {e^{ – x}}} \right)}^2}}} \\ \Rightarrow \frac{d}{{dx}}\left( {\tanh x} \right) = \frac{{{e^{2x}} + {e^{ – 2x}} + 2 – {e^{2x}} – {e^{ – 2x}} + 2}}{{{{\left( {{e^x} + {e^{ – x}}} \right)}^2}}} \\ \Rightarrow \frac{d}{{dx}}\left( {\tanh x} \right) = \frac{4}{{{{\left( {{e^x} + {e^{ – x}}} \right)}^2}}} \\ \Rightarrow \frac{d}{{dx}}\left( {\tanh x} \right) = {\left( {\frac{2}{{{e^x} + {e^{ – x}}}}} \right)^2} \\ \end{gathered}$

By definition, $\operatorname{sech} x = \frac{2}{{{e^x} + {e^{ – x}}}}$, so we get
$\Rightarrow \frac{d}{{dx}}\left( {\tanh x} \right) = \sec {h^2}x$

Example: Find the derivative of $y = f\left( x \right) = \tanh \sqrt {{x^3}}$

We have the given function as
$y = \tanh \sqrt {{x^3}}$

Differentiating with respect to variable $x$, we get
$\frac{{dy}}{{dx}} = \frac{d}{{dx}}\tanh \sqrt {{x^3}}$

Using the rule, $\frac{d}{{dx}}\left( {\tanh x} \right) = \sec {h^2}x$, we get
$\begin{gathered} \frac{{dy}}{{dx}} = {\operatorname{sech} ^2}\sqrt {{x^3}} \frac{d}{{dx}}\sqrt {{x^3}} \\ \Rightarrow \frac{{dy}}{{dx}} = {\operatorname{sech} ^2}\sqrt {{x^3}} \frac{1}{{2\sqrt {{x^3}} }}\frac{d}{{dx}}{x^3} \\ \Rightarrow \frac{{dy}}{{dx}} = \frac{{{{\operatorname{sech} }^2}\sqrt {{x^3}} }}{{2\sqrt {{x^3}} }}3{x^2} \\ \Rightarrow \frac{{dy}}{{dx}} = \frac{{3{x^2}{{\operatorname{sech} }^2}\sqrt {{x^3}} }}{{2\sqrt {{x^3}} }} \\ \end{gathered}$