kill(all)$

van=facebook.com/LearningCalculus$

f(x,a,b):=x*(x-a)*(x-b);

fp(x,a,b):=''((diff(f(x,a,b),x)));

max:4$

print("x", "a", "b")$
for x:0 thru max do
    for a:0 thru max do
        for b:0 thru max do
        (
            t:sqrt(f(x,a,b)),
            u:fp(x,a,b),
            v:2*t,
            if t > 0 and integerp(t) and integerp(u) and integerp(v) then
                if integerp(u/v) then
                    print(x, a, b)
        )$