Tutorial 1 Solutions

Part A: Supply Chain Concepts and Roles

Question 1

Outline the main responsibilities of manufacturers, distributors, and retailers in evaluating and enhancing their operations, decision-making procedures, and management of the supply chain.

Manufacturers: design products, source materials, plan production, control quality, reduce production cost, and improve capacity/use of resources.

Distributors: store, consolidate, transport, manage inventory, coordinate deliveries, and reduce logistics cost.

Retailers: sell to customers, manage demand, pricing, service, shelf availability, and customer feedback.

Question 2

Define the objectives pursued by manufacturers, distributors, and retailers within the supply chains of the following products.

  1. Smartphone
  2. Computer
  3. Kitchenware

Manufacturers: design and produce high-quality, innovative, and cost-effective smartphones/computers/kitchenware to meet consumer demand and maximise profit.

Distributors: efficiently distribute smartphones/computers/kitchenware to retailers, ensuring timely delivery and minimising logistics costs.

Retailers: provide a seamless shopping experience, manage inventory, and offer customer support to maximise sales and customer satisfaction.


Part B: Optimisation Concepts

Question 1

Consider the function

\[ f(x,y)=\frac{x+y}{x^2+y^2+1}. \]

  1. Find the gradient of the function.

\[ \nabla f = \left(\frac{\partial f}{\partial x}, \frac{\partial f}{\partial y}\right) \] where \[ \frac{\partial f}{\partial x} = \frac{(x^2+y^2+1)(1) - (x+y)(2x)}{(x^2+y^2+1)^2}, \] \[ \frac{\partial f}{\partial y} = \frac{(x^2+y^2+1)(1) - (x+y)(2y)}{(x^2+y^2+1)^2}. \]

  1. Determine the critical (stationary) points.

\[ \frac{\partial f}{\partial x} = 0 \quad \text{and} \quad \frac{\partial f}{\partial y} = 0 \]

We have

\[ (x^2+y^2+1) - 2x(x+y) = 0 \tag{1} \] \[ (x^2+y^2+1) - 2y(x+y) = 0. \tag{2} \]

From (1) and (2), we can derive \[ 2x(x+y) = 2y(x+y) \implies x = y \;\;\text{or}\;\; x+y=0. \]

Substituting \(x=y\) into (1) gives

\[ \begin{aligned} (x^2+x^2+1) - 2x(2x) &= 0 \\ 2x^2 + 1 - 4x^2 &= 0 \\ -2x^2 + 1 &= 0 \\ x^2 &= \frac{1}{2} \\ x &= \pm \frac{1}{\sqrt{2}}, \end{aligned} \]

which leads to the critical points

\[ \left(\frac{1}{\sqrt{2}}, \frac{1}{\sqrt{2}}\right), \quad \left(-\frac{1}{\sqrt{2}}, -\frac{1}{\sqrt{2}}\right). \]

Alternatively, we can use a symbolic computation tool to find the critical points directly.

import sympy as sp
x, y = sp.symbols('x y')
f = (x + y) / (x**2 + y**2 + 1)
critical_points = sp.solve([sp.diff(f, x), sp.diff(f, y)], (x, y))
critical_points
[(-sqrt(2)/2, -sqrt(2)/2), (sqrt(2)/2, sqrt(2)/2)]
  1. Find the Hessian of the function.

\[ \begin{aligned} \mathbf{H} &= \begin{bmatrix} \dfrac{\partial^2 f}{\partial x^2} & \dfrac{\partial^2 f}{\partial x \partial y} \\ \dfrac{\partial^2 f}{\partial y \partial x} & \dfrac{\partial^2 f}{\partial y^2} \end{bmatrix} \\ &= \dfrac{1}{(x^2+y^2+1)^3} \\ &\qquad \begin{bmatrix} 6x(xy-y^2-1)+2(x^3-y^3-y) & 6xy(x+y)-2(x^3+y^3+x+y) \\ 6xy(x+y)-2(x^3+y^3+x+y) & 6y(xy-x^2-1)+2(y^3-x^3-x) \end{bmatrix} \end{aligned} \]

Since the second partial derivatives are quite complex, we can also use a symbolic computation tool to find the Hessian matrix. The resulting Hessian matrix is

# Hessian matrix
import sympy as sp
x, y = sp.symbols('x y')
f = (x + y) / (x**2 + y**2 + 1)
H = sp.hessian(f, (x, y))
H

