There must be something wrong in the post - perhaps the type setting. You are writing
f[x_]=4x-3x^3+x*4
This is different from what you said before, because the polynomial was:
4x-3x^3+x^4
Also to define a function you should use:
f[x_] :=4x-3x^3+x^4
so the delayed assignment ":=" instead of "=". Then you say
"D[f[x],x] gives 0, but D[f[x],x] gives the expected answer". That is the same (!!!) expression. How can it give two different answers?
I think that it would be easier if you attached the notebook. Small typos can make it difficult to find the error. I'll attach a notebook that does work.
M.
Attachments: