# Numerical Methods: Numerical Differentiation

• Feb 25th 2009, 02:20 AM
zeugma
Numerical Methods: Numerical Differentiation
Hi everyone. I have a homework on numerical differentiation and I just want to know if my answers are correct.

1.) The partial derivative, $\displaystyle f_x(x,y)$ of $\displaystyle f(x,y)$ with respect to x is obtained by holding y fixed and differentiating with respect to x. Similarly, $\displaystyle f_y(x,y)$ is found by holding x fixed and differentiating with respect to y. The equation below is adapted to partial derivatives:

$\displaystyle f_x(x,y) =\frac{f(x+h,y) - f(x-h,y)}{2h}+O(h^2)$
$\displaystyle f_y(x,y) =\frac{f(x,y+h) - f(x,y-h)}{2h}+O(h^2)$

[The two equations above are denoted as equation (i)]

(a). Let $\displaystyle f(x,y)=\frac{xy}{(x+y)}$. Calculate the approximations to $\displaystyle f_x(2,3)$ and $\displaystyle f_y(2,3)$ using the formulas in (i) with h = 0.1, 0.01, and 0.001. Compare with the values obtained by differentiating $\displaystyle f(x,y).$

First, I solved for the derivative of $\displaystyle f(x,y)$ with respect to x. I got:
$\displaystyle f_x(x,y)=\frac{y(x+y)-xy^2}{(x+y)^2}=\frac{3(2+3)-2(3)^2}{(2+3)^2}=-0.12$

Solving for $\displaystyle f_x(x,y)$ using equation (i)
h_____$\displaystyle f(2+h,3)$_$\displaystyle f(2-h,3)$_____2h______$\displaystyle f_x(2,3)$
0.1_____1.23529____1.16327____0.20000___0.36014
0.01____1.20359____1.19639____0.20000___0.36000
0.001___1.20036____1.19964____0.20000___0.36000

Solving for $\displaystyle f_y(x,y)$
Derivative with respect to y: $\displaystyle f_y(x,y)=\frac{x(x+y)-yx^2}{(x+y)^2}=\frac{2(2+3)-3(2)^2}{(2+3)^2}=-0.08$

Solving for $\displaystyle f_y(x,y)$ using equation (i)
h_____$\displaystyle f(2,3+h)$_$\displaystyle f(2,3-h)$_____2h______$\displaystyle f_y(2,3)$
0.1_____1.21569____1.18367____0.20000___0.16006
0.01____1.20160____1.19840____0.20000___0.16000
0.001___1.20016____1.19984____0.20000___0.16000

Am I doing this right??

================================================== =======
2.) The distance $\displaystyle D = D(t)$ traveled by an object is given in the table below:

_t_____D(t)
8.0___17.453
9.0___21.460
10.0__25.752
11.0__30.301
12.0__35.084

(a) Find the velocity $\displaystyle V(10)$ by numerical differentiation
(b) Compare your answer with $\displaystyle D(t)=-70+7t+70e^\frac{-t}{10}$.

$\displaystyle V(10)=\frac{D(11.0)-D(9.0)}{11.0-9.0}=4.421$
(b). $\displaystyle D(t)=-70+7t+70e^(-t/10)=-70+7(10.0)+70e^\frac{-10.0}{10}=25.752$.
$\displaystyle V(10)=\frac{D(10.0)}{10.0}=\frac{25.752}{10.0}=2.5 752$