\(\displaystyle \left[\begin{matrix}\frac{8 x^{2} \left(x + y\right)}{\left(x^{2} + y^{2} + 1\right)^{3}} - \frac{4 x}{\left(x^{2} + y^{2} + 1\right)^{2}} - \frac{2 \left(x + y\right)}{\left(x^{2} + y^{2} + 1\right)^{2}} & \frac{8 x y \left(x + y\right)}{\left(x^{2} + y^{2} + 1\right)^{3}} - \frac{2 x}{\left(x^{2} + y^{2} + 1\right)^{2}} - \frac{2 y}{\left(x^{2} + y^{2} + 1\right)^{2}}\\\frac{8 x y \left(x + y\right)}{\left(x^{2} + y^{2} + 1\right)^{3}} - \frac{2 x}{\left(x^{2} + y^{2} + 1\right)^{2}} - \frac{2 y}{\left(x^{2} + y^{2} + 1\right)^{2}} & \frac{8 y^{2} \left(x + y\right)}{\left(x^{2} + y^{2} + 1\right)^{3}} - \frac{4 y}{\left(x^{2} + y^{2} + 1\right)^{2}} - \frac{2 \left(x + y\right)}{\left(x^{2} + y^{2} + 1\right)^{2}}\end{matrix}\right]\)

  1. Classify the stationary points as saddle points, strict or non-strict local/global minima, or strict or non-strict local/global maxima.

Quadratic Form Test

Substitute the critical points into the Hessian matrix to evaluate the quadratic form

\[ H(\frac{1}{\sqrt{2}}, \frac{1}{\sqrt{2}}) = \begin{bmatrix}\frac{-1}{\sqrt{2}} & 0 \\ 0 & \frac{-1}{\sqrt{2}}\end{bmatrix}, \;\; H\left(-\frac{1}{\sqrt{2}}, -\frac{1}{\sqrt{2}}\right) = \begin{bmatrix}\frac{1}{\sqrt{2}} & 0 \\ 0 & \frac{1}{\sqrt{2}}\end{bmatrix}. \]

Then, evaluate the quadratic form at each critical point: \[ Q(\mathbf{x}) = \mathbf{x}^T \mathbf{H} \mathbf{x} \]

For \(\left(\frac{1}{\sqrt{2}}, \frac{1}{\sqrt{2}}\right)\), we have

\[ \left[\frac{1}{\sqrt{2}}, \frac{1}{\sqrt{2}}\right]\begin{bmatrix}\frac{-1}{\sqrt{2}} & 0 \\ 0 & \frac{-1}{\sqrt{2}}\end{bmatrix}\begin{bmatrix}\frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}}\end{bmatrix} = -\frac{1}{\sqrt{2}} < 0. \]

\(\therefore \left(\frac{1}{\sqrt{2}}, \frac{1}{\sqrt{2}}\right)\) is a local maximum.

For \(\left(-\frac{1}{\sqrt{2}}, -\frac{1}{\sqrt{2}}\right)\), we have

\[ \left[-\frac{1}{\sqrt{2}}, -\frac{1}{\sqrt{2}}\right]\begin{bmatrix}\frac{1}{\sqrt{2}} & 0 \\ 0 & \frac{1}{\sqrt{2}}\end{bmatrix}\begin{bmatrix}-\frac{1}{\sqrt{2}} \\ -\frac{1}{\sqrt{2}}\end{bmatrix} = \frac{1}{\sqrt{2}} > 0. \]

\(\therefore \left(-\frac{1}{\sqrt{2}}, -\frac{1}{\sqrt{2}}\right)\) is a local minimum.

Eigenvalue Test

Alternatively, to classify the stationary points, we can evaluate the determinant of the Hessian matrix at each critical point.

\[ \det(\mathbf{H}-\lambda \mathbf{I}) = 0 \]

Since the Hessian matrix is diagonal at the critical points, the eigenvalues are simply the diagonal entries. The signs of the eigenvalues will help us classify the stationary points.

Alternatively, we can also use a symbolic computation tool to find the eigenvalues at each critical point. The signs of the eigenvalues will help us classify the stationary points.

# Eigenvalues of the Hessian matrix at each critical point
eigenvalues = [H.subs({x: 1/sp.sqrt(2), y: 1/sp.sqrt(2)}).eigenvals(),
               H.subs({x: -1/sp.sqrt(2), y: -1/sp.sqrt(2)}).eigenvals()]
eigenvalues
[{-sqrt(2)/2: 2}, {sqrt(2)/2: 2}]
  • sympy.Matrix.eigenvals() returns a dictionary {eigenvalue: multiplicity}, where multiplicity is the number of times the eigenvalue appears as a root of the characteristic polynomial.
  • For the first critical point \(\left(\frac{1}{\sqrt{2}}, \frac{1}{\sqrt{2}}\right)\), the eigenvalues are both negative, indicating that this point is a local maximum.
  • For the second critical point \(\left(-\frac{1}{\sqrt{2}}, -\frac{1}{\sqrt{2}}\right)\), the eigenvalues are both positive, indicating that this point is a local minimum.

Question 2

A Cobb-Douglas production function for a new company is given by

\[ f(x,y)=50x^{2/5}y^{3/5}, \]

where \(x\) represents units of labour and \(y\) represents units of capital. Suppose each unit of labour costs \(\$100\) and each unit of capital costs \(\$200\). If the budget constraint is \(\$30{,}000\), find the maximum production level for this manufacturer.

The optimisation problem is

