(a^2-1)X^2-(a+1)X+8=0是一元一次方程,
(a^2-1)=0,a+1≠0,
解得:a=1,
方程就是:-2X+8=0,
X=4,
∴原式=(a+X)(X-2a)+3a+4
=5×2+3+4
=17.