Why is this derivative correct? Why is the following correct? Can't understand it.
$$\dfrac{d}{dz}\bigg(\dfrac{e^z-e^{-z}}{e^{z}+e^{-z}}\bigg)=1-\dfrac{(e^z-e^{-z})^2}{(e^{z}+e^{-z})^2}$$
 A: We use the quotient rule for taking derivatives:
$$\dfrac{d}{dz}\bigg(\dfrac{\overbrace{e^z-e^{-z}}^{\large f(x)}}{\underbrace{e^{z}+e^{-z}}_{\large g(x)}}\bigg)$$
$$\frac{d}{dx}\left(\frac{f(x)}{g(x)}\right) = \frac{f'(x)g(x) - f(x)g'(x)}{g^2(x)}$$
In this case, $\;f'(x) = e^z + e^{-z} = g(x),\;$ and $\;g'(x) = e^z - e^{-z} = f(x),\;$  so we get that the derivative  $$\frac{d}{dx}\left(\frac{f(x)}{g(x)}\right) = \frac{g^2 (x) - f^2(x)}{g^2(x)} = 1 - \dfrac{f^2(x)}{g^2(x)} = 1-\dfrac{(e^z-e^{-z})^2}{(e^{z}+e^{-z})^2}$$
A: As $$\frac{e^z-e^{-z}}{e^z+e^{-z}}=\frac{e^{2z}-1}{e^{2z}+1}=1-\frac2{e^{2z}+1}$$
$$\frac{d}{dz}\left(\frac{e^z-e^{-z}}{e^z+e^{-z}}\right)$$
$$=-2\frac{d}{dz}\left(\frac1{e^{2z}+1}\right)$$
$$=-2\frac{2e^{2z}}{-(e^{2z}+1)^2}=\frac{4e^{2z}}{(e^{2z}+1)^2}$$
$$=\frac{(e^{2z}+1)^2-(e^{2z}-1)^2}{(e^{2z}+1)^2}\text{ using } 4ab=(a+b)^2-(a-b)^2$$
$$=1-(\frac{e^{2z}-1)^2}{(e^{2z}+1)^2}=1-\dfrac{(e^z-e^{-z})^2}{(e^{z}+e^{-z})^2}$$ dividing the numerator & the denominator by $e^{2z}\ne0$
