I was reading <http://www.idav.ucdavis.edu/education/CAGDNotes/Bernstein-Polynomials/Bernstein-Polynomials.html>, the section on the derivative, which gives the derivative for a Bezier curve as:


$B\_{k,n}(t) \frac{d}{dt} = n \left ( B\_{k-1,n-1}(t) - B\_{k,n-1}(t)\right )$


which it then shows the derivation steps for:


$B\_{k,n}(t) \frac{d}{dt} = {n \choose k} t^k (1-t)^{n-k} \frac{d}{dt}$


... = $\frac{kn!}{k!(n-k)!} t^{k-1} (1-t)^{n-k} + \frac{(n-k)n!}{k!(n-k)!} t^k (1-t)^{n-1-k}$


... = $\frac{kn!}{k!(n-k)!} t^{k-1} (1-t)^{n-k} + \frac{n(n-1)!}{k!(n-1-k)!} t^k (1-t)^{n-1-k}$


... = $\frac{n(n-1)!}{(k-1)!(n-k)!} t^{k-1} (1-t)^{n-k} + \frac{n(n-1)!}{k!(n-1-k)!} t^k (1-t)^{n-1-k}$


... = $n \left (\frac{(n-1)!}{(k-1)!(n-k)!} t^{k-1} (1-t)^{n-k} + \frac{(n-1)!}{k!(n-1-k)!} t^k (1-t)^{n-1-k} \right ) $


... = $n \left ( B\_{k-1,n-1}(t) - B\_{k,n-1}(t) \right )$


How does this last step go from $(term+term)$ to $(term-term)$? As far as I can tell, the two terms directly map to the lower order Bezier curves, so how does that plus sign turn into a minus?


Doing the steps in between the last and single-to-last, I get this:


... = $n \left (\frac{(n-1)!}{(k-1)!(n-k)!} t^{k-1} (1-t)^{n-k} + \frac{(n-1)!}{k!((n-1)-k)!} t^k (1-t)^{(n-1)-k} \right ) $


... = $ n \left ( \frac{(n-1)!}{(k-1)!(n-k)!} t^{k-1} (1-t)^{n-k} + B\_{k,n-1}(t) \right ) $


... = $ n \left ( \frac{(n-1)!}{(k-1)!((n-1)-(k-1))!} t^{k-1} (1-t)^{(n-1)-(k-1)} + B\_{k,n-1}(t) \right ) $


... = $ n \left ( B\_{k-1,n-1}(t) + B\_{k,n-1}(t) \right ) $


Since the two terms map directly to the lower order Bezier functions, why does the sign flip?



Deriving the rule for direct differentiating Bezier functions
The minus sign should be in the second line, due to the chain rule:


$B\_{k,n}(t) \frac{d}{dt} = {n \choose k} t^k (1-t)^{n-k} \frac{d}{dt}$


... = ${n \choose k} \cdot f(t) g(t) \frac{d}{dt} $


... = ${n \choose k} \cdot \left ( f'(t) g(t) + f(t)g'(t) \right )$


Due to the chain rule applying to $g(t)$, its derivative is:


$g'(t) = (n-k) \cdot (1-t)^{(n-k)-1} \cdot \left ( (1-t) \frac{d}{dt} \right ) $


$... = (n-k) \cdot (1-t)^{(n-k)-1} \cdot -1 $


thus:


$f(g)g'(t) = - (n-k) \cdot t^k \cdot (1-t)^{(n-k)-1}$


and thus:


$B\_{k,n}(t) \frac{d}{dt} = {n \choose k} \left ( k \cdot t^{k-1} (1-t)^{n-k} - (n-k) \cdot t^k \cdot (1-t)^{(n-k)-1} \right )$


which means there is a minus sign, rather than a plus sign, for the rest of the derivation.


