Course Webpage

Exercise

Extreme of linear function with linear constraints

Maximize the function $f(x,y)=2.5x +3y$ with the constraints

$$ \left\{ \begin{array}{cc} 3x+6y & \leq90,\\ 2x+y & \leq35,\\ x+y & \leq20,\\ x,y & \geq0. \end{array}\right. $$

The conditions $x\geq 0$ and $y\geq 0$ mean that the region of the plane described by the constraint must be in the first quadrant.

Let us draw the borders of the region where the solution lies. We have 3 lines, $r_{1}$, $r_{2}$ and $r_{3}$.

\begin{array}{lll} r_{1}\qquad 3x+6y=90\qquad\rightarrow\qquad & \dfrac{3x}{90}+\dfrac{6y}{90}=1\qquad\rightarrow\qquad & \dfrac{x}{30}+\dfrac{y}{15}=1\\ \\ r_{2}\qquad 2x+y=35\qquad\rightarrow\qquad & \dfrac{2x}{35}+\dfrac{y}{35}=1\qquad\rightarrow\qquad & \dfrac{x}{17.5}+\dfrac{y}{35}=1\\ \\ r_{3}\qquad x+y=20\qquad\rightarrow\qquad & \dfrac{x}{20}+\dfrac{y}{20}=1 & \end{array}

$r_{1}$ intersects axis $OX$ in $x=30$ and axis $OY$ in $y=15$. Similarly, $r_{2}$ intersects axis $OX$ in $x=17.5$ and axis $OY$ in $y=35$. Finally, $r_{3}$ intersects axis $OX$ in $x=20$ y and axis $OY$ in $y=20.$

Each of these lines divides the plane into two regions, one that verifies the condition and the other that does not. It is therefore enough to try with a point and if this point fulfills the condition, the region of the plane where this point is located belongs to the region.

For simplicity, we try with the origin $\left(0,0\right)$

  • The origin meets the condition $3x+6y\le 90$ because $3(0)+6(0)\le 90$. But it does not meet the condition $3x+6y\geq 90$ because $3(0)+6(0)\geq 90.$
  • The origin also meets the conditions $2x+y\le 35$ and $x+y\le 20.$

So the region is the intersection of the three regions under the lines and it is the region represented in yellow, which is in the first quadrant because $x\ge 0$ and $ y\ge 0$

As the function is linear and is a two-variable function, its representation as a surface is a plane and its isolines are straight lines.

The maximum will be at one of the vertices (or sides) of the polygon that surrounds the area. So we need to calculate the vertices.

  • $A$ is the origin y $A=(0,0).$
  • $B$ is the intersection of the line $r_1$ with the axis $Y$. Thus, $B=(0,15)$
  • $C$ is the intersection of $3x+6y=90$ with $x+y=20$. If $x=20-y$ then $3(20-y)+6y=90$ and from $60+3y=90$ we get $C=(10,10).$
  • $D$ is the intersection of $x+y=20$ with $2x+y=35$. If $x=20-y$ then $2(20-y)+y=35$ and from $40-y=35$ we get $D=(15,5).$
  • $E$ is the intersection of $r_2$ with the axis $X$. Thus $E=(17.5,0).$

We compute the value of the function $f(x,y)=2.5x +3y$ at these points

\begin{array}{cccc} \hline \mathrm{Vertex} & x & y & f(x,y)\\ \hline A & 0 & 0 & 0\\ B & 0 & 15 & 45\\ {\color{red}C} & {\color{red}{10}} & {\color{red}{10}} & {\color{red}{55}}\\ D & 15 & 5 & 52.5\\ E & 17.5 & 0 & 43.75\\ \hline \end{array}

And the maximum is in $C$, because, at this point, the value of the function is maximum.