# How do you find the maximum and minimum values of the function subject to the given constraints: x+y>=2, 7x-y<=14, 3y<=5x+6, f(x,y)=4x+7y?

Dec 13, 2016

See below.

#### Explanation:

How do you find the maximum and minimum values of the function subject to the given constraints: $x + y \ge 2 , 7 x - y \le 14 , 3 y \le 5 x + 6 , f \left(x , y\right) = 4 x + 7 y$?

This is a typical linear programming problem. It can be assembled as

$\min / \max f \left(X\right) = \left\langlec , X\right\rangle$ subject to $A X \ge b$

Here $c = \left(4 , 7\right)$

$A = \left(\begin{matrix}1 & 1 \\ - 7 & 1 \\ - 3 & 5\end{matrix}\right)$

$b = \left(\begin{matrix}2 \\ - 14 \\ - 6\end{matrix}\right)$ and $X = \left(x , y\right)$

This example was worked out with the Lagrange Multipliers technique. The attached plot shows the feasible region with the main points shown at the frontier. The black vectors show the gradient direction at the stationary points and the red vectors show the restrictions gradient at those points. The maximum point is located at $3 , 7$ with $f \left(3 , 7\right) = 61$ The minimum point is located at $2 , 0$ with $f \left(2 , 0\right) = 8$

So defining ${s}^{2} = \left({s}_{1}^{2} , {s}_{2}^{2} , {s}_{3}^{2}\right)$ as slack variables we transform the inequality restrictions into equality

$A X = b - {s}^{2}$

Now calling $\lambda = \left({\lambda}_{1} , {\lambda}_{2} , {\lambda}_{3}\right)$ we can form the so called lagrangian

$L \left(x , s , \lambda\right) = \left\langlec , x\right\rangle + \left\langle\lambda , A x - b + {s}^{2}\right\rangle$

Their stationary points are determined by solving

$\nabla L = \vec{0}$

for $x , s , \lambda$ or

$\left\{\begin{matrix}c + \lambda A = 0 \\ A x - b + {s}^{2} = 0 \\ \lambda s = 0\end{matrix}\right.$

so we obtain

(( x = 2, y = 0, s_1 = 0, s_2 = 0, s_3 = -4, lambda_1 = -6.625, lambda_2 = 0.375, lambda_3 = 0), (x = 0, y = 2, s_1 = 0, s_2 = -4, s_3 = 0, lambda_1 = -5.875, lambda_2 = 0, lambda_3 = -0.375), (x = 3, y = 7, s_1 = -2.82843, s_2 = 0, s_3 = 0, lambda_1 = 0, lambda_2 = -2.9375, lambda_3 = -3.3125)) 