f(x) = x^2 +2
We need to use the definition of derivative
The first step is to find f(x+h)
f(x+h) = ( x+h)^2 + 2(x+h)
FOILing and distributing the second term
= x^2 + 2xh + h^2 + 2x + 2h
Now we subtract f(x) from this
f(x+h) - f(x) = x^2 + 2xh + h^2 + 2x + 2h - ( x^2 + 2x)
Distribute the minus sign and subtract like terms
= x^2 + 2xh + h^2 + 2x + 2h - x^2 - 2x
= 2xh + h^2 + 2h
Now this term is the numerator of the definition and we divide by h
As h goes to 0 the second term goes to zero and we are left with
2x+2