\[ \begin{aligned} \max &\quad f(x,y)=50x^{\frac25}y^{\frac35} \\ \text{st.} &\quad 100x + 200y = 30000. \end{aligned} \]

Using the method of Lagrange multipliers,

\[ L(x,y,\lambda) = 50x^{\frac25}y^{\frac35} -\lambda(100x+200y-30000). \]

Set

\[ L_x=0,\qquad L_y=0,\qquad L_\lambda=0. \]

\[ L_x = 20x^{-\frac35}y^{\frac35} -100\lambda =0, \tag{1} \]

\[ L_y = 30x^{\frac25}y^{-\frac25} -200\lambda =0, \tag{2} \]

\[ L_\lambda = -100x-200y+30000 =0. \tag{3} \]

From (1),

\[ \lambda = \frac{x^{-\frac35}y^{\frac35}}{5}. \tag{4} \]

From (2),

\[ \lambda = \frac{3x^{\frac25}y^{-\frac25}}{20}. \tag{5} \]

Equating (4) and (5),

\[ \frac{x^{-\frac35}y^{\frac35}}{5} = \frac{3x^{\frac25}y^{-\frac25}}{20}, \]

which gives

\[ x=\frac43 y. \tag{6} \]

Substituting (6) into (3),

\[ -100x-200\left(\frac{3x}{4}\right)+30000=0, \]

so

\[ x=120 \implies y = 90. \]

Therefore,

\[ f(120,90) = 50(120)^{\frac25}(90)^{\frac35} \approx 5049. \]

\(\therefore\) the maximum production level is 5049 units.

Question 3

Consider the optimisation problem

\[ \begin{aligned} \text{Minimise}\quad & f(x_1,x_2)=x_1^2+x_2^2+x_1x_2-5x_2\\ \text{subject to}\quad & x_1+2x_2=5. \end{aligned} \]

  1. Write down the Lagrangian formula \(L(x_1,x_2,\lambda)\).

\[ L(x_1,x_2,\lambda) = x_1^2+x_2^2+x_1x_2-5x_2 -\lambda(x_1+2x_2-5). \]

  1. Determine all constraints of \(L(x_1,x_2,\lambda)\).

\[ \frac{\partial L}{\partial x_1} = 2x_1+x_2-\lambda, \]

\[ \frac{\partial L}{\partial x_2} = 2x_2+x_1-5-2\lambda, \]

\[ \frac{\partial L}{\partial \lambda} = -x_1-2x_2+5, \]

with

\[ x_1+2x_2-5=0, \qquad \lambda>0. \]

  1. Find the values of \(x_1\) and \(x_2\).

\[ 2x_1+x_2-\lambda=0, \tag{1} \]

\[ 2x_2+x_1-5-2\lambda=0, \tag{2} \]

\[ -x_1-2x_2+5\lambda=0. \tag{3} \]

Using (1) and (2),

\[ 2x_1+x_2 = \frac12(2x_2+x_1-5), \]

which gives

\[ x_1=-\frac53. \tag{4} \]

Substituting (4) into (3),

\[ x_2=\frac{11}{3}. \]

Hence,

\[ \boxed{x_1=-\frac53,\qquad x_2=\frac{11}{3}}. \]


Part C: Critical Points of Functions

For each function below:

  1. Find all critical points by setting the partial derivatives to zero.
  2. Form the Hessian matrix at each critical point.
  3. Classify each critical point as a local minimum, local maximum, saddle point, or inconclusive using the second derivative test.

Functions:

  1. \(f(x,y)=(x-2)^2+2(y-1)^2\)

\[ \nabla f(x,y)= \begin{bmatrix} 2(x-2)\\ 4(y-1) \end{bmatrix} =0 \]

\[ f_x = 2(x-2)=0 \Rightarrow x=2 \]

\[ f_y = 4(y-1)=0 \Rightarrow y=1 \]

\[ \Rightarrow (2,1) \]

\[ H(x,y)= \begin{bmatrix} 2 & 0\\ 0 & 4 \end{bmatrix} \]

\[ \det(H-\lambda I)= \begin{vmatrix} 2-\lambda & 0\\ 0 & 4-\lambda \end{vmatrix} =0 \]

\[ (2-\lambda)(4-\lambda)=0 \implies \lambda=2,4 \]

\[ \boxed{\text{Positive definite } \Rightarrow \text{ Local minimum at }(2,1)} \]

  1. \(f(x,y)=x^3+y^3-3xy\)

\[ \nabla f(x,y)= \begin{bmatrix} 3x^2-3y\\ 3y^2-3x \end{bmatrix} =0 \]

\[ f_x = 3x^2-3y=0 \Rightarrow y=x^2 \tag{1} \]

\[ f_y = 3y^2-3x=0 \Rightarrow x=y^2 \tag{2} \]

Substituting (1) into (2), \[ x=x^4 \implies x(x^3-1)=0 \implies x=0,1 \implies (0,0),\; (1,1) \]

