222 - Topic 13 - Lagrange Multiplier Example

2613 days ago by Professor222

Lagrange Multiplier example problem with two constraints

John Travis

Mississippi College

Spring 2012

Consider the ellipse

$$\frac{x^2}{a^2}+\frac{y^2}{b^2}=1$$

that encloses the circle

$$x^2+y^2 = 2x$$.

Determine values of $a$ and $b$ that minimize the area of the ellipse.

First, one must determine a formula for the area inside an ellipse.  For an ellipse in the form

$$Ax^2+By^2 + Cxy = 1$$

the area is

$$Area = \frac {2 \pi}{\sqrt{4AB-C^2}}$$

So, for the ellipse here, $A = 1/a^2$, $B = 1/b^2$ and $C = 0$ yields $Area = \pi a b$.

# problem 18 on page 982 of Larson, et. al 5th Early Transcendentals 
       

In the interactive cell below, experiment with various values of a and b so that the ellipse encloses the circle but has smallest possible area.

%hide %auto var('a,b') @interact def _(a = slider(1,3,0.02,2),b = slider(1,3,0.02,2),zoom=checkbox(False)): if zoom: G = circle((1,0),1,color='lightblue',fill=true,alpha=0.9,zorder=2) G += ellipse((0,0),a,b,color='green',thickness=3,alpha=0.5) area = (pi*a*b).n(digits=6) G += text('Ellipse area='+str(area),(1.5,1.2)) G.show(xmin=1,xmax=2,ymin=0.4,ymax=1) else: G = circle((1,0),1,color='lightblue',fill=true,alpha=0.9,zorder=2) G += ellipse((0,0),a,b,color='green',thickness=1,alpha=0.5) area = (pi*a*b).n(digits=6) G += text('Ellipse area='+str(area),(-1,0.5)) G.show() 
       
zoom 

Click to the left again to hide and once more to show the dynamic interactive window

var('a,b,x,y,alpha,mu') # Area f(a,b,x,y)=pi*a*b # The ellipse constraint g(a,b,x,y)=x^2/a^2+y^2/b^2-1 # The circle constraint h(a,b,x,y)=x^2+y^2-2*x 
       
var('a,b,x,y,alpha,mu') assume(a>0) assume(b>0) eq1 = diff(f,a) == alpha*diff(g,a)+mu*diff(h,a) eq2 = diff(f,b) == alpha*diff(g,b)+mu*diff(h,b) eq3 = diff(f,x) == alpha*diff(g,x)+mu*diff(h,x) eq4 = diff(f,y) == alpha*diff(g,y)+mu*diff(h,y) eq5 = g == 0 eq6 = h == 0 eqns = [eq1,eq2,eq3,eq4,eq5,eq6] solns = solve(eqns,(a,b,x,y,alpha,mu),solution_dict=True) for eq in eqns: eq.show() for soln in solns: soln[a],soln[b] 
       
(0, r1)
(r4, 0)
(0, 0)
(0, 0)
(r10, 0)
(0, 0)
(-3/2*sqrt(2), 1/2*sqrt(3)*sqrt(2))
(-3/2*sqrt(2), 1/2*sqrt(3)*sqrt(2))
(3/2*sqrt(2), -1/2*sqrt(3)*sqrt(2))
(3/2*sqrt(2), -1/2*sqrt(3)*sqrt(2))
(3/2*sqrt(2), 1/2*sqrt(3)*sqrt(2))
(3/2*sqrt(2), 1/2*sqrt(3)*sqrt(2))
(-3/2*sqrt(2), -1/2*sqrt(3)*sqrt(2))
(-3/2*sqrt(2), -1/2*sqrt(3)*sqrt(2))
(0, r1)
(r4, 0)
(0, 0)
(0, 0)
(r10, 0)
(0, 0)
(-3/2*sqrt(2), 1/2*sqrt(3)*sqrt(2))
(-3/2*sqrt(2), 1/2*sqrt(3)*sqrt(2))
(3/2*sqrt(2), -1/2*sqrt(3)*sqrt(2))
(3/2*sqrt(2), -1/2*sqrt(3)*sqrt(2))
(3/2*sqrt(2), 1/2*sqrt(3)*sqrt(2))
(3/2*sqrt(2), 1/2*sqrt(3)*sqrt(2))
(-3/2*sqrt(2), -1/2*sqrt(3)*sqrt(2))
(-3/2*sqrt(2), -1/2*sqrt(3)*sqrt(2))
a = 3/2*sqrt(2) b = 1/2*sqrt(2)*sqrt(3) G = circle((1,0),1,color='blue') G += ellipse((0,0),a,b) area = pi*a*b G += text('Ellipse area='+str(area.n(digits=6)),(-1,0.5)) G += text(str(a.n(digits=6)),(a+0.1,0),rotation=90) G += text(str(b.n(digits=6)),(0,b+0.1)) G.show() 
       
(3/2*sqrt(2).n(), n(1/2*sqrt(3)*sqrt(2))) 
       
(2.12132034355964, 1.22474487139159)
(2.12132034355964, 1.22474487139159)