You are mixing numerical functions with symbolic tools. The two do not mix that well.
So just pick ONE, and stay with it. For example...
gx = ((x.^4) -(1.75*x.^3)+(0.875*x.^2)-(0.125*x));
Now we can find the roots of the derivative function. The local maxima of the absolute value will lie at those roots.
groots = solve(dgdx,x,'maxdegree',3)
They are not very useful in that form, so convert them to floating point values
You can see tiny imaginary parts, but they are irrelevant. They are just floaitng point trash. Discard the imaginary parts.
Now, evaluate the function at those points, take the absolute value, and find the largest of the local maxima.
localmaxima = abs(subs(gx,x,groots))
Is this consistent with what we see in a plot?
gfun = matlabFunction(gx);
I never moved away from symbolic computations until the very end, when I wanted to plot it all.
Could you have solved this using tools like fminbnd? YES. But then you would work entirely in terms of numberical, double precision functions.