Example 3.34. Functions $u$ and $v$ of independent variables $x$ and $y$ are given by the system of equations

$$
\left\{\begin{array}{l}
x u - y v - 1 = 0 \\
x - y + u - v = 0
\end{array}\right.
$$

Find $d u, d v, u_{x}^{\prime}, u_{y}^{\prime}, v_{x}^{\prime}, v_{y}^{\prime}, d^{2} u$.
Solution. According to the condition,

$$
F(x, y, u, v)=x u-y v-1=0, G(x, y, u, v)=x-y+u-v=0
$$

Differentiating, we get $\left\{\begin{array}{l}d \hat{F}=u d x-v d y+x d u-y d v=0 \\ d G=d x-d y+d u-d v=0\end{array}\right.$

The Jacobian $J(u, v)=\left|\begin{array}{ll}x & -y \\ 1 & -1\end{array}\right|=-x+y$ is non-zero when $x \neq y$, and the above system can be solved for $d u$ and $d v$. Solving the indicated system using Cramer's rule, we get:

$$
\begin{aligned}
d u & =\frac{\left|\begin{array}{cc}
-u d x+v d y & -y \\
d y-d x & -1
\end{array}\right|}{\left|\begin{array}{ll}
x-y \\
1 & -1
\end{array}\right|}=\frac{(u-y) d y+(y-v) d y}{y-x} \\
d v & =\frac{\left|\begin{array}{cc}
x-u d x+v d y \\
1 & d y-d x
\end{array}\right|}{\left|\begin{array}{ll}
x-y \\
1 & -1
\end{array}\right|}=\frac{(u-x) d x+(x-v) d y}{y-x}
\end{aligned}
$$

From which it follows that $u_{x}^{\prime}=\frac{u-y}{y-x}, u_{y}^{\prime}=\frac{y-v}{y-x}, v_{x}^{\prime}=\frac{u-x}{y-x}$, $v_{y}^{\prime}=\frac{x-v}{y-x}$

Next, we find

$$
\begin{aligned}
& d^{2} u=d(d u)=d\left(\frac{u-y}{y-x} d x+\frac{y-v}{y-x} d y\right)= \\
& =\frac{(y-x) d(y-u)+(y-u) d(y-x)}{(y-x)^{2}} d x+ \\
& \quad+\frac{(y-x) d(y-v)-(y-v) d(y-x)}{(y-x)^{2}} d y= \\
& =\frac{(y-x)(d y-d u)+(y-u)(d y-d x)}{(y-x)^{2}} d x+ \\
& \quad+\frac{(y-x)(d y-d v)-(y-v)(d y-d x)}{(y-x)^{2}} d y
\end{aligned}
$$

Then substitute the expressions already obtained for $d u$ and $d v$ into the expression for $d^{2} u$

$$
\begin{aligned}
& d^{2} u=\frac{(y-x)\left(d y-\frac{(y-u) d x+(y-v) d y}{y-x}\right)+(y-u)(d y-d x)}{(y-x)^{2}} d x+ \\
& +\frac{(y-x)\left(d y-\frac{(u-x) d x+(x-v) d y}{y-x}\right)-(y-v)(d y-d x)}{(y-x)^{2}} d y=
\end{aligned}
$$

$$
\begin{gathered}
=\frac{(y-x)\left(\frac{u-y}{y-x} d x+\frac{v-x}{y-x} d y\right)+(y-u)(d y-d x)}{(y-x)^{2}} d x+ \\
+\frac{(y-x)\left(\frac{x-u}{y-x} d x+\frac{v-2 x+y}{y-x} d y\right)-(y-u)(d y-d x)}{(y-x)^{2}} d y= \\
=\frac{2(u-y) d x+(x+y-v-u) d y}{(y-x)^{2}} d x+ \\
+\frac{(x+y-v-u) d x+2(v+y-x) d y}{(y-x)^{2}} d y= \\
=2 \frac{u-y}{(y-x)^{2}} d x^{2}+2 \frac{(x+y-v-u)}{(y-x)^{2}} d x d y+2 \frac{v-x}{(y-x)^{2}} d y^{2} . \\
\text { DERIVATIVE IN DIRECTION } \\
\text { AND GRADIENT OF A FUNCTION }
\end{gathered}
$$

## 3.5.  DERIVATIVE IN DIRECTION AND GRADIENT OF A FUNCTION

Let the function $f\left(x_{1}, x_{2}, \ldots, x_{n}\right)$ be defined in some $\delta$-neighborhood of the point $P_{0}\left(x_{1}^{0}, x_{2}^{0}, \ldots, x_{n}^{0}\right) \in E^{n}$ and let $\ell$ be a unit vector in $E^{n}$ with coordinates $\ell_{i}=\cos \alpha_{i},(i=1,2, \ldots, n)$, $\alpha_{i}$ - angles between the vector $\ell$ and the positive direction of the coordinate axis $O x^{i}$. Then the limit

$$
\begin{aligned}
& \lim _{k \rightarrow 0} \frac{1}{k}\left(f\left(x_{1}^{0}+k \ell_{1}, x_{2}^{0}+k \ell_{2}, \ldots, x_{n}^{0}+k \ell_{n}\right)-\right. \\
& \left.-f\left(x_{1}^{0}, x_{2}^{0}, \ldots, x_{n}^{0}\right)\right)=\frac{\partial f\left(P_{0}\right)}{\partial \ell}
\end{aligned}
$$

(if it exists) is called the derivative of the function $f\left(x_{1}, x_{2}, \ldots, x_{n}\right)$ at the point $P_{0}$ in the direction $\ell$.

If the function $f\left(x_{1}, x_{2}, \ldots, x_{n}\right)$ is differentiable at the point $P_{0}$, then for the directional derivative, the formula

$$
\frac{\partial f}{\partial \ell}=\sum_{k=1}^{n} \frac{\partial f\left(P_{0}\right)}{\partial x_{k}} \cos \alpha_{k}
$$

holds.

Note that the directional derivative characterizes the rate of change of the function in the given direction.

The right-hand side of equation (3.26) can be considered as the dot product of the vector $\ell$ and the vector with coordinates $f_{x_{1}}^{\prime}, f_{x_{2}}^{\prime}, \ldots, f_{x_{n}}^{\prime}$. The latter is called the gradient of the function $f\left(x_{1}, x_{2}, \ldots, x_{n}\right)$ at the point $P_{0}$ and is denoted by $\operatorname{grad} f\left(P_{0}\right)$. Thus,

$$
\begin{aligned}
& \operatorname{grad} f\left(P_{0}\right)=\left(f_{x_{1}}^{\prime}\left(P_{0}\right), f_{x_{2}}^{\prime}\left(P_{0}\right), \ldots, f_{x_{n}}^{\prime}\left(P_{0}\right)\right) \\
& \frac{\partial f}{\partial \ell}=\operatorname{grad} f\left(P_{0}\right) \cdot \vec{\ell}=\Pi_{\vec{\ell}} \operatorname{grad} f\left(P_{0}\right)= \\
& \quad=\left|\operatorname{grad} f\left(P_{0}\right)\right| \cos \left(\angle \operatorname{grad} f\left(P_{0}\right), \vec{\ell}\right)
\end{aligned}
$$

The vector $\operatorname{grad} f\left(P_{0}\right)$ is collinear with the normal vector (see later) to the level surface $S: f\left(x_{1}, x_{2}, \ldots, x_{n}\right)=$ const, passing through the point $P_{0}$. Therefore, for any vector $\vec{\ell}$ tangent to the level surface, the equality

$$
\frac{\partial f\left(P_{0}\right)}{\partial \ell}=\operatorname{grad} f\left(P_{0}\right) \cdot \vec{\ell}=0, P_{0} \in S
$$

holds.

From relations (3.27) and (3.28), it follows that: 1) the gradient of the function $f$ is perpendicular to the level surface; 2) the direction of the gradient of the function $f$ at a given point $P_{0}$ is the direction of the most rapid increase of the function (i.e., the direction of the greatest directional derivative, which occurs when $\cos \left(\angle \operatorname{grad} f\left(P_{0}\right), \vec{\ell}\right)=1$).

In the case of a function of three variables $u=f(x, y, z)$, the directional derivative in the direction $\ell=\{\cos \alpha, \cos \beta, \cos \gamma\}$ and the gradient of the function are defined by the expressions:

$$
\begin{gathered}
\frac{\partial u}{\partial \ell}=\frac{\partial f}{\partial x} \cos \alpha+\frac{\partial f}{\partial y} \cos \beta+\frac{\partial f}{\partial z} \cos \gamma \\
\quad \operatorname{grad} u=\frac{\partial f}{\partial x} \vec{i}+\frac{\partial f}{\partial y} \vec{j}+\frac{\partial f}{\partial z} \vec{k}
\end{gathered}
$$

If $f(P)$ and $g(P)$ are differentiable functions of their arguments and $C=$ const, then the following relations hold:

$$
\begin{gathered}
\operatorname{grad}(f+g)=\operatorname{grad} f+\operatorname{grad} g, \operatorname{grad}(C+f)=\operatorname{grad} f \\
\operatorname{grad}(C f)=C \operatorname{grad} f, \operatorname{grad}(f g)=g \operatorname{grad} f+f \operatorname{grad} g \\
\operatorname{grad}\left(f^{n}\right)=n f^{n-1} \operatorname{grad} f