a_0:=y_i; a_1:= y_ip - y_i; a_2:= y_ip - y_i - hyp_i; b:= hyp_ip - y_ip + y_i; a_3 := hyp_ip + hyp_i - 2*y_ip + 2*y_i; Q_i:=t->a_0+(a_1+(a_2+a_3*t)*(t-1))*t; collect(expand(Q_i(t)),[y_i,hyp_i,y_ip,hy_ip]);