Manipulate[
Show[
Plot[Evaluate[f0[x]],{x,-2,2},PlotRange->2,Axes->True,PlotStyle->{Red,Thickness[0.01]}],
Table[Plot[Evaluate[derivaltak[[n]][x]],{x,-2,2},PlotStyle->szinek[[n]]],{n,dmutat}],
Graphics[{Darker[Red],PointSize[0.03],Table[Point[p[pts[[i]]]],{i,1,4}]},
],ImageSize->Large],
{pts,Locator,Appearance->None},{{dmutat,{},""},{1->Style["f'",Large,szinek[[1]]],2->Style["f''",Large,szinek[[2]]],3->Style["f'''",Large,szinek[[3]]]},TogglerBar},
Initialization:>(
pts={{-1,0},{0,0},{1,0},{2,0}};
szinek={Blue,Darker[Green],Orange};
p:={#[[1]],0}&;
f0:=Function[x,Product[(x-pts[[i]][[1]]),{i,1,4}]];
derivaltak:=Table[Function[x,Derivative[n][f0][x]],{n,1,3}]
)
]

f[x_]:=x^5+x^4-5x^3-x^2+8x-4

f'[x]

PolynomialGCD[f[x],f'[x]]

PolynomialQuotient[f[x],%,x]

f[x_]:=3x^4-4x^3+1

f'[x]

PolynomialGCD[f[x],f'[x]]

PolynomialQuotient[f[x],%,x]