Find f'(a).

f(x)= (x^2 + 1)/(x - 2)

So,

[[(a + h)^2 + 1]/[(a + h) - 2]] - [(a^2 + 1)/a - 2] and the whole thing divided by h

I tried simplifying it and ended up with [a + h/-2] - (a-2), which is incorrect. I used wolfram alpha and got (a^2 - 4a - 1)/(a - 2)^2 but I do not know how to get this. Please help.

numerator

(a^2+2ah+h^2+1)(a-2) -(a^2+1)(a+h-2)

a^3+2a^2h+ah^2+a-2a^2-4ah-2h^2-2 -a^3-a-a^2h-h+2a^2+2

that is
a^2h + ah^2 -4ah -h

divide numerator by h
a^2 +ah -4a -1
let h-->0
a^2-4a-1 sure enough now denominator
(a-2)(a+h-2)
let h-->0
(a-2)^2 sure enough