As the title says, I've been trying to define a function this way:
f[a_, b_, c_, d_] :=
Max[rootsFinal[[1]] /. a1 -> a /. b1 -> b /. c1 -> c, d1-> d];
here rootsFinal[[1]] is a list that contains rational expressions in $a,b,c,d$. The definition seems to succeed, but when I try to call
f[1,1,1,1]
I get the error
"Part specification rootsFinal[[1]] is longer than depth of object"