\[ H(x,y)= \begin{bmatrix} 6x & -3\\ -3 & 6y \end{bmatrix} \]

At \((0,0)\),

\[ H(0,0)= \begin{bmatrix} 0 & -3\\ -3 & 0 \end{bmatrix} \]

\[ (\lambda-3)(\lambda+3)=0 \implies \lambda=-3,3 \]

\[ \boxed{\text{Indefinite } \Rightarrow \text{ Saddle point at }(0,0)} \]

At \((1,1)\),

\[ H(1,1)= \begin{bmatrix} 6 & -3\\ -3 & 6 \end{bmatrix} \]

\[ (6-\lambda)^2-9=0 \implies \lambda=3,9 \]

\[ \boxed{\text{Positive definite } \Rightarrow \text{ Local minimum at }(1,1)} \]

  1. \(f(x,y)=2xy-x^4-x^2-y^2\)

\[ \nabla f(x,y)= \begin{bmatrix} 2y-4x^3-2x\\ 2x-2y \end{bmatrix} =0 \]

\[ f_y = 2x-2y=0 \Rightarrow y=x \tag{1} \]

Substituting (1) into \(f_x\), \[ f_x =2x-4x^3-2x=-4x^3=0 \implies x=0 \]

\[ \Rightarrow (0,0) \]

\[ H(x,y)= \begin{bmatrix} -12x^2-2 & 2\\ 2 & -2 \end{bmatrix} \]

At \((0,0)\),

\[ H(0,0)= \begin{bmatrix} -2 & 2\\ 2 & -2 \end{bmatrix} \]

\[ (-2-\lambda)^2-4=0 \implies \lambda=-4,0 \]

Inconclusive: maximum or saddle point \(\Rightarrow\) Try evaluating near \((0,0)\).

  • \(f(0,0) = 0\)
  • \(f(0.1,0.1) = -0.0199 < 0\)
  • \(f(-0.1,-0.1) = -0.0199 < 0\)
  • \(f(0.1,-0.1) = -0.0201 < 0\)

\[ \boxed{\text{Global maximum at }(0,0)} \]

  1. \(f(x,y)=e^{-(x^2+y^2)}\)

\[ \nabla f(x,y)= \begin{bmatrix} -2xe^{-(x^2+y^2)}\\ -2ye^{-(x^2+y^2)} \end{bmatrix} =0 \Rightarrow (0,0) \]

\[ H(x,y)= e^{-(x^2+y^2)} \begin{bmatrix} 4x^2-2 & 4xy\\ 4xy & 4y^2-2 \end{bmatrix} \]

\[ H(0,0)= \begin{bmatrix} -2 & 0\\ 0 & -2 \end{bmatrix} \]

\[ \lambda=-2,-2 \]

\[ \boxed{\text{Negative definite } \Rightarrow \text{ Local maximum at }(0,0)} \]

  1. \(f(x,y)=\sin(x)\sin(y)\)

\[ \nabla f(x,y)= \begin{bmatrix} \cos(x)\sin(y)\\ \sin(x)\cos(y) \end{bmatrix} =0 \]

\[ f_x = \cos(x)\sin(y)=0 \implies \cos(x)=0 \;\; \text{or} \;\; \sin(y)=0 \]

\[ f_y = \sin(x)\cos(y)=0 \implies \sin(x)=0 \;\; \text{or} \;\; \cos(y)=0 \]

Possible critical points occur where \[ \begin{aligned} x=n\pi&,\quad y=m\pi \quad \text{or}\\ x=\frac{\pi}{2}+n\pi&, \quad y=\frac{\pi}{2}+m\pi \end{aligned} \]

For all \(n\) and \(m\) in \(\mathbb{Z}\).

\[ \Rightarrow (0,0),\;(\pi/2, \pi/2),\;(\pi, \pi), ... \] \[ H(x,y)= \begin{bmatrix} -\sin(x)\sin(y) & \cos(x)\cos(y)\\ \cos(x)\cos(y) & -\sin(x)\sin(y) \end{bmatrix} \]

At \((0,0)\),

\[ H(0,0)= \begin{bmatrix} 0 & 1\\ 1 & 0 \end{bmatrix} \implies \lambda=-1,1 \]

\[ \boxed{\text{Indefinite } \Rightarrow \text{ Saddle point at }(0,0)} \]

At \(\left(\frac{\pi}{2},\frac{\pi}{2}\right)\),

\[ H= \begin{bmatrix} -1 & 0\\ 0 & -1 \end{bmatrix} \implies \lambda=-1,-1 \]

\[ \boxed{\text{Negative definite } \Rightarrow \text{ Local maximum}} \]

At \(\left(\frac{\pi}{2},\frac{3\pi}{2}\right)\),

\[ H= \begin{bmatrix} 1 & 0\\ 0 & 1 \end{bmatrix} \implies \lambda=1,1 \]

\[ \boxed{\text{Positive definite } \Rightarrow \text{ Local minimum}} \]

  1. \(f(x,y)=\ln(1+x^2+y^2)\)

