35.1_tanh函数的导数

35.1 tanh函数的导数

为了求tanh函数的导数,我们需要使用以下导数公式

{f(x)g(x)}=f(x)g(x)f(x)g(x)g(x)2(35.2)\left\{\frac {f (x)}{g (x)} \right\} ^ {\prime} = \frac {f ^ {\prime} (x) g (x) - f (x) g ^ {\prime} (x)}{g (x) ^ {2}} \tag {35.2}

式子35.2是分数函数的导数公式。为了便于查看,这里用 f(x)f^{\prime}(x) 表示 f(x)f(x)xx 的导数。利用以自然常数(e)为底的指数函数的导数式子 exx=ex\frac{\partial \mathrm{e}^{x}}{\partial x} = \mathrm{e}^{x}exx=ex\frac{\partial \mathrm{e}^{-x}}{\partial x} = -\mathrm{e}^{-x} ,可求得式子35.1表示的tanh函数的导数。

tanh(x)x=(ex+ex)(ex+ex)(exex)(exex)(ex+ex)2=1(exex)(exex)(ex+ex)2=1{(exex)(ex+ex)}2=1tanh(x)2=1y2(35.3)\begin{array}{l} \frac {\partial \tanh (x)}{\partial x} = \frac {(\mathrm {e} ^ {x} + \mathrm {e} ^ {- x}) (\mathrm {e} ^ {x} + \mathrm {e} ^ {- x}) - (\mathrm {e} ^ {x} - \mathrm {e} ^ {- x}) (\mathrm {e} ^ {x} - \mathrm {e} ^ {- x})}{(\mathrm {e} ^ {x} + \mathrm {e} ^ {- x}) ^ {2}} \\ = 1 - \frac {\left(\mathrm {e} ^ {x} - \mathrm {e} ^ {- x}\right) \left(\mathrm {e} ^ {x} - \mathrm {e} ^ {- x}\right)}{\left(\mathrm {e} ^ {x} + \mathrm {e} ^ {- x}\right) ^ {2}} \\ = 1 - \left\{\frac {\left(\mathrm {e} ^ {x} - \mathrm {e} ^ {- x}\right)}{\left(\mathrm {e} ^ {x} + \mathrm {e} ^ {- x}\right)} \right\} ^ {2} \tag {35.3} \\ = 1 - \tanh (x) ^ {2} \\ = 1 - y ^ {2} \\ \end{array}

如式子35.3所示,利用分数函数的导数,通过简单的数学式变形,我们就可以求出tanh函数的导数。最终结果是 1y21 - y^{2}