5.2.2. Find the gradient and the directional derivative in the direction $\bar{a}=4 \bar{i}-2 \bar{j}$ of the function $z=\ln \left(4 x^{2}+2 y^{2}\right)$ at the point $A(-2 ; 4)$.
Solution. The gradient of the function $z=f(x, y)$ is:

$$
\overline{\operatorname{grad}} z=\frac{\partial z}{\partial x} \bar{l}+\frac{\partial z}{\partial y} \cdot \bar{j}
$$

Let's find the partial derivatives:

$$
\begin{gathered}
\frac{\partial z}{\partial x}=\left(\ln \left(4 x^{2}+2 y^{2}\right)\right)_{x}=\frac{1}{4 x^{2}+2 y^{2}} \cdot\left(4 x^{2}+2 y^{2}\right)_{x}=\frac{8 x}{4 x^{2}+2 y^{2}}=\frac{4 x}{2 x^{2}+y^{2}} \\
\frac{\partial z}{\partial y}=\left(\ln \left(4 x^{2}+2 y^{2}\right)\right)_{y}=\frac{1}{4 x^{2}+2 y^{2}} \cdot\left(4 x^{2}+2 y^{2}\right)_{y} \frac{2 \cdot 2 y}{4 x^{2}+2 y^{2}}=\frac{2 y}{2 x^{2}+y^{2}}
\end{gathered}
$$

and their values at point $A(-2 ; 4)$ :

$$
\frac{\partial z}{\partial x}_{A}=\frac{4(-2)}{2(-2)^{2}+4^{2}}=-\frac{1}{3} ; \quad \quad_{\partial z}^{\partial y} \quad=\frac{2 \cdot 4}{2(-2)^{2}+4^{2}}=\frac{1}{3} .
$$

Then the gradient at point $A$ is:

$$
(\overline{\operatorname{grad}} z)_{A}=-\frac{1}{3} \bar{\tau}+\frac{1}{3} \bar{j}
$$

The directional derivative of the function $z$ in the direction of vector $\bar{a}$ is calculated by the formula:

$$
\frac{\partial z}{\partial a}=\frac{\partial z}{\partial x} \cdot \cos \alpha+\frac{\partial z}{\partial y} \cdot \sin \alpha
$$

Let's find the directional cosine of vector $\bar{a}$ :

$$
\cos \alpha=\frac{4}{\sqrt{4^{2}+(-2)^{2}}}=\frac{4}{\sqrt{20}}=\frac{2}{\sqrt{5}}
$$

then

$$
\sin \alpha=\sqrt{1-\cos ^{2} \alpha}=\sqrt{1-\frac{2}{\sqrt{5}}^{2}}=\sqrt{1-\frac{4}{5}}=\frac{1}{\sqrt{5}}
$$

Therefore,

$$
\frac{\partial z}{\partial a}_{A}=-\frac{1}{3} \cdot \frac{2}{\sqrt{5}}+\frac{1}{3} \cdot \frac{1}{\sqrt{5}}=-\frac{1}{3 \sqrt{5}}=-\frac{\sqrt{5}}{15} .
$$