\[ \nabla f(x,y)= \frac{1}{1+x^2+y^2} \begin{bmatrix} 2x\\ 2y \end{bmatrix} =0 \implies (0,0) \]

\[ H(x,y)=\begin{bmatrix} \frac{2(1+x^2+y^2)-4x^2}{(1+x^2+y^2)^2} & \frac{-4xy}{(1+x^2+y^2)^2} \\ \frac{-4xy}{(1+x^2+y^2)^2} & \frac{2(1+x^2+y^2)-4y^2}{(1+x^2+y^2)^2} \end{bmatrix} \]

\[ H(0,0)= \begin{bmatrix} 2 & 0\\ 0 & 2 \end{bmatrix} \implies \lambda=2,2 \]

\[ \boxed{\text{Positive definite } \Rightarrow \text{ Local minimum at }(0,0)} \]

  1. \(f(x,y,z)=x^2+y^2-z^2\)

\[ \nabla f(x,y,z)= \begin{bmatrix} 2x\\ 2y\\ -2z \end{bmatrix} =0 \implies (0,0,0) \]

\[ H(x,y,z)=\begin{bmatrix} 2 & 0 & 0\\ 0 & 2 & 0\\ 0 & 0 & -2 \end{bmatrix} = H(0,0,0) \implies \lambda=2,2,-2 \]

\[ \boxed{\text{Indefinite } \Rightarrow \text{ Saddle point at }(0,0,0)} \]


Part D: Lagrange Multipliers

Use the method of Lagrange multipliers to find and classify the extrema, local or global, for the following problems.

  1. \(f(x,y)=x^2+y^2\), subject to \(x+y=1\).

\[ L(x,y,\lambda)=x^2+y^2-\lambda(x+y-1) \]

\[ L_x=2x-\lambda=0 \tag{1} \]

\[ L_y=2y-\lambda=0 \tag{2} \]

\[ L_\lambda=-(x+y-1)=0 \tag{3} \]

From (1) and (2), \[ 2x=2y \Rightarrow x=y \]

Substituting \(x=y\) into (3), \[ 2x=1 \Rightarrow x=\frac12 \implies \left(\frac12,\frac12\right) \]

\[ f(\frac12,\frac12)=\frac14+\frac14=\frac12 \]

Since \(f(x,y)\) is a convex function and the constraint is linear, the critical point is a global minimum. \[ \boxed{\text{Global minimum at }\left(\frac12,\frac12\right)} \]

  1. \(f(x,y)=xy\), subject to \(x^2+y^2=1\).

\[ L(x,y,\lambda)=xy-\lambda(x+y^2-1) \]

\[ L_x=y-2x\lambda=0 \implies y = 2x\lambda \tag{1} \]

\[ L_y=x-2y\lambda=0 \tag{2} \]

\[ L_\lambda=-(x+y^2-1)=0 \tag{3} \]

Substitute (1) into (2):

\[ x-4x\lambda^2=0 \Rightarrow x(1-4\lambda^2)=0 \]

\[ \Rightarrow x=0 \;\; \text{or} \;\; \lambda=\pm\frac12 \]

Substitute \(x=0\) into (3)

\[ y = \pm 1 \implies (0,1), (0,-1) \]

Substitute \(\lambda=\pm\frac12\) into (1) \[ y = \pm x \]

Substitute \(y=x\) into (3)

\[ 2x^2 - 1 = 0 \Rightarrow x = \pm \frac{1}{\sqrt{2}} \Rightarrow \left(\pm\frac{1}{\sqrt{2}}, \pm\frac{1}{\sqrt{2}}\right) \]

Substitute \(y=-x\) into (3)

\[ 2x^2 - 1 = 0 \Rightarrow x = \pm \frac{1}{\sqrt{2}} \Rightarrow \left(\pm\frac{1}{\sqrt{2}}, \mp\frac{1}{\sqrt{2}}\right) \]

Evaluate \(f(x,y)\) at each critical point: \[ \begin{aligned} f(0,\pm 1) &= 0, \\ f\left(\frac{1}{\sqrt{2}}, \frac{1}{\sqrt{2}}\right) &= \frac{1}{2}, \quad f\left(-\frac{1}{\sqrt{2}}, -\frac{1}{\sqrt{2}}\right) = \frac{1}{2}, \\ f\left(\frac{1}{\sqrt{2}}, -\frac{1}{\sqrt{2}}\right) &= -\frac{1}{2}, \quad f\left(-\frac{1}{\sqrt{2}}, \frac{1}{\sqrt{2}}\right) = -\frac{1}{2} \end{aligned} \]

\[ \boxed{\text{Local maximum at } \left(\frac{1}{\sqrt{2}}, \frac{1}{\sqrt{2}}\right), \left(-\frac{1}{\sqrt{2}}, -\frac{1}{\sqrt{2}}\right)} \]

