From school course Mathematicians know that a vector on a plane is a directed segment. Its beginning and end have two coordinates. The vector coordinates are calculated by subtracting the start coordinates from the end coordinates.

The concept of a vector can be extended to n-dimensional space (instead of two coordinates there will be n coordinates).

Gradient grad z of the function z = f(x 1, x 2, ...x n) is the vector of partial derivatives of the function at a point, i.e. vector with coordinates .

It can be proven that the gradient of a function characterizes the direction of the fastest growth of the level of a function at a point.

For example, for the function z = 2x 1 + x 2 (see Figure 5.8), the gradient at any point will have coordinates (2; 1). You can construct it on a plane in various ways, taking any point as the beginning of the vector. For example, you can connect point (0; 0) to point (2; 1), or point (1; 0) to point (3; 1), or point (0; 3) to point (2; 4), or so on. .p. (See Figure 5.8). All vectors constructed in this way will have coordinates (2 – 0; 1 – 0) =
= (3 – 1; 1 – 0) = (2 – 0; 4 – 3) = (2; 1).

From Figure 5.8 it is clearly seen that the level of the function increases in the direction of the gradient, since the constructed level lines correspond to the level values ​​4 > 3 > 2.

Figure 5.8 - Gradient of function z = 2x 1 + x 2

Let's consider another example - the function z = 1/(x 1 x 2). The gradient of this function will no longer always be the same at different points, since its coordinates are determined by the formulas (-1/(x 1 2 x 2); -1/(x 1 x 2 2)).

Figure 5.9 shows the level lines of the function z = 1/(x 1 x 2) for levels 2 and 10 (the straight line 1/(x 1 x 2) = 2 is indicated by a dotted line, and the straight line
1/(x 1 x 2) = 10 – solid line).

Figure 5.9 - Gradients of the function z = 1/(x 1 x 2) at various points

Take, for example, the point (0.5; 1) and calculate the gradient at this point: (-1/(0.5 2 *1); -1/(0.5*1 2)) = (-4; - 2). Note that the point (0.5; 1) lies on the level line 1/(x 1 x 2) = 2, because z = f(0.5; 1) = 1/(0.5*1) = 2. To depict the vector (-4; -2) in Figure 5.9, we connect the point (0.5; 1) with the point (-3.5; -1), because
(-3,5 – 0,5; -1 - 1) = (-4; -2).

Let's take another point on the same level line, for example, point (1; 0.5) (z = f(1; 0.5) = 1/(0.5*1) = 2). Let's calculate the gradient at this point
(-1/(1 2 *0.5); -1/(1*0.5 2)) = (-2; -4). To depict it in Figure 5.9, we connect the point (1; 0.5) with the point (-1; -3.5), because (-1 - 1; -3.5 - 0.5) = (-2; - 4).

Let's take another point on the same level line, but only now in a non-positive coordinate quarter. For example, point (-0.5; -1) (z = f(-0.5; -1) = 1/((-1)*(-0.5)) = 2). The gradient at this point will be equal to
(-1/((-0.5) 2 *(-1)); -1/((-0.5)*(-1) 2)) = (4; 2). Let's depict it in Figure 5.9 by connecting the point (-0.5; -1) with the point (3.5; 1), because (3.5 – (-0.5); 1 – (-1)) = (4 ; 2).

Concept directional derivative considered for functions of two and three variables. To understand the meaning of the directional derivative, you need to compare the derivatives by definition

Hence,

Now we can find the directional derivative of this function using its formula:

And now - homework. It gives a function of not three, but only two variables, but the direction vector is specified somewhat differently. So you'll have to repeat it again vector algebra .

Example 2. Find the derivative of a function at a point M0 (1; 2) in the direction of the vector, where M1 - point with coordinates (3; 0).

The vector specifying the direction of the derivative can also be given in the form as in the following example - in the form expansion in unit vectors of coordinate axes, but this is a familiar topic from the very beginning of vector algebra.

Example 3. Find the derivative of a function at the point M0 (1; 1; 1) in the direction of the vector.

Solution. Let's find the direction cosines of the vector

Let's find the partial derivatives of the function at the point M0 :

