kill(all)$

van=facebook.com/LearningCalculus$

P(a,b,c):=(a+b+c)/2$
A(k,a,b,c):=(k*a*b*c)$
B(k,a,b,c):=
    a*(P(a,b,c)-a)^2+
    b*(P(a,b,c)-b)^2+
    c*(P(a,b,c)-c)^2+
    2*  (P(a,b,c)-a)*
        (P(a,b,c)-b)*
        (P(a,b,c)-c)$

f(k,a,b,c):=A(k,a,b,c)/B(k,a,b,c)$ f(k,a,b,c);

fullratsimp(%);

fullratsimp(f(2017,a,b,c));

f(1,x,y,z);

fullratsimp(%);