Let $f(x)$ be a continuous and differentiable function such that $f(-1)=-2,f(0)=-1,f(1)=0,f(2)=1,f(3)=0,f(4)=-1$ and $f(5)=1$.Then what is the minimum number of roots of $g(x)=f'(x)+xf''(x)=0$, in the interval $[-1,5]$.
Any hint or clue will be appreciated.
Assume $f$ is twice differentiable.
By mean value theorem, $f'(x)=1$ for some $x\in (-1, 0), (0, 1), (1, 2)$ and $f'(x)=-1$ for some $x\in (2,3), (3,4)$.
Therefore if we draw the graph oh $f'$, then the graph should pass through at least one of the red dots, and one of the blue dots, and so on.
Multiply these colored dots by $x$, so that $xf'(x)$ should pass through these colored dots once for each color.
(I forgot to mark the $x$-axis. It was $-1, 0, 1,2,3,4$)
Now we can see that $(xf'(x))'$ must be zero at least once, since $xf'(x)$ should achieve a local maximum between $0$ and $3$. (inspired by your words)
But I didn't proved that such $xf'(x)$ has a corresponding $f$ that satisfies the specification.