Therefore, we can find the directional derivative of this function using its formula:

.

Gradient function

Gradient of a function of several variables at a point M0 characterizes the direction of maximum growth of this function at the point M0 and the magnitude of this maximum growth.

How to find the gradient?

Need to determine a vector whose projections on the coordinate axes are the values partial derivatives, , this function at the corresponding point:

.

That is, it should work out representation of a vector by unit vectors of coordinate axes, in which the partial derivative corresponding to its axis is multiplied by each unit.

Lecture 15. “Differentiation of a function of several variables”

    Gradient of a function of two variables and directional derivative.

Definition. Gradient function

called a vector

.

As can be seen from the definition of the gradient of a function, the components of the gradient vector are the partial derivatives of the function.

Example. Calculate the gradient of a function

at point A(2,3).

Solution. Let's calculate the partial derivatives of the function.

In general, the function gradient has the form:

=

Let's substitute the coordinates of point A(2,3) into the partial derivative expressions

The gradient of the function at point A(2,3) has the form:

Similarly, we can define the concept of the gradient of a function of three variables:

Definition. Gradient function of three variables

called a vector

Otherwise, this vector can be written as follows:

Definition directional derivative.

Let a function of two variables be given

and an arbitrary vector

Let's consider the increment of this function taken along a given vector

Those. the vector is collinear with respect to the vector . Argument increment length

The derivative in a certain direction is the limit of the ratio of the increment of a function along a given direction to the length of the increment of the argument, when the length of the increment of the argument tends to 0.

Formula for calculating directional derivative.

Based on the definition of the gradient, the directional derivative of the function can be calculated as follows.

some vector. Vector with the same direction, but single let's call the length

The coordinates of this vector are calculated as follows:

From the definition of directional derivative, the directional derivative can be calculated using the following formula:

The right side of this formula is the scalar product of two vectors

Therefore, the directional derivative can be represented as the following formula:

Several important properties of the gradient vector follow from this formula.

The first property of the gradient follows from the obvious fact that the scalar product of two vectors takes highest value, when the vectors coincide in direction. The second property follows from the fact that the scalar product of perpendicular vectors is equal to zero. In addition, the first property implies the geometric meaning of the gradient - the gradient is a vector along the direction whose directional derivative is greatest. Since the directional derivative determines the tangent of the angle of inclination of the tangent to the surface of the function, the gradient is directed along the greatest inclination of the tangent.

Example 2. For a function (from example 1)

Calculate Directional Derivative

at point A(2,3).

Solution. To calculate the directional derivative, you need to calculate the gradient vector at the specified point and the unit direction vector (i.e., normalize the vector ).

The gradient vector was calculated in example 1:

We calculate the unit direction vector:

We calculate the derivative with respect to direction:

#2. Maximum and minimum functions of several variables.

Definition. Function

Has a maximum at a point (i.e. at and ), if

Definition. In exactly the same way they say that the function

Has a minimum at a point (i.e. at and ), if

for all points sufficiently close to the point and different from it.

The maximum and minimum of a function are called extrema of the function, i.e. they say that a function has an extremum at a given point if this function has a maximum or minimum at a given point.

For example, the function

Has an obvious minimum z = -1 at x = 1 and y = 2.

Has a maximum at the point at x = 0 and y = 0.

Theorem.(necessary conditions for an extremum).

If the function reaches an extremum at , then each first-order partial derivative of z either vanishes for these argument values ​​or does not exist.

Comment. This theorem is not sufficient for studying the question of extreme values ​​of a function. We can give examples of functions that have zero partial derivatives at some points, but do not have an extremum at these points.

Example. A function that has zero partial derivatives but no extremum.

In fact:

Sufficient conditions for an extremum.

Theorem. Let in some domain containing the point , the function has continuous partial derivatives up to the third order inclusive; Let, in addition, the point be a critical point of the function, i.e.

Then when ,

Example 3.2. Explore the maximum and minimum functions

    Let's find the critical points, i.e. points at which the first partial derivatives are zero or do not exist.

First, we calculate the partial derivatives themselves.

We equate the partial derivatives to zero and solve the following system of linear equations

Multiply the second equation by 2 and add it to the first. The result is an equation only in y.

We find and substitute into the first equation

Let's transform

Therefore, point () is critical.

    Let's calculate the second derivatives of the second order and substitute the coordinates of the critical point into them.

In our case, there is no need to substitute the values ​​of the critical points, since the second derivatives are numbers.

As a result we have:

Therefore, the found critical point, is an extremum point. Moreover, since

then this is the minimum point.

From the school mathematics course we know that a vector on a plane is a directed segment. Its beginning and end have two coordinates. The vector coordinates are calculated by subtracting the start coordinates from the end coordinates.

The concept of a vector can be extended to n-dimensional space (instead of two coordinates there will be n coordinates).

Gradient gradzfunctionz=f(x 1, x 2, ...x n) is the vector of partial derivatives of the function at a point, i.e. vector with coordinates.

It can be proven that the gradient of a function characterizes the direction of the fastest growth of the level of a function at a point.

For example, for the function z = 2x 1 + x 2 (see Figure 5.8), the gradient at any point will have coordinates (2; 1). You can construct it on a plane in various ways, taking any point as the beginning of the vector. For example, you can connect point (0; 0) to point (2; 1), or point (1; 0) to point (3; 1), or point (0; 3) to point (2; 4), or so on. .p. (See Figure 5.8). All vectors constructed in this way will have coordinates (2 – 0; 1 – 0) = = (3 – 1; 1 – 0) = (2 – 0; 4 – 3) = (2; 1).

From Figure 5.8 it is clearly seen that the level of the function increases in the direction of the gradient, since the constructed level lines correspond to the level values ​​4 > 3 > 2.

Figure 5.8 - Gradient of function z= 2x 1 + x 2

Let's consider another example - the function z = 1/(x 1 x 2). The gradient of this function will no longer always be the same at different points, since its coordinates are determined by the formulas (-1/(x 1 2 x 2); -1/(x 1 x 2 2)).

Figure 5.9 shows the function level lines z = 1/(x 1 x 2) for levels 2 and 10 (the straight line 1/(x 1 x 2) = 2 is indicated by a dotted line, and the straight line 1/(x 1 x 2) = 10 is solid line).

Figure 5.9 - Gradients of the function z= 1/(x 1 x 2) at various points

Take, for example, the point (0.5; 1) and calculate the gradient at this point: (-1/(0.5 2 *1); -1/(0.5*1 2)) = (-4; - 2). Note that the point (0.5; 1) lies on the level line 1/(x 1 x 2) = 2, because z=f(0.5; 1) = 1/(0.5*1) = 2. To draw the vector (-4; -2) in Figure 5.9, connect the point (0.5; 1) with the point (-3.5; -1), because (-3.5 – 0.5; -1 - 1) = (-4; -2).

Let's take another point on the same level line, for example, point (1; 0.5) (z=f(1; 0.5) = 1/(0.5*1) = 2). Let's calculate the gradient at this point (-1/(1 2 *0.5); -1/(1*0.5 2)) = (-2; -4). To depict it in Figure 5.9, we connect the point (1; 0.5) with the point (-1; -3.5), because (-1 - 1; -3.5 - 0.5) = (-2; - 4).

Let's take another point on the same level line, but only now in a non-positive coordinate quarter. For example, point (-0.5; -1) (z=f(-0.5; -1) = 1/((-1)*(-0.5)) = 2). The gradient at this point will be equal to (-1/((-0.5) 2 *(-1)); -1/((-0.5)*(-1) 2)) = (4; 2). Let's depict it in Figure 5.9 by connecting the point (-0.5; -1) with the point (3.5; 1), because (3.5 – (-0.5); 1 – (-1)) = (4 ; 2).

It should be noted that in all three cases considered, the gradient shows the direction of growth of the function level (towards the level line 1/(x 1 x 2) = 10 > 2).

It can be proven that the gradient is always perpendicular to the level line (level surface) passing through a given point.

Extrema of a function of several variables

Let's define the concept extremum for a function of many variables.

A function of many variables f(X) has at point X (0) maximum (minimum), if there is a neighborhood of this point such that for all points X from this neighborhood the inequalities f(X)f(X (0)) () are satisfied.

If these inequalities are satisfied as strict, then the extremum is called strong, and if not, then weak.

Note that the extremum defined in this way is local character, since these inequalities are satisfied only for a certain neighborhood of the extremum point.

A necessary condition for a local extremum of a differentiable function z=f(x 1, . . ., x n) at a point is the equality to zero of all first-order partial derivatives at this point:
.

The points at which these equalities hold are called stationary.

In another way, the necessary condition for an extremum can be formulated as follows: at the extremum point, the gradient is zero. A more general statement can also be proven: at the extremum point, the derivatives of the function in all directions vanish.

Stationary points should be subjected to additional research to determine whether sufficient conditions for the existence of a local extremum are met. To do this, determine the sign of the second order differential. If for any , not simultaneously equal to zero, it is always negative (positive), then the function has a maximum (minimum). If it can go to zero not only with zero increments, then the question of the extremum remains open. If it can take both positive and negative values, then there is no extremum at a stationary point.

In the general case, determining the sign of the differential is a rather complex problem, which we will not consider here. For a function of two variables, it can be proven that if at a stationary point
, then the extremum is present. In this case, the sign of the second differential coincides with the sign
, i.e. If
, then this is the maximum, and if
, then this is the minimum. If
, then there is no extremum at this point, and if
, then the question of the extremum remains open.

Example 1. Find the extrema of the function
.

Let's find partial derivatives using the logarithmic differentiation method.

ln z = ln 2 + ln (x + y) + ln (1 + xy) – ln (1 + x 2) – ln (1 + y 2)

Likewise
.

Let's find stationary points from the system of equations:

Thus, four stationary points have been found (1; 1), (1; -1), (-1; 1) and (-1; -1).

Let's find the second order partial derivatives:

ln (z x `) = ln 2 + ln (1 - x 2) -2ln (1 + x 2)

Likewise
;
.

Because
, expression sign
depends only on
. Note that in both of these derivatives the denominator is always positive, so you can only consider the sign of the numerator, or even the sign of the expressions x(x 2 – 3) and y(y 2 – 3). Let us define it at each critical point and check that the sufficient condition for the extremum is met.

For point (1; 1) we get 1*(1 2 – 3) = -2< 0. Т.к. произведение двух negative numbers
> 0, and
< 0, в точке (1; 1) можно найти максимум. Он равен
= 2*(1 + 1)*(1 +1*1)/((1 +1 2)*(1 +1 2)) = = 8/4 = 2.

For point (1; -1) we get 1*(1 2 – 3) = -2< 0 и (-1)*((-1) 2 – 3) = 2 >0. Because product of these numbers
< 0, в этой точке экстремума нет. Аналогично можно показать, что нет экстремума в точке (-1; 1).

For the point (-1; -1) we get (-1)*((-1) 2 – 3) = 2 > 0. Because product of two positive numbers
> 0, and
> 0, at the point (-1; -1) the minimum can be found. It is equal to 2*((-1) + (-1))*(1 +(-1)*(-1))/((1 +(-1) 2)*(1 +(-1) 2) ) = -8/4 = = -2.

Find global maximum or minimum (the largest or smallest value of a function) is somewhat more complicated than a local extremum, since these values ​​can be achieved not only at stationary points, but also at the boundary of the definition domain. It is not always easy to study the behavior of a function at the boundary of this region.

Brief theory

A gradient is a vector whose direction indicates the direction of the fastest increase in the function f(x). Finding this vector quantity is associated with the determination of partial derivatives of a function. The directional derivative is a scalar quantity and shows the rate of change of a function when moving along the direction specified by some vector.

Example of problem solution

Problem condition

Given a function, a point and a vector. Find:

Problem solution

Finding the gradient of a function

1) Find the gradient of the function at the point:

The desired gradient:

Finding the derivative with respect to the direction of a vector

2) Find the derivative in the direction of the vector:

where is the angle formed by the vector and the axis

The required derivative at the point:

The price is greatly influenced by the urgency of the decision (from a day to several hours). Online help with exams/tests is available by appointment.

You can leave a request directly in the chat, having previously sent the conditions of the tasks and informed you of the time frame for the solution you need. Response time is a few minutes.