kill(all)$

van=facebook.com/LearningCalculus$

F(a,s,t,x,y):= ((x-s)^a + (y-s)^a)*(x^a+(y-t)^a)*((x-t^a)+y^a) ;

count:0$
hits:0$
flist:[]$
for a: 1 thru 2 do
    for s: 0 thru 2 do
        for t: 0 thru 2 do
            (
                count: count+1,
                if
                    (
                        is(equal(F(a,s,t,x,y),F(a,s,t,y,x)))
                        and
                        is(equal(F(a,s,t,s,s),0))
                        and
                        is(equal(F(a,s,t,0,t),0))
                    )
                    then
                    (
                        hits: hits+1,
                        flist: endcons(F(a,s,t,x,y),flist)
                    )
            );
print("Answer ", hits, " hits out of  ", count, " candidates examined.")$

flist;

P:[[x],[y],[z],[1]];

zRotate(theta):=matrix(
                 [cos(theta),-sin(theta), 0, 0],
                 [sin(theta), cos(theta), 0, 0],
                 [0,           0,         1, 0],
                 [0,           0,         0, 1]);

Pprime:zRotate(theta).P;

xprime(theta):=''(first(Pprime[1][1]));
yprime(theta):=''(first(Pprime[2][1]));

f1(x,y):=''(flist[1]);

g1(theta):=''(f1(xprime(theta),yprime(theta)));

g1(%pi/4);

subst(xprime(theta),x,flist[1]);