\[ \boxed{\text{Local minimum at } \left(\frac{1}{\sqrt{2}}, -\frac{1}{\sqrt{2}}\right), \left(-\frac{1}{\sqrt{2}}, \frac{1}{\sqrt{2}}\right)} \]

\[ \boxed{\text{Saddle point at } (0,1), (0,-1)} \]

  1. \(f(x,y)=x^2+4xy+y^2\), subject to \(x+y=3\).

\[ L(x,y,\lambda)=x^2+4xy+y^2-\lambda(x+y-3) \]

\[ L_x=2x+4y-\lambda=0 \tag{1} \]

\[ L_y=4x+2y-\lambda=0 \tag{2} \]

\[ L_\lambda=-(x+y-3)=0 \tag{3} \]

From (1) and (2),

\[ 2x+4y=4x+2y \]

\[ x=y \]

Substitute into (3):

\[ 2x=3 \]

\[ x=\frac32, \qquad y=\frac32 \Rightarrow \left(\frac32,\frac32\right) \] \[ f(\frac32,\frac32)=13.5 \]

\[ \boxed{\text{Global maximum at } \left(\frac32,\frac32\right)} \]

  1. \(f(x,y)=e^{xy}\), subject to \(x^2+y^2=1\).

\[ L(x,y,\lambda)=e^y-\lambda(x^2+y^2-1) \]

\[ L_x=-2x\lambda=0 \implies \lambda = e^y/2x \tag{1} \]

\[ L_y=e^y-2y\lambda=0 \implies \lambda = e^x/2y \tag{2} \]

\[ L_\lambda=-(x^2+y^2-1)=0 \tag{3} \]

Equate (1) = (2) gives,

\[ x=y^2 \]

Substitute into (3):

\[ x^2 + x - 1 = 0 \]

\[ x = \frac{-1 \pm \sqrt{1 - 4(1)(-1)}}{2} = \frac{-1 \pm \sqrt{5}}{2} \]

Only positive root is valid since \(x=y^2 \ge 0\), so \[ \left(\frac{-1+\sqrt{5}}{2}, \pm \sqrt{\frac{-1+\sqrt{5}}{2}}\right) = (0.618, \pm 0.786) \]

\[ f(0.618, 0.786) \approx 1.458 \]

\[ f(0.618, -0.786) \approx -1.458 \]

\[ \boxed{\text{Global maximum at }(0.618, 0.786)} \]

\[ \boxed{\text{Global minimum at }(0.618, -0.786)} \]

  1. \(f(x,y)=x^3y\), subject to \(x^2+y^2=1\).

\[ L(x,y,\lambda)=x^3y-\lambda(x^2+y^2-1) \]

\[ L_x=3x^2y-2x\lambda=0 \implies \lambda = \frac{3x^2y}{2x} = \frac{3xy}{2} \tag{1} \]

\[ L_y=x^3-2y\lambda=0 \implies \lambda = \frac{x^3}{2y} \tag{2} \]

\[ L_\lambda=-(x^2+y^2-1)=0 \tag{3} \]

Equate (1) = (2) gives,

\[ \frac{3xy}{2} = \frac{x^3}{2y} \Rightarrow x(x^2-3y^2) = 0 \Rightarrow x = 0 \;\; \text{or} \;\; x^2 = 3y^2 \]

Substitute \(x=0\) into (3): \[ y^2-1 = 0 \Rightarrow y = \pm 1 \rightarrow (0,\pm 1) \]

Substitute \(x^2=3y^2\) into (3):

\[ 4y^2-1 = 0 \Rightarrow y = \pm \frac{1}{2} \Rightarrow \left(\pm\frac{\sqrt{3}}{2}, \frac12\right), \left(\pm\frac{\sqrt{3}}{2}, -\frac12\right) \]

Evaluate \(f(x,y)\) at each critical point: \[ \begin{aligned} f(0,\pm 1) &= 0, \\ f\left(\frac{\sqrt{3}}{2}, \frac12\right) &= \frac{3\sqrt{3}}{16}, \quad f\left(-\frac{\sqrt{3}}{2}, -\frac12\right) = \frac{3\sqrt{3}}{16}, \\ f\left(\frac{\sqrt{3}}{2}, -\frac12\right) &= -\frac{3\sqrt{3}}{16}, \quad f\left(-\frac{\sqrt{3}} {2}, \frac12\right) = -\frac{3\sqrt{3}}{16} \end{aligned} \]

\[ \boxed{\text{Saddle point at }(0,1), (0,-1)} \]

\[ \boxed{\text{Global maxima at } \left(\frac{\sqrt{3}}{2}, \frac12\right), \left(-\frac{\sqrt{3}}{2}, -\frac12\right)} \]

\[ \boxed{\text{Global minima at } \left(\frac{\sqrt{3}}{2}, -\frac12\right), \left(-\frac{\sqrt{3}}{2}, \frac12\right)} \]

  1. \(f(x,y)=\sin(x)+\cos(y)\), subject to \(x+y=\pi/2\).

