1

I have

$$ h_\theta(x) = \frac 1 {1+e^{-\theta x}} $$

I need to get $ \frac d {d\theta} h_\theta(x) $. Here is my work.

$$\begin{eqnarray} \frac d {d\theta} h_\theta(x) &=& \frac d {d\theta} (1 + e^{-\theta x})^{-1} \\ &=& -(1 + e^{-\theta x})^{-2} \cdot \frac d {d\theta} (1 + e^{-\theta x}) \\ &=& -(1 + e^{-\theta x})^{-2} \cdot \left[ 0 + \frac d {d \theta} e^{-\theta x} \right] \\ &=& -(1 + e^{-\theta x})^{-2} \cdot e^{-\theta x} \cdot \frac d {d \theta} (-\theta x) \\ &=& \left[ \frac 1 {1 + e^{-\theta x}} \right]^2 \cdot e^{-\theta x} \cdot x \\ &=& \left[ h_\theta(x) \right]^2 \cdot \frac x {e^{\theta x}} \end{eqnarray}$$

David S.
  • 269

2 Answers2

3

Looks good. After the second $=$ sign, though, change $\theta x$ to $d\theta$. Here are a few more exercises that you might like to try: $$\dfrac{\mathrm{d}}{\mathrm{d}x}\left(\dfrac{1}{\ln(e^{x}+1)}\right)\quad \dfrac{\mathrm{d}}{\mathrm{d}x}\left(\dfrac{1}{\ln(e^{x})+\ln 1}\right)\\ \dfrac{\mathrm{d}}{\mathrm{d}x}\left(\ln(x\ln (x\ln x))\right)\quad \dfrac{\mathrm{d}}{\mathrm{d}x}\left(x!\right)$$ Also, try finding a formula for $\dfrac{\mathrm{d}^n}{\mathrm{d}x^n}\left(x!\right)$ for an arbitrary integer $n$ by noticing a pattern.

0

Hint

There is also a useful trick : logarithmic differentiation. Since $$h = \frac 1 {1+e^{-\theta x}}$$ $$\log(h)=-\log({1+e^{-\theta x}})$$ Then $$\frac {1}{h}\frac {dh}{d\theta}=-\frac{({1+e^{-\theta x}})'}{({1+e^{-\theta x}})}=\frac{x e^{-\theta x}}{({1+e^{-\theta x}})}$$ and then your result.