TITLE: Differentiating the function $x^3\cdot\min\{x,9\}$
QUESTION [5 upvotes]: Today I came across the function $x^3\cdot \min\{x,9\}$.
My teacher differentiated it and wrote it directly again as $3x^2\cdot\min\{x,9\}$
I was wondering how come the $\min\{x,9\}$ part is not affected by differentiation. Any ideas please? Or am I missing something pretty obvious?

REPLY [2 votes]: Another way of looking at the mistake made by your teacher is that he forgot how to differentiate the product of two functions. The derivative of the first factor $f(x)=x^3$ is, indeed, $f'(x)=3x^2$, but the derivative of the second factor $g(x)=\min\{x,9\}$ is $g'(x)=1,$ if $x<9$, and $g'(x)=0$, if $x>9$. As others have pointed out, $g(x)$ is not differentiable at the point $x=9$. The correct derivative is thus
$$
\frac d{dx}\,\big(f(x)g(x)\big)=f'(x)g(x)+f(x)g'(x),
$$
wherever the two derivatives both exist.
It is, of course, an easy exercise to verify that this formula coincides with the answer David Mitra gave.