# Numeric Differentiation of Analytic funtion

Can anyone validate if my understanding regarding numeric differentiation is correct??

$z = f(x,y)$ is an analytic function. $$\frac{\partial z}{\partial x} = \frac{f(x+h,y)-f(x,y)}{h}$$ $$\frac{\partial z}{\partial y} = \frac{f(x,y+h)-f(x,y)}{h}$$

Thanks in advance...

-
The limit as h goes to 0 is the derivative on continuous functions. The way written above works well for discrete functions (aka x = 0,1,2,3.... and h=1). –  kaine Feb 5 '13 at 14:52

## 1 Answer

Numerically spoken you have

$$\frac{\partial z}{\partial x} \approx\frac{f(x+h,y)-f(x,y)}{h}$$ $$\frac{\partial z}{\partial y} \approx \frac{f(x,y+h)-f(x,y)}{h}$$

Note that there are different ways to approximate the derivative. The most common ones are forward, backward and central differences. $$\frac{\partial z}{\partial y} \approx \frac{f(x,y+h)-f(x,y)}{h}\approx \frac{f(x,y)-f(x,y-h)}{h}\approx \frac{f(x,y+h)-f(x,y-h)}{2h}$$

And if you take the limit you get $$\frac{\partial z}{\partial x} =\lim_{h\rightarrow 0}\frac{f(x+h,y)-f(x,y)}{h}$$ $$\frac{\partial z}{\partial y}= \lim_{h\rightarrow 0}\frac{f(x,y+h)-f(x,y)}{h}$$

-
So... for appropriately small h the equation I stated is correct.... –  user2043404 Feb 5 '13 at 16:30
Yes, even though it is rather $\approx$ than $=$. –  sonystarmap Feb 5 '13 at 16:39