How does $ht^{h-1}(1-t)^{n-h}+t^h (n-h)(1-t)^{n-h-1}(-1)$ become $t^{h-1}(1-t)^{n-h-1}\left[h(1-t)-(n-h)t\right]$?

39 Views Asked by At

I'm not sure how to get from the first line to the simplified second line. Equations are from Charles Elkan's notes here: http://cseweb.ucsd.edu/~elkan/250Bwinter2012/logreg.pdf

$$ \begin{split} \frac{d}{d\theta} \theta^h (1-\theta)^{n-h} &= h \theta^{h-1} (1-\theta)^{n-h} + \theta^h (n-h)(1- \theta)^{n-h-1}(-1)\\ &= \theta^{h-1} (1-\theta)^{n-h-1} \left[ h(1-\theta)- (n-h)\theta \right] \end{split} $$

1

There are 1 best solutions below

0
On

Notice that $(1-\theta)^{n-h} = (1-\theta)\cdot(1-\theta)^{n-h-1}$ and $\theta^h = \theta \cdot\theta^{h-1}$. The common factor of the two terms on the right hand side of the first equation is $\theta^{h-1}\cdot(1-\theta)^{n-h-1}$, so he extracts it (as suggested in the comments).