\[ L(x,y,\lambda) = \sin(x)+\cos(y)-\lambda(x+y-\pi/2) \]

\[ L_x = \cos(x) - \lambda = 0 \tag{1} \]

\[ L_y = -\sin(y) - \lambda = 0 \tag{2} \]

\[ L_\lambda = -(x+y-\pi/2) = 0 \tag{3} \] From (1) and (2),

\[ \cos(x) + \sin(y) = 0 \tag{4} \]

From (3) \[ y = \frac\pi2 -x \]

Substitute in to (4):

\[ \cos(x) + \sin\left(\frac\pi2 - x\right) = 0 \]

Use identity: \(\sin\left(\frac\pi2 - x\right) = \cos(x)\)

\[ \cos(x) + \cos(x) = 2\cos(x) = 0 \Rightarrow \cos(x)=0 \]

\[ x = \frac\pi2 + n\pi, \quad y = -n\pi, \quad n \in \mathbb{Z} \]

\[ \Rightarrow (\frac\pi2,0), (\frac{3\pi}{2}, -\pi), (\frac{5\pi}{2}, -2\pi), ... \]

Evaluate \(f(x,y)\) at each critical point:

\[ \begin{aligned} f\left(\frac\pi2,0\right) &= 1, \\ f\left(\frac{3\pi}{2}, -\pi\right) &= -1, \\ f\left(\frac{5\pi}{2}, -2\pi\right) &= 1, ... \end{aligned} \]

\[ \boxed{\text{Global maxima at }\left(\frac\pi2,0\right), \left(\frac{5\pi}{2}, -2\pi\right), ...} \]

\[ \boxed{\text{Global minima at }\left(\frac{3\pi}{2}, -\pi\right), \left(\frac{7\pi}{2}, -3\pi\right), ...} \]

  1. \(f(x,y,z)=x+y+z\), subject to \(x^2+y^2+z^2=1\).

\[ L(x,y,z,\lambda)=x+y+z-\lambda(x^2+y^2+z^2-1) \]

\[ L_x=1-2\lambda x=0 \tag{1} \]

\[ L_y=1-2\lambda y=0 \tag{2} \]

\[ L_z=1-2\lambda z=0 \tag{3} \]

\[ L_\lambda=-(x^2+y^2+z^2-1)=0 \tag{4} \]

From (1), (2), and (3),

\[ 2\lambda x=2\lambda y=2\lambda z=1 \]

\[ x=y=z \]

Substitute into (4):

\[ 3x^2=1 \]

\[ x=\pm\frac1{\sqrt3} \]

Thus,

\[ (x,y,z)= \left(\frac1{\sqrt3},\frac1{\sqrt3},\frac1{\sqrt3}\right), \left(-\frac1{\sqrt3},-\frac1{\sqrt3},-\frac1{\sqrt3}\right) \]

\[ f\left(\frac1{\sqrt3},\frac1{\sqrt3},\frac1{\sqrt3}\right) = \sqrt3 \]

\[ f\left(-\frac1{\sqrt3},-\frac1{\sqrt3},-\frac1{\sqrt3}\right) = -\sqrt3 \]

\[ \boxed{ \text{Global maximum at } \left(\frac1{\sqrt3},\frac1{\sqrt3},\frac1{\sqrt3}\right) } \]

\[ \boxed{ \text{Global minimum at } \left(-\frac1{\sqrt3},-\frac1{\sqrt3},-\frac1{\sqrt3}\right) } \]


Part E: KKT Conditions

Use the KKT conditions to find and classify the extrema for the following problems. For inequalities, rewrite them in the form \(g(x)\le 0\) if necessary.

Question 1

\[ \begin{aligned} \text{Minimise}\quad & f(x,y)=(x-1)^2+(y-2)^2\\ \text{subject to}\quad & -x-y+3\le 0,\\ & -x\le 0. \end{aligned} \]

This is a case of two inequality constraints

Step 1: KKT Conditions

I. Stationarity:

\[ \begin{aligned} \nabla L &= \nabla f + \lambda_1 \nabla g_1 + \lambda_2 \nabla g_2 = 0 \\ &= \begin{bmatrix} 2(x-1) \\ 2(y-2) \end{bmatrix} + \lambda_1 \begin{bmatrix} -1 \\ -1 \end{bmatrix} + \lambda_2 \begin{bmatrix} -1 \\ 0 \end{bmatrix} = \begin{bmatrix} 0 \\ 0 \end{bmatrix} \\ \end{aligned} \] \[ L_x = 2(x-1) - \lambda_1 - \lambda_2 = 0 \tag{1} \]

\[ L_y = 2(y-2) - \lambda_1 = 0 \tag{2} \]

  1. Primal feasibility:

\[ g_1(x,y) \le 0, \quad g_2(x,y) \le 0. \]

  1. Dual feasibility:

\[ \lambda_1, \lambda_2 \ge 0. \]

  1. Complementary slackness:

