Analythical Methods
Analythical Methods
Analythical Methods
3
Contents
4
Chapter 1
Theory of maxima and minima
The classical theory of maxima and minima provides analytical methods for
finding solutions of optimization problems involving continuous and differ-
entiable functions and making use of differential calculus. Applications of
these techniques may be limited since many of the practical problems involve
functions that are not continuous or differentiable. The theory of maxima
and minima is the fundamental starting point for numerical methods of opti-
mization and a basis for advanced topics like calculus of variations or optimal
control.
This chapter presents necessary and sufficient conditions in locating the
optimum solutions for unconstrained and constrained optimization prob-
lems for single-variable functions or multivariable functions.
x = (x1 x2 . . . xn )T (1.1)
5
Chapter 1. Theory of maxima and minima
subject to:
gi (x) = 0, i = 1, m (1.4)
hj (x) 0, j = 1, p (1.5)
min (1 x1 )2 + (1 x2 )2 (1.7)
(x1 ,x2 )
subject to
x1 + x2 1 0, (1.8)
x31 x2 0 (1.9)
6
1.1. Statement of an optimization problem. Terminology
Figure 1.1 shows the contour plot of the objective function, i.e. the curves in two
dimensions on which the value of the function f (x1 , x2 ) is constant. The feasible
region, obtained as the area for which the constraints (1.8) and (1.9) hold, is shown
in the same figure.
As shown in Figure 1.2, the minimum values of a function f are the max-
imum of f . Therefore, the optimization problems will be stated, in general,
as minimization problems. The term extremum includes both maximum and
minimum.
100
80
60
f(x)
40
20
20
40
f(x)
60
80
x
100
4 3 2 1 0 1 2 3 4
7
Chapter 1. Theory of maxima and minima
A point x0 is a strong local minimum if there exists some > 0, such that:
A point x0 is a weak local minimum if there exists some > 0, such that:
f(x)
x
x1 x2 x3
Theorem 1.1 If a function f (x) is continuous on a closed interval [a, b], then f (x)
has both a maximum and a minimum on [a, b]. If f (x) has an extremum on an open
8
1.2. Unconstrained optimization
interval (a, b), then the extremum occurs at a critical point, (Renze and Weisstein,
2004).
A single variable function f (x) has critical points at all points x0 , where
the first derivative is zero (f 0 (x0 ) = 0), or f (x) is not differentiable.
A function of several variables f (x) has critical points where the gradient
is zero or the partial derivatives are not defined.
In general, a stationary point of a function f (x) is a point for which the
gradient vanishes:
f (x0 ) = 0 (1.13)
where T
f f f
f (x0 ) = ... (1.14)
x1 x2 xn
A stationary point of a single variable function is a point where the first
derivative f (x0 ) equals zero.
x x x
a x1 b a x2 x3 xb4 a x5b
a) b) c)
9
Chapter 1. Theory of maxima and minima
For a continuously differentiable function f , the only case when the mini-
mizer (or maximizer) is not a stationary point is when the point is an endpoint
of the interval [a, b] on which f is defined. That is, any maximum point inside
this interval, must be a stationary point.
The first-order condition: The necessary condition for a point x to be a mini-
mizer (or a maximizer) of the continuously differentiable function f : [a, b] R is: if
x (a, b), then x is a stationary point of f .
boundaries
In case the function is non-differentiable at some points in [a, b], the func-
tion may have extreme values in the points where it is not differentiable.
For a continuously differentiable function of n independent variables
f : Rn R, the necessary condition for a point x0 = (x1 x2 . . . xn )T to be an
extremum is that the gradient equals zero.
For continuously differentiable functions of n variables, the stationary
points can be: minima, maxima or saddle points.
Since not all stationary points are necessarily minima or maxima (they can
be also inflection or saddle points) we can determine their character by ex-
amining the second derivative of the function at the stationary point. These
sufficient conditions will be developed for single variable functions and then
extended for two or n variables based on the same concepts. The global min-
imum or maximum has to be located by comparing all local maxima and
minima.
10
1.2. Unconstrained optimization
The Taylor series expansion about the stationary point x0 is one possibility
to justify the second-order conditions:
1
f (x) = f (x0 )+f 0 (x0 )(xx0 )+ f 00 (x0 )(xx0 )2 +higher order terms (1.15)
2
For points x sufficiently close to x0 the higher order terms become neg-
ligible compared to the second-order terms. Knowing the first derivative is
zero at a stationary point, the equation (1.15) becomes:
1
f (x) = f (x0 ) + f 00 (x0 )(x x0 )2 (1.16)
2
If f 00 (x0 ) > 0, the term 12 f 00 (x0 )(xx0 )2 will add to f (x0 ) in the equation
(1.16), so the value of f at the neighboring points x is greater than f (x0 ).
In this case x0 is a local minimum.
If f 00 (x0 ) < 0, the term 21 f 00 (x0 )(x x0 )2 will subtract from f (x0 ) and
the value of f at the neighboring points x is less than f (x0 ). In this case
x0 is a local maximum.
11
Chapter 1. Theory of maxima and minima
If k is even and
If f (k) (x0 ) < 0, then x0 is a local maximizer.
If f (k) (x0 ) > 0, then x0 is a local minimizer.
If k is odd, then x0 is an inflection point.
x5 x3
f (x) = (1.18)
5 3
The stationary points are obtained by setting the first derivative equal to zero:
x1 = 1; x2 = 1; x3 = x4 = 0; (1.20)
12
1.2. Unconstrained optimization
Because f 00 (1) > 0 and f 00 (1) < 0, the stationary point x1 = 1 is a local minimum
and x2 = 1 is a local maximum. Since the second derivative is zero at x3,4 = 0, an
analysis of higher order derivatives is necessary. The third derivative of f :
is nonzero for x3,4 = 0. Since the order of the first nonzero derivative is 3, i.e., it is
odd, the stationary points x3 = x4 = 0 are inflection points. A plot of the function
showing the local minimum, maximum and inflection points is shown in Figure 1.6.
x5/5x3/3
0.4
0.3
0.2
0.1
f(x)
0.1
0.2
0.3
0.4
1.5 1 0.5 0 0.5 1 1.5
x
f (x) = 4x x3 /3 (1.24)
3 x 1 (1.25)
13
Chapter 1. Theory of maxima and minima
The stationary points of the function are x10 = 2 and x20 = 2. Since the variable
is constrained by (1.25) and x20 is out of the bounds, we shall analyze the other
stationary point and the boundaries. The second derivative:
0
f(x)
6
3 2.5 2 1.5 1 0.5 0 0.5 1
x
f (x1 , x2 ) f (x1 , x2 )
= fx1 , = fx2 (1.28)
x1 x2
f (x1 , x2 )
= fxi xj , i, j = 1, 2 (1.29)
xi xj
If f (x1 , x2 ) has a local extremum at a point (x10 ,x20 ) and has continuous
14
1.2. Unconstrained optimization
The second partial derivatives test classifies the point as a local maximum
or local minimum.
Define the second derivative test discriminant as:
If D2 (x10 , x20 ) > 0 and fx1 x1 (x10 , x20 ) > 0, the point is a local minimum
If D2 (x10 , x20 ) > 0 and fx1 x1 (x10 , x20 ) < 0, the point is a local maximum
If D2 (x10 , x20 ) = 0 the test is inconclusive and higher order tests must
be used.
The function has only one stationary point: (x10 , x20 ) = (0, 0). Compute the second
derivatives:
fx1 x1 = 2, fx1 x2 = 0, fx2 x2 = 2 (1.36)
15
Chapter 1. Theory of maxima and minima
According to the second derivative test, the point (0, 0) is a saddle point. A mesh
and contour plot of the function is shown in Figure 1.8.
1
0.8
0.8
1 0.6
0.6
0.4 0.4
0.5
0.2
f(x1, x2)
0.2
0
x2
0 0
0.4 0.4
1
1 0.6
0.6
0.5 1
0 0.5 0.8
0 0.8
0.5 0.5 1
1 1 1 0.5 0 0.5 1
x2 x1 x1
The function has only one stationary point: (x10 , x20 ) = (0, 0). The second deriva-
tives are:
fx1 x1 = 2 < 0, fx1 x2 = 0, fx2 x2 = 2 (1.41)
16
1.2. Unconstrained optimization
Thus, the function has a maximum at (0, 0), because fx1 x1 < 0 and D2 > 0. The
graph of the function is shown in Figure 1.9.
0.5
f(x1, x2)
0.5
1
1
0.5 1
0 0.5
0
0.5 0.5
1 1
x2 x1
17
Chapter 1. Theory of maxima and minima
A plot of the function and the contour lines are shown in Figure 1.10.
2 0.8 1.5
0.6
1
1
0.4
0.5
0
f(x1, x2)
0.2
0
x2
1 0
0.2 0.5
2
0.4 1
3
1 0.6
1.5
1 0.8
0
0.5
0 2
0.5 1
1 1 1 0.5 0 0.5 1
x x x1
2 1
Figure 1.10: Mesh and contour plot of f (x1 , x2 ) = x21 + 2x1 x2 + x42 2
18
1.2. Unconstrained optimization
tives of f are zero at a stationary point, thus the relation (1.48) can be written
as:
1
f (x) = f (x0 ) + (x x0 )T H2 (x x0 ) (1.50)
2
The sign of the quadratic form which occurs in (1.50) as the second term
on the right-hand side will decide the character of the stationary point x0 ,
similarly to single variable functions.
According to (Hancock, 1960), we can determine whether the quadratic
form is positive or negative by evaluating the signs of the determinants of
the upper-left sub-matrices of H2 :
fx1 x1 fx1 x2 . . . fx1 xi
fx2 x1 fx2 x2 . . . fx2 xi
Di = , i = 1, n
(1.51)
... ... ... ...
fxi x1 fxi x2 . . . fxi xi
19
Chapter 1. Theory of maxima and minima
20
1.3. Constrained optimization
Because they do not have the same sign and are nonzero (1, 0, 0) is a saddle point.
subject to
gi (x) = 0, i = 1, m (1.60)
hj (x) 0, j = 1, p (1.61)
subject to
g(x1 , x2 ) = x1 + 2x2 + 4 = 0 (1.63)
21
Chapter 1. Theory of maxima and minima
The plot of the function and the constraint are illustrated in Figure 1.11, as a 3D
surface and contour lines.
16
20 2
14
15 1 12
f(x1, x2)
10
2
10 0
x
8
5 1 6
x1+2x2+4=0
4
0 4 2
3 2
2 0
1 2
0 2
1
2 4
3 3
x 3 2 1 0 1 2 3
x1 2 x1
Figure 1.11: Mesh and contour plot of f (x1 , x2 ) = x21 + x22 and the constraint
x1 + 2x2 + 4 = 0
The purpose now is to minimize the function x21 +x22 subject to the condition that
the variables x1 and x2 lie on the line x1 + 2x2 + 4 = 0. Graphically, the minimizer
must be located on the curve obtained as the intersection of the function surface and
the vertical plane that passes through the constraint line. In the x1 x2 plane, the
minimizer can be found as the point where the line x1 + 2x2 + 4 = 0 and a level
curve of x21 + x22 are tangent.
Notice that the slack variables sj are squared to be positive. They are additional
variables, so the number of the unknown variables increases to n + p.
An inequality given in the form:
hj (x) 0, j = 1, p (1.65)
22
1.3. Constrained optimization
subject to
x1 + x2 4 (1.68)
The inequality (1.68) is converted into an equality by introducing a slack variable s21 :
x1 + x2 4 + s21 = 0 (1.69)
This method can be applied when it is possible to solve the constraint equa-
tions for m independent variables, where the number of constraints is less
than the total number of variables m n. The solution of the constraint
equations is then substituted into the objective function. The new problem
will have n m unknowns, it will be unconstrained and the techniques for
unconstrained optimization can be applied.
Example 1.11 Let w, h, d be the width, height and depth of a box (a rectangular
parallelepiped). Find the optimal shape of the box to maximize the volume, when the
sum w + h + d is 120.
The problem can be formulated as:
subject to
w + h + d 120 = 0 (1.71)
23
Chapter 1. Theory of maxima and minima
We solve (1.71) for one of the variables, for example d and then substitute the
result into (1.70):
d = 120 w h (1.72)
Let:
f (w, h) = wh(120 w h) = 120wh w2 h wh2 (1.74)
f
= 120h 2wh h2 = h(120 2w h) = 0 (1.75)
w
f
= 120w w2 2wh = w(120 w 2h) = 0 (1.76)
h
Since
2f
D1 = = 80 < 0 and D2 = 4800 > 0
w2
the point (40, 40) is a maximum. From (1.72) we have: d = 120 40 40 = 40,
thus the box should have the sides equal: w = d = h = 40.
subject to:
x1 + x2 = 4 (1.79)
24
1.3. Constrained optimization
10
4
0
3 1
9. 1.90
10 7.1 5238 48
429
4.7
f(x , x )
2 619
2
2
20 2.38
1
x
1
1
x1+x24=0
30
0
40
50 6 1
2 4
0 2
2 4 0
6 2
2
x2 2 1 0 1 2 3 4 5
x1 x1
Figure 1.12: Mesh and contour plot of f (x1 , x2 ) = x21 x22 and the constraint
x1 + x2 4 = 0
on the intersection of the function surface and the vertical plane that passes through
the constraint line. In the plot showing the level curves of f (x1 , x2 ), the point that
maximizes the function is located where the line x1 + x2 + 4 = 0 is tangent to one
level curve.
Analytically, this point can be determined by the method of substitution, as fol-
lows:
Solve (1.79) for x2 :
x2 = 4 x1 (1.80)
and replace it into the objective function. The new unconstrained problem is:
max x21 (4 x1 )2 (1.81)
x1
f (x1 , x2 ) = 20 x1 x2 (1.83)
25
Chapter 1. Theory of maxima and minima
subject to:
x1 + x2 = 6 (1.84)
Because the second derivative f 00 (x10 ) = 2 is positive, the stationary point is a min-
imizer of f (x1 ). Because x2 = 6 x1 , the point (x10 = 3, x20 = 3) minimizes
the function f (x1 , x2 ) subject to the constraint (1.84). As shown in Figure 1.13,
the minimum obtained is located on the parabola resulting from the intersection of
the function surface and the vertical plane containing the constraint line, or, in the
contour plot, it is the point where the constraint line is tangent to a level curve.
7
1
19
5.6
8.33
16.3333
8.
7
33 2
666
3
21.6667
.6
30 1 33 1
3
333
6
66
24.333
5.6
67
66
5 33
.3
0.
11
1 1 7
33 33
33
20 5 0.3 3
33
33
13.6
3
x1+x26=0
667
10 4 5. 3
8. 66 2 5
33 66
0.3 .3333
f(x1, x2)
33 7 333 3
19
3
16
33
2
0 3
.33
11
x
667
33
5.66 3
21.6
Figure 1.13: Mesh and contour plot of f (x1 , x2 ) = 20x1 x2 and the constraint
x1 + x2 6 = 0
26
1.3. Constrained optimization
mulated as:
min f (x) (1.87)
x
subject to
gi (x) = 0, i = 1, m (1.88)
5.5 1
0
5
5
5
4.5
10
0
4
15
2
3.5
x
3
5
2.5
2 10
1.5
15 g(x , x )=0
1 2
1
1 2 3 4 5 6
x1
Our goal is to minimize f (x1 , x2 ), or, in other words, to find the point
which lies on the level curve with the smallest possible value and which sat-
isfies g(x1 , x2 ) = 0. If we are at the point (x1 = 3, x2 = 3), the value of the
function is f (3, 3) = 11 and the constraint is satisfied. The constraint line is
tangent to the level curve at this point. If we move on the line g(x1 , x2 ) = 0
left or right from this point, the value of the function increases. Thus, the
solution of the problem is (3, 3).
In the general case, consider the point x where a level curve of a function
f (x) is tangent to the constraint g(x). At this point, the gradient of f , f (x),
27
Chapter 1. Theory of maxima and minima
The necessary conditions for optimum are obtained by setting the first partial
derivatives of the Lagrangian function with respect to xi , i = 1, n and j ,
j = 1, m equal to zero. There are n + m nonlinear algebraic equations to be
28
1.3. Constrained optimization
L(x1 , x2 , )
= x2 + = 0 (1.96)
x1
L(x1 , x2 , )
= x1 + = 0 (1.97)
x2
L(x1 , x2 , )
= x1 + x2 6 = 0 (1.98)
From (1.96) and (1.97), x1 = x2 = , which replaced in (1.98) gives the stationary
point: x1 = 3 = x2 = .
This point is the solution of the constrained minimization problem from example
1.13, but the sufficient conditions for constrained optimization will be discussed in
the following section.
29
Chapter 1. Theory of maxima and minima
and if
2 L(x0 ,0 ) 2 L(x0 ,0 )
... g1 (x0 )
... gm (x0 )
x1 x1 x1 xp x1 x1
... ... ... ... ... ...
2 L(x0 ,0 )
... 2 L(x0 ,0 ) g1 (x0 )
... gm (x0 )
(1)m xp x1
g1 (x0 )
xp xp
g1 (x0 )
xp xp
>0 (1.100)
... 0 ... 0
x1 xp
... ... ... ... ... ...
gm (x0 )
... gm (x0 )
0 ... 0
x1 xp
gi (x0 ) = 0, i = 1, m (1.101)
For p = n, the matrix from (1.100) is the bordered Hessian matrix of the
problem. The elements are in fact the second derivatives of the Lagrangian
with respect to all n + m variables, xi and j . The columns in the right and
the last rows can be easier recognized as second derivatives of L if we notice
that:
L(x, ) L2 (x, ) gj (x)
= gj (x) and = (1.102)
j j xi xi
Since gj (x) do not depend on , the zeros from lower-right corner of the
30
1.3. Constrained optimization
L(x, ) L2 (x, )
= gj (x) and =0 (1.103)
j j i
When p < n, the matrices can be obtained if the rows and columns be-
tween p + 1 and n 1 are excluded.
Example 1.15 For example 1.14, we shall prove that the stationary point is a mini-
mum, according to the sufficient condition given above. The function to be minimized
is f (x1 , x2 ) = 20 x1 x2 and the constraint g(x1 , x2 ) = x1 + x2 6 = 0
or
2 L(x1 ,x2 ,) 2 L(x1 ,x2 ,) g(x1 ,x2 )
2 x1 x1 x2 x1
2 L(x1 ,x2 ,) 2 L(x1 ,x2 ,) g(x1 ,x2 )
H2 = x2 x1 2 x2 x2 (1.105)
g(x1 ,x2 ) g(x1 ,x2 )
x1 x2 0
Using the results we have obtained in Example 1.14, the second derivatives of the
Lagrangian function are:
2 L(x1 , x2 , )
= (x2 + ) = 0
2 x1 x1
2 L(x1 , x2 , )
= (x1 + ) = 0
2 x2 x2
2
L(x1 , x2 , )
= (x2 + ) = 1 (1.106)
x1 x2 x2
g(x1 , x2 )
= (x1 + x2 6) = 1
x1 x1
g(x1 , x2 )
= (x1 + x2 6) = 1
x2 x2
31
Chapter 1. Theory of maxima and minima
thus, the stationary point (3, 3) is a minimizer of the function f subject to the con-
straint g = 0.
Example 1.16 Find the highest and lowest points on the surface f (x1 , x2 ) = x1 x2 +
25 over the circle x21 + x22 = 18.
Figure 1.15 shows a graphical representation of the problem. The constraint on
x1 and x2 places the variables on the circle with the center in the origin and with a
radius equal to 18. On this circle, the values of the function f (x1 , x2 ) are located
on the curve shown in Figure 1.15 on the mesh plot. It is clear from the picture that
there are two maxima and two minima that will be determined using the method of
Lagrange multipliers.
5
10
45
4
40
25
3
15 35
2
20 30
1
2
0 25 25
x
1 30
20
2
35
15
3
40
25
4 45
10
5 5
5 4 3 2 1 0 1 2 3 4
x1
Figure 1.15: Mesh and contour plot of f (x1 , x2 ) = 25+x1 x2 and the constraint
x21 + x22 = 18
32
1.3. Constrained optimization
Compute the first partial derivatives of L and set them equal to zero:
Lx1 = x2 + 2x1 = 0
Lx2 = x1 + 2x2 = 0 (1.110)
L = x21 + x22 18 = 0
1
x10 = 3, x20 = 3, 0 =
2
1
x10 = 3, x20 = 3, 0 = (1.111)
2
1
x10 = 3, x20 = 3, 0 =
2
1
x10 = 3, x20 = 3, 0 =
2
Build the bordered Hessian matrix and check the sufficient conditions for maxima
and minima.
Lx1 x1 Lx1 x2 gx1 2 1 2x1
H2 = Lx1 x2 Lx2 x2 gx2 = 1 2 2x2 (1.112)
gx1 gx2 0 2x1 2x2 0
33
Chapter 1. Theory of maxima and minima
For all points (x10 , x20 , 0 ) given in (1.111) compute det(H2 ) and obtain:
1 1 6
1
(3, 3, ) : det(H2 ) = 1 1 6 = 144 < 0 (1.115)
2
6 6 0
1 1 6
1
(3, 3, ) : det(H2 ) = 1 1 6 = 144 < 0 (1.116)
2
6 6 0
1 1 6
1
(3, 3, ) : det(H2 ) = 1 1 6 = 144 > 0 (1.117)
2
6 6 0
1 1 6
1
(3, 3, ) : det(H2 ) = 1 1 6 = 144 > 0 (1.118)
2
6 6 0
Example 1.17 Find the point on the sphere x2 + y 2 + z 2 = 4 closest to the point
P (3, 4, 0) (Figure 1.16).
0 P
z
2
2
4
0 3
2
1
2 0
1
2
y
x
34
1.3. Constrained optimization
We shall find the point (x, y, z) that minimizes the distance between P and
the sphere. In a 3-dimensional space, the distance between any point (x, y, z) and
P (3, 4, 0) is given by:
p
D(x, y, z) = (x 3)2 + (y 4)2 + z 2 (1.119)
Since the point (x, y, z) must be located on the sphere, the variables are constrained
by the equation x2 + y 2 + z 2 = 4. The calculus will be easier if instead of (1.119) we
minimize the function under the square root. The problem to be solved is then:
subject to:
g(x, y, z) = x2 + y 2 + z 2 4 = 0 (1.121)
and set the partial derivatives equal to zero to compute the stationary points:
Lx = 2x 6 + 2x = 0
Ly = 2y 8 + 2y = 0 (1.123)
Lz = 2z + 2z = 0
L = x2 + y 2 + z 2 4 = 0
6 8 3
(S1 ) : x10 = , y10 = , z10 = 0, 10 = (1.124)
5 5 2
and
6 8 7
(S2 ) : x10 = , y10 = , z10 = 0, 10 = (1.125)
5 5 2
It is clear from Figure 1.16 that we must find a minimum and a maximum distance
between the point P and the sphere, thus the sufficient conditions for maximum or
minimum have to be checked.
The number of variables is n = 3, the number of constraints m = 1 and p from
35
Chapter 1. Theory of maxima and minima
(1.100) has two values: p = 2, 3. We must analyze the sign of the determinants for
the following matrices:
For p = 2:
Lxx Lxy Lx Lxx Lxy gx
H22 = Lxy Lyy Ly = Lxy Lyy gy (1.126)
Lx Ly L gx gy 0
For p = 3:
Lxx Lxy Lxz Lx Lxx Lxy Lxz gx
Lxy Lyy Lyz Ly Lxy Lyy Lyz gy
H23 =
=
(1.127)
Lxz Lyz Lzz Lz Lxz Lyz Lzz gz
Lx Ly Lz L gx gy gz 0
2 + 2 0 2x
H22 = 0 2 + 2 2y (1.131)
2x 2y 0
36
1.3. Constrained optimization
2 + 2 0 0 2x
0 2 + 2 0 2y
H23 =
(1.132)
0 0 2 + 2 2z
2x 2y 2z 0
For the first stationary point, (S1 ), the determinants of H22 and H23 are:
5 0 12
5
16
detH22 = 0 5 5 = 80 (1.133)
12
16
0
5 5
5 0 0 12
5
16
0 5 0
detH23 = 5 = 400 (1.134)
0 0 5 0
12 16
5 5 0 0
37
Chapter 1. Theory of maxima and minima
f (x, y, z) = x + 2y + z (1.139)
subject to:
g1 (x, y, z) = x2 + y 2 + z 2 1 = 0 (1.140)
g2 (x, y, z) = x + y + z 1 = 0 (1.141)
In this case we have two constraints and 3 variables. Two new unknowns will be
introduced and the Lagrange function is written as:
Lx = 1 + 21 x + 2 = 0
Ly = 2 + 21 y + 2 = 0
Lz = 1 + 21 z + 2 = 0 (1.143)
2 2 2
L1 = x +y +z 1=0
L2 = x+y+z1=0
(S1 ) : x0 = 0, y0 = 1, z0 = 0, 10 = 21 , 20 = 1 (1.144)
(S2 ) : x0 = 23 , y0 = 13 , z0 = 23 , 10 = 12 , 20 = 53 (1.145)
The number p from (1.100) is 3 in this case, therefore we have to analyze the sign
of the determinant:
Lxx Lxy Lxz g1x g2x 21 0 0 2x 1
Lxy Lyy Lyz g1y g2y 0 21 0 2y 1
detH2 = Lxz Lyz Lzz g1z g2z =
0 0 21 2z 1 (1.146)
g1x g1y g1z 0 0 2x 2y 2z 0 0
g2x g2y g2z 0 0 1 1 1 0 0
38
1.3. Constrained optimization
For (S1 ):
1 0 0 0 1
0 1 0 2 1
detH2 = 0 0 1 0 1 = 8 < 0
(1.149)
0 2 0 0 0
1 1 1 0 0
39
Chapter 1. Theory of maxima and minima
subject to
gi (x) = 0, i = 1, m (1.152)
hj (x) 0, j = 1, p (1.153)
m
X p
X
L(x, , ) = f (x) + i gi (x) + j hj (x)
i=1 j=1
where:
g = [g1 (x) g2 (x) . . . gm (x)]T and h = [h1 (x) h2 (x) . . . hp (x)]T are
vector functions.
40
1.3. Constrained optimization
The following two conditions (1.156, 1.157), are the inequality and
equality constraints which must be satisfied by the minimizer of the
constrained problem, and are called the feasibility conditions.
The KKT conditions are necessary conditions for optimum. Not all the
points that satisfy (1.155)-(1.160) are optimal points. On the other hand, a
point is not optimal if the KKT conditions are not satisfied.
If the objective and inequality constraint functions (f and hj ) are convex
and gi are affine, the KKT conditions are also sufficient for a minimum point.
A function hj is affine if it has the form:
hj = A1 x1 + A2 x2 + . . . An xn + b (1.161)
subject to:
x1 + x2 2 (1.163)
x1 0 (1.164)
x2 0 (1.165)
x1 + x2 2 0 (1.166)
x1 0 (1.167)
x2 0 (1.168)
41
Chapter 1. Theory of maxima and minima
L
= 3e3x1 + 1 2 = 0 (1.170)
x1
L
= 2e2x2 + 1 3 = 0 (1.171)
x2
1 (x1 + x2 2) = 0 (1.172)
2 (x1 ) = 0 (1.173)
3 (x2 ) = 0 (1.174)
1 0 (1.175)
2 0 (1.176)
3 0 (1.177)
First we may notice that x1 0 and x2 0, thus they can be either zero, or
strictly positive. Therefore, we have four cases:
3 + 1 2 = 0 (1.178)
2 + 1 3 = 0 (1.179)
1 (2) = 0 (1.180)
3 + 1 2 = 0 (1.181)
2x2
2e + 1 = 0 (1.182)
1 (x2 2) = 0 (1.183)
42
1.3. Constrained optimization
3e3x1 + 1 = 0 (1.184)
2 + 1 3 = 0 (1.185)
1 (x1 2) = 0 (1.186)
4.) x1 > 0, x2 > 0 Since x1 and x2 cannot be zero, from (1.173) and (1.174) we
obtain: 2 = 0 and 3 = 0.
3e3x1 + 1 = 0 (1.187)
2e2x2 + 1 = 0 (1.188)
1 (x1 + x2 2) = 0 (1.189)
The value of 1 cannot be zero because this would make zero the exponentials
from (1.187) and (1.188) which is not valid. Then x1 + x2 2 = 0, or x2 =
2 x1 .
and then:
2
3e3x1 = 2e2(2x1 ) , or e5x1 +4 = (1.191)
3
43
Chapter 1. Theory of maxima and minima
1 2
x1 = (4 ln ) = 0.88, x2 = 2 x1 = 1.11 (1.192)
5 3
1.8
1.6
1.4
1.2 P
2
1
x
0.8
0.6
0.4
0.2
0
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
x
1
1.4 Exercises
1. Locate the stationary points of the following functions and determine
their character:
a) f (x) = x7
b) f (x) = 8x x4 /4
c) f (x) = 50 6x + x3 /18
a) f (x1 , x2 ) = x1 x2
44
1.4. Exercises
Compute the stationary points and determine their character using the
second derivative test.
in the region
0 x1 1
0 x2 2
subject to
x1 + 3x2 10 = 0
6. Use the method of Lagrange multipliers to find the maximum and min-
imum values of f subject to the given constraints
45
Chapter 1. Theory of maxima and minima
46
Bibliography
47