Introduction
A linear function changes at a constant rate in each coordinate, but its maximum and minimum depend on the shape of the constraint. On an ellipse, the longest and shortest values can be found directly from the one-constraint Lagrange equations.
We will maximize and minimize \(f(x,y)=ax+by\) subject to an ellipse with positive semiaxes \(A\) and \(B\). The calculation will produce both the extremal values and the points where they occur.
The ellipse and the objective
Assume throughout that \(A>0\) and \(B>0\). The ellipse is the set of points satisfying
The positive numbers \(A\) and \(B\) are the lengths of the ellipse’s semiaxes along the \(x\)- and \(y\)-axes. The objective function is \(f(x,y)=ax+by\), where \(a,b\) are fixed real numbers. First suppose \(a\) and \(b\) are not both zero.
The ellipse is closed and bounded, hence compact, and \(f\) is continuous. The extreme value theorem therefore guarantees that \(f\) attains both a maximum and a minimum on the ellipse. Also, \(\nabla g=(2x/A^2,2y/B^2)\) is never zero on the ellipse: if it were zero, then \(x=y=0\), which does not satisfy the constraint. Thus the regular-constraint Lagrange multiplier condition applies at each extremum.
Setting up the multiplier equations
For one equality constraint, the Lagrange condition is \(\nabla f=\lambda\nabla g\) at a constrained extremum, for some real multiplier \(\lambda\). Here \(\nabla f=(a,b)\), so the system is
Since \(a\) and \(b\) are not both zero, these equations imply \(\lambda\ne 0\). If \(\lambda=0\), the first two equations would give \(a=b=0\), contrary to the assumption. We can therefore solve the first two equations for \(x\) and \(y\) without dividing by a potentially zero coefficient:
Substituting these expressions into the ellipse equation determines the possible multiplier values.
Deriving the candidate points and values
The stationarity equations give \(x=aA^2/(2\lambda)\) and \(y=bB^2/(2\lambda)\).
Substitute those coordinates into \(x^2/A^2+y^2/B^2=1\), which fixes \(\lambda^2\).
Use each multiplier value to find its feasible point and the corresponding value of \(ax+by\).
Define the positive number \(S=\sqrt{a^2A^2+b^2B^2}\). It is positive because \(A,B>0\) and \(a,b\) are not both zero. Substitution into the constraint gives
Consequently \(4\lambda^2=S^2\), so there are exactly two possible multiplier values: \(\lambda=S/2\) and \(\lambda=-S/2\). The corresponding points and objective values are as follows.
To see why these candidates are the global extrema, the existence argument guarantees that a maximum and minimum occur, and the regular-constraint condition requires each to solve the multiplier system. That system has only the two points just found. Both satisfy the ellipse constraint, as follows directly from the equation used to obtain \(S^2=4\lambda^2\). Their objective values are \(S\) and \(-S\), with \(S>0\). Thus the larger candidate is the maximum and the smaller is the minimum. This also verifies that the two points are feasible rather than merely formal solutions of part of the system.
Worked examples
Worked Example: A linear function with two nonzero coefficients
Find the maximum and minimum of \(3x+4y\) on \(x^2/4+y^2=1\). Here \(A=2\), \(B=1\), \(a=3\), and \(b=4\). First calculate
The maximizing point is
Its objective value is \(3(6/\sqrt{13})+4(2/\sqrt{13})=26/\sqrt{13}=2\sqrt{13}\). Check the constraint: \(x^2/4+y^2=(36/13)/4+4/13=9/13+4/13=1\). The multiplier is \(\lambda=S/2=\sqrt{13}\). The stationarity equations check as \(2\lambda x/A^2=2\sqrt{13}(6/\sqrt{13})/4=3\) and \(2\lambda y/B^2=2\sqrt{13}(2/\sqrt{13})=4\).
The minimizing point is the opposite point \((-6/\sqrt{13},-2/\sqrt{13})\). Its constraint value is still \(1\), its objective value is \(-26/\sqrt{13}=-2\sqrt{13}\), and it corresponds to \(\lambda=-\sqrt{13}\). Hence the maximum is \(2\sqrt{13}\) and the minimum is \(-2\sqrt{13}\).
Worked Example: A negative coefficient
Find the extrema of \(-x+2y\) on \(x^2/9+y^2/4=1\). We have \(A=3\), \(B=2\), \(a=-1\), and \(b=2\), so
The maximizing point is \((aA^2/S,bB^2/S)=(-9/5,8/5)\). Verify the constraint:
The objective there is \(-(-9/5)+2(8/5)=9/5+16/5=5\). For \(\lambda=S/2=5/2\), the first stationarity right-hand side is \(2\lambda x/A^2=5(-9/5)/9=-1\), and the second is \(2\lambda y/B^2=5(8/5)/4=2\), as required. The minimizing point is \((9/5,-8/5)\); it satisfies the same constraint and gives \(-(9/5)+2(-8/5)=-25/5=-5\). Thus the extrema are \(5\) and \(-5\).
Worked Example: One coefficient is zero
Find the extrema of \(2x\) on \(x^2+y^2/9=1\). Here \(A=1\), \(B=3\), \(a=2\), and \(b=0\). Then \(S=\sqrt{2^2\cdot1^2+0^2\cdot3^2}=2\). The maximizing point is \((2\cdot1^2/2,0\cdot3^2/2)=(1,0)\), where the objective is \(2\). The constraint check is \(1^2+0^2/9=1\), and with \(\lambda=1\), the stationarity equations give \(2\lambda x/A^2=2\) and \(2\lambda y/B^2=0\). The minimizing point is \((-1,0)\), which satisfies the constraint and gives \(-2\). The \(y\)-coordinate is zero at both extrema, even though the ellipse has a nonzero vertical semiaxis.
Why the method works and what can go wrong
The multiplier condition says that at an extremum the objective’s gradient is parallel to the constraint’s gradient. For this problem, \(\nabla f=(a,b)\) and \(\nabla g=(2x/A^2,2y/B^2)\). The resulting coordinate equations account for the different horizontal and vertical scales of the ellipse. In particular, the coordinates of the extremizing point contain \(A^2\) and \(B^2\), not just \(A\) and \(B\).
A common error is to use \(aA\) and \(bB\) in the coordinates instead of \(aA^2\) and \(bB^2\). For the first example, that incorrect rule would give \((3A/S,4B/S)=(3/\sqrt{13},2/\sqrt{13})\). But this point fails the ellipse constraint:
The correction is to solve the multiplier equations themselves: \(x=aA^2/(2\lambda)\) and \(y=bB^2/(2\lambda)\). The squared semiaxis factors follow from the derivatives of \(x^2/A^2\) and \(y^2/B^2\).
Another potential oversight is to keep only the positive multiplier. That finds the maximum but loses the minimum. The constraint determines \(\lambda^2\), not \(\lambda\), so both signs must be included. They produce opposite points and opposite objective values.
If \(a=b=0\), the objective is the constant function \(f(x,y)=0\). In that exceptional case every point on the ellipse is both a maximum and a minimum, and the formula using \(S\) would involve division by zero. This is why the theorem explicitly assumes that the coefficient pair is nonzero.
This result is useful whenever a linear quantity is optimized under an elliptical constraint. It gives an immediate way to calculate the extremal value and locate where it occurs, while also making the effect of each semiaxis explicit. The larger semiaxis contributes more strongly to the value when its corresponding objective coefficient is nonzero.
Check Your Understanding
Use the multiplier equations and the ellipse constraint to answer these questions.
- For \(2x-y\) on \(x^2/4+y^2/9=1\), what is \(S\), and where are the maximum and minimum attained?
- Why must the multiplier be nonzero when \(a\) and \(b\) are not both zero?
- What objective values correspond to the positive and negative multiplier candidates?
- For \(5y\) on \(x^2/16+y^2/4=1\), what are the extremizing points and values?
- What happens when both coefficients \(a\) and \(b\) are zero?