kill(all)$

f(a,b):=a/b+b/a+1=0;

s:solve(f(a,b),a);

a_div_b:rhs(first(s)/b);

b_div_a:1/a_div_b;

fullratsimp(a_div_b+b_div_a+1);

fullratsimp(a_div_b^2016+b_div_a^2016 + 1);

a_div_b:rhs(second(s)/b);

b_div_a:1/a_div_b;

a_div_b+b_div_a;

fullratsimp(a_div_b+b_div_a+1);

fullratsimp(a_div_b^2016+b_div_a^2016 + 1);