Directional detivative.Why i am getting different answers? My function is $f(x,y,z)=xarctan(yz)$.
I want to calculate the directional derivative of $f$ in the point $a=(1,1,1)$ in the direct of the vector $u=(-1/\sqrt{2},1/\sqrt{2},0)$.
So there's two ways here.
Using the Gradient formula:
$\frac{df}{du}(a)=\gradient(f)(a) u$.
This gives $\frac{-\pi}{4\sqrt{2}}+\frac{1}{2\sqrt{2}}$
But, when calculating it using the definition of directional derivative i got a different number!
 A: $\vec u = (-\frac{1}{\sqrt2},\frac{1}{\sqrt2},0)$ is a unit vector.
So the directional derivative is,
$\begin{align}D_{\vec u}f(x,y,z) &= \color{blue}{\lim_{h\to0}\frac{f(x-\frac1{\sqrt2}h,y+\frac1{\sqrt2}h,z)-f(x,y,z)}{h}}\\
&=\lim_{h\to0}\frac{(x-\frac h{\sqrt2})\arctan((y+\frac h{\sqrt2})z) - x\arctan(yz)}{h}\\
&=\lim_{h\to0}\frac{x\left[\arctan(yz+\frac {hz}{\sqrt2}) - \arctan(yz)\right]}{h}-\lim_{h\to0}\frac{\arctan(yz+\frac {hz}{\sqrt2}) }{\sqrt2} \\
&=x\lim_{h\to0}\frac{\arctan\left(\frac{\Large\frac{hz}{\sqrt2}}{1+y^2z^2+\Large{\frac{yz^2h}{\sqrt2}}}\right)}{\frac{\Large\frac{hz}{\sqrt2}}{1+y^2z^2+\Large{\frac{yz^2h}{\sqrt2}}}}\times\frac{\frac{z}{\sqrt2}}{1+y^2z^2+{\frac{yz^2h}{\sqrt2}}} - \frac{\arctan(yz)}{\sqrt2}  \\
&=x\left(1\times\frac{\frac{z}{\sqrt2}}{1+y^2z^2}\right)-\frac{\arctan(yz)}{\sqrt2}\end{align}$
At the given point$(1,1,1)$ we get,
$$\boxed{D_{\vec u}f(1,1,1) = \frac{\frac1{\sqrt2}}{1+1}- \frac1{\sqrt2}\times\frac\pi4 = -\frac{\pi}{4\sqrt2}+\frac{1}{2\sqrt2}}$$
as the same result