\[ \lambda_1 g_1(x,y) = 0, \quad \lambda_2 g_2(x,y) = 0. \]

Step 2: Case Analysis (primal feasibility and complementary slackness)

  • Case 1: \(g_1\) and \(g_2\) active (i.e. \(g_1 = g_2 = 0\))

\[ g_1 = 0 \implies -x-y+3=0, \Rightarrow x+y=3 \]

\[ g_2 = 0 \implies x=0 \Rightarrow (0, 3) \]

Check (1): \[ -2-\lambda_1-\lambda_2 = 0 \Rightarrow \lambda_1 + \lambda_2 = -2 \]

Not possible since \(\lambda_1, \lambda_2 \ge 0\).

\(\Rightarrow\) infeasible dual variables condition III.

  • Case 2: \(g_1\) active, \(g_2\) inactive (i.e. \(g_1 =0, \lambda_2=0\))

From (1) and (2),

\[ 2(x-1) = 2(y-2) \Rightarrow x = y-1 \]

Substitute into \(g_1=0\):

\[ -(y-1) - y + 3 = 0 \Rightarrow y = 2 \Rightarrow (1,2) \]

Check condition II: \[ \begin{aligned} g_1 &= -1-2+3=0 \Rightarrow \text{active, feasible} \\ g_2 &= -1 \le 0 \Rightarrow \text{inactive, feasible} \end{aligned} \]

Check (1) and (2): \[ \lambda_1 = 0, \quad \lambda_2 = 0 \implies \text{Feasible dual variables} \]

\(\Rightarrow\) Candidate point \((1,2)\) satisfies all KKT conditions.

  • Case 3: \(g_2\) active, \(g_1\) inactive (i.e. g_2=0, _1 =0)

\[ g_2 = 0 \Rightarrow x = 0 \]

Check (1) \[ 2(0-1)-\lambda_2 = 0 \Rightarrow \lambda_2 = -2 < 0 \]

\(\Rightarrow\) Infeasible dual variables condition III.

  • Case 4: \(g_1\) and \(g_2\) inactive (i.e. \(\lambda_1 = \lambda_2 = 0\))

From (1) and (2),

\[ 2(x-1)= 2(y-2) \implies x = y-1 \]

Check condition II: \[ g_1 = -1 -2 +3 = 0 \implies \text{active, not feasible} \]

This contradicts case 4 assumption

\(\Rightarrow\) Infeasible primal variables condition II.

Therefore, the only candidate point is \((1,2)\).

\[ f(1,2)=0 \]

\[ \boxed{\text{Global minimum at }(1,2)} \]

Question 2

\[ \begin{aligned} \text{Maximise}\quad & f(x,y)=\ln(x)+\ln(y)\\ \text{subject to}\quad & x+y-1=0,\\ & -x\le 0,\\ & -y\le 0. \end{aligned} \]

Step 1: KKT Conditions

I. Stationarity:

\[ \nabla L = \nabla f + \lambda \nabla h + \mu_1 \nabla g_1 + \mu_2 \nabla g_2 = 0 \]

\[ L_x = -\frac1x + \lambda - \mu_1 = 0 \tag{1} \]

\[ L_y = -\frac1y + \lambda - \mu_2 = 0 \tag{2} \]

  1. Primal feasibility: \(h=0, g_1 \le 0, g_2 \le 0\)

  2. Dual feasibility: \(\mu_1, \mu_2 \ge 0\)

  3. Complementary slackness: \(\mu_1(-x) = 0, \mu_2(-y) = 0\)

Step 2: Case Analysis (primal feasibility and complementary slackness)

Note that \(g_1\) and \(g_2\) cannot be active since \(1/x\) and \(1/y\) are undefined at \(x=0\) and \(y=0\). Therefore, we have only one case to consider:

  • Case 1: \(g_1\) and \(g_2\) inactive (i.e. \(\mu_1 = \mu_2 = 0\))

From (1) and (2),

\[ x=y \]

Substitute in to \(h\),

\[ 2x=1 \Rightarrow \left(\frac12, \frac12\right) \]

This already satisfies all KKT conditions.

\[ \boxed{\text{Global maximum }f = -1.386 \text{ at }\left(\frac12, \frac12\right)} \]

Question 3

\[ \begin{aligned} \text{Minimise}\quad & f(x,y)=e^x+e^y\\ \text{subject to}\quad & x+y=0,\\ & x-1\le 0. \end{aligned} \]

\(\therefore\) Global minimum \(f = 2\) at \((0,0)\).

Note that (1, -1) does not satisfy the KKT conditions.

Question 4

\[ \begin{aligned} \text{Minimise}\quad & f(x,y,z)=x^2+y^2+z^2\\ \text{subject to}\quad & x+y+z-1=0,\\ & -x\le 0. \end{aligned} \]

\(\therefore\) Global minimum \(f = 1/3\) at \((1/3,1/3,1/3)\).

Note that (0, 1/2, 1/2) does not satisfy the KKT conditions.