<em>f '</em> (0) exists if the limit,
![\displaystyle \lim_{h\to0}\frac{f(0+h)-f(0)}h](https://tex.z-dn.net/?f=%5Cdisplaystyle%20%5Clim_%7Bh%5Cto0%7D%5Cfrac%7Bf%280%2Bh%29-f%280%29%7Dh)
exists, and <em>f</em> <em>'</em> (0) has the value of this limit.
In order for this limit to exist, both limits from either side of <em>h</em> = 0 must exist.
Suppose <em>h</em> < 0. Then 0 + <em>h</em> is also negative, so by definition of <em>f(x)</em> we have
<em>f</em> (0 + <em>h</em>) = ((0 + <em>h</em>) + 1)² = <em>h</em> ² + 2<em>h</em> + 1
Then in the limit, if <em>h</em> is approaching 0, it must be from below or from the left:
![\displaystyle \lim_{h\to0^-}\frac{f(0+h)-f(0)}{h} = \lim_{h\to0^-}\frac{(h^2+2h+1)-1}{h} = \lim_{h\to0^-}(h+2) = 2](https://tex.z-dn.net/?f=%5Cdisplaystyle%20%5Clim_%7Bh%5Cto0%5E-%7D%5Cfrac%7Bf%280%2Bh%29-f%280%29%7D%7Bh%7D%20%3D%20%5Clim_%7Bh%5Cto0%5E-%7D%5Cfrac%7B%28h%5E2%2B2h%2B1%29-1%7D%7Bh%7D%20%3D%20%5Clim_%7Bh%5Cto0%5E-%7D%28h%2B2%29%20%3D%202)
Now suppose <em>h</em> > 0, so that 0 + <em>h</em> is positive and <em>h</em> approaches 0 from above or from the right. Then
<em>f</em> (0 + <em>h</em>) = 2 (0 + <em>h</em>) + 1 = 2<em>h</em> + 1
and
![\displaystyle \lim_{h\to0^+}\frac{f(0+h)-f(0)}h = \lim_{h\to0^+}\frac{(2h+1)-1}{h} = \lim_{h\to0^+}2 = 2](https://tex.z-dn.net/?f=%5Cdisplaystyle%20%5Clim_%7Bh%5Cto0%5E%2B%7D%5Cfrac%7Bf%280%2Bh%29-f%280%29%7Dh%20%3D%20%5Clim_%7Bh%5Cto0%5E%2B%7D%5Cfrac%7B%282h%2B1%29-1%7D%7Bh%7D%20%3D%20%5Clim_%7Bh%5Cto0%5E%2B%7D2%20%3D%202)
Both one-sided limits match, so <em>f '</em> (0) = 2.