# Differential application

## Taylor series *theorem for a function of one variable*

If the function f: U ⊂R→R has continuous derivatives up to the power of k+1 in the neighborhood of point a, then it can be represented using the following series:

f(a+h) = f(a) + f'(a)⋅h + f''(a)⋅h^{2}/2 + f^{(k)}(a)⋅h^{k}/k! + R_{k}(a,h)

where lim_{h→0}R_{k}(a,h)/h^{k}= 0

**Figure 1.**Taylor series### Taylor series of the first degree

Let's give a function f : U ⊂ R^{n} → R, which is differentiable at point a. Row
Taylor of the first degree for the variable h=(h_{1},...,h_{n})

P_{1}(a+h) = f(a) + Σ^{n}_{i=1}[h_{i}df/dx_{i}(a)]

### Taylor series of the second degree

Let be given a function f : U ⊂ R^{n} → R, which is differentiable at point a to the second power. Row
Taylor of the second degree will have the form:

P_{2}(a+h) = f(a) + Σ^{n}_{i=1}[h_{i}df/dx_{i}(a)] + ½Σ^{n}_{i=1}Σ^{n}_{j=1}[h_{i}h_{j}d^{2}f/(dx_{i}dx_{j})(a)]

**Figure 2.**Taylor polynomials of the first and second degree## Extremum of the function

Let the function f be given:U⊂ R^{n} → R for x∈ U. The point x_{0} is the local maximum
of the function if f(x_{0})≤f(x) in some neighborhood around the point x_{0}.
The point x_{0} is the local minimum of the function if f(x_{0})≥f(x) in some neighborhood
around the point x_{0}.

Let be given a function f: U ⊂ R^{n} → R differentiable at the point x_{0} and the point
x_{0} is a local extremum, then x_{0} is a critical point, i.e.
∇f(x_{0})=0, so all partial derivatives of the first order at this point are zero.

If all partial derivatives are zero, then the point x_{0} is not necessarily a critical point,
but can be a saddle point.

## Hessian of the function

Let's give a function f: U ⊂ R^{n} → R belonging to the second class. The Hesse Matrix
f at the point x_{0} is a symmetric matrix:

d ^{2}f/dx_{1}dx_{1}(x_{0})... d ^{2}f/dx_{1}dx_{n}(x_{0})H _{f}(a) =... ... ... d ^{2}f/dx_{n}dx_{1}(x_{0})... d ^{2}f/dx_{n}dx_{n}(x_{0})

**Figure 3.**Hesse matrix. Hessian of the function
The Hessian of the function f at point x_{0} is the following function:

H_{f}(x_{0})(h) = ½(h_{1}... h_{n})⋅H_{f}⋅(x_{0})⋅(h_{1}... h_{n})^{T}

Let's give the function f : U⊂ R^{n} → R, f∈ C^{3} and U is an open interval.
Consider the *critical* point x_{0} ∈ U (∇f(x_{0})=0):

x_{0} is the point **of the local minimum** if H_{f}(x_{0})(h) > 0 for any h≠ 0.

x_{0} is a point ** of the local maximum** if H_{f}(x_{0})(h) < 0 for any h≠ 0.

x_{0} is a saddle point if H_{f}(x_{0})(h) ≠ 0 for any h≠ 0.

**Figure 4.**Extremes of functions## Lagrange multipliers

This method was introduced to solve the problem of finding extremum points on a closed set D. The methods described above are suitable for finding the extremum on an open set, so the problem is divided into two: the first is to find the extremes in the open interval, the second is to find the extremes on the boundary of the interval, comparing the obtained extremes, we will find the extremes of the function on the set D.

Let's introduce the concept of a level surface, **a level surface** of a function f is a set of points in space
where the function is equal to a given value, you could see this earlier, for example, in maps where the isolines
the height above sea level is indicated, each such contour is the surface of the level. Level H surface
this is the set of points f(x_{i}, ...) = h

Let's give two functions of the first class f : U⊂ R^{n} → R and g : U ⊂ R^{n} → R.
The point a ∈ U and g(a) = c and the surface of the level "c" of the function g are denoted by S. If the function f_{s}
at point a is the maximum or minimum, then ∇g(a) will be perpendicular to S at point a, which means
that there is a certain number such that f(a)=g(a).

#### Example

It is necessary to find the maximum and minimum of the function f(x,y,z) = x + 2y + 3z on the section formed
by the intersection of the cylinder x^{2} + y^{2} = 2 and the plane y + z = 1

In this example, we have a limitation of two functions, so there will be 2 multipliers, in general, we are interested in the result:

∇f(x,y,z)=λ∇g(x,y,z)+μ∇h(x,y,z)

where g(x,y,z) = x^{2}+ y^{2}- 2 and h(x,y,z) = y+ z - 1

more details:

df/dx = λ⋅dg/dx + μ⋅dh/dx

df/dx = λ⋅dg/dy + μ⋅dh/dy

df/dx = λ⋅dg/dz + μ⋅dh/dz

having solved this system of equations, we get two critical points: P(1,-1,2) and Q(-1,1,0) to check, which of them is the maximum and which is the minimum, it is necessary to calculate the value of the function:

f(1,-1,2) = 5

f(-1,1,0) = 1

Therefore, the maximum is at point P, the minimum is at point Q.