# Homework Help: Lagrange Multipliers. Maximizing Area.

1. Apr 2, 2012

### inevitable08

1. The problem statement, all variables and given/known data
An open gutter with cross section in the form of a trapezoid with equal base angles is to be made by bending up equal strips along both sides of a long piece of metal 12 inches wide. Find the base angles and the length of the sides for maximum carrying capacity.

For more clarification the part about bending equal strips of a 12 inch wide sheet means... There are 3 sides to the trapezoid (open top) the 2 sides are equal so then we are left with a varying base.

2. Relevant equations
side length = s
base length = b

$\nabla$f = $\lambda$$\nabla$g(s,b,$\theta$)

Area of trapezoid = (1/2)(b1 + b2)h

3. The attempt at a solution
Ok first I believe this would be a function of three variables; s, b and $\theta$. This is because each one of those will have a factor on whether it fits the constraint and what the area of the trap to be.

The constraint will be:
g(s,b,$\theta$) = 2*s + b = 12

Now here's the fun part I believe:
Area = (1/2)(b1 + b2)h

if we take a part of the trapezoid thats the triangle and find h in terms of s and $\theta$:
h = s*cos($\theta$)

now we don't care about b2 since this is a top open gutter right and the constraint calls for only 3 sides of the gutter. So here I figured I would still need b2 i just need it in terms of something else.

b2 = b1 + 2*s*sin($\theta$)

so we substitute b2 and h into the original Area equation:

Area = (1/2)(b1+b1+2*s*sin($\theta$)(s*cos)

now add b1 + b1 = 2b1 and distribute the (1/2) and the s*cos($\theta$) we end up with:

Area = s*b1*cos($\theta$) + s2sin($\theta$)cos($\theta$)

whew. So now we can use our double angle formula sin(2$\theta$) = 2sin($\theta$)cos($\theta$)

Area = s*b1*cos($\theta$) + (1/2)s2sin(2$\theta$)
*this is so we can take partials easier and dont have to deal with the product rule*

Partials of F(s,b,$\theta$) = Area, then find critical points:
fs = b1*cos($\theta$) + s*sin(2$\theta$) = 0
if s = 0 then b1 = 0 or $\theta$ = pi/2

fb1 = s*cos($\theta$) = 0
s = 0 or $\theta$ = pi/2

f$\theta$ = -s*b1*sin($\theta$) + s2cos(2$\theta$) = 0
s = 0

then I started setting those equal to the g(s,b1,$\theta$) we have 4 equations 4 unknowns and start solving for various variables and substituting. It got REALLY ugly and then I stopped. Somethings not right... Chances are you haven't even read this far cause you already found a mistake :) which I hope. Cause this is just a ridiculous problem.
1. The problem statement, all variables and given/known data

2. Relevant equations

3. The attempt at a solution

2. Apr 2, 2012

### K^2

F=Area+λ(g(s,b,θ)-12), if you want to use Lagrange Multiplier method.

Alternatively, you can use up constraint early on to say that b=12-2s, and save yourself some trouble.

3. Apr 2, 2012

### inevitable08

hmm So i have two ways of doing this problem? Using Lagrange's Method and not finding the critical points or using the constraint as a substitution in my equation immediately. Sorry a little hazy on this subject.

4. Apr 2, 2012

### K^2

For Lagrange method, you were doing everything correctly, except you forgot to actually include the Lagrange multiplier. If you are having trouble with Lagrange method and aren't required to use it, substitution is a good way to circumvent it here. Your call.

By the way, I'm not sure analytic solution exists. Mathematica had no trouble spitting out numerical solution. There are 5 extremes, the one that gives maximum area, is the following.

{s -> 3.23703, b -> 5.52595, θ -> 0.284924, λ -> 3.10652}

And that gives area of 18.6391. So once you have the equations, you can check them against these, and see if they work out.

If you are curious, the other extremes included what is probably a saddle point with a greater angle of the sides, the obvious case of s=0, and the negative area solutions with angle > pi/2, otherwise equivalent to the first two cases.

5. Apr 2, 2012

### Ray Vickson

Here is my solution: I let the width be the parameter M instead of 12. The sides have length s each and the base has width b, with b + 2s = M. I measure the angle t up from the horizontal base, so the width at the top is b + 2s*cos(t) and the height is s*sin(t). The cross-sectional area is A = s*sin(t)*[b+s*cos(t)]. We want to maximize A, subject to the constraint that f = b+2s-M = 0. I let u denote the Lagrange multiplier, so L = A + u*g.

Maple 11 easily get solutions to the equations $L_b=0,\, L_s=0,\, L_t = 0:$
eq:={Lb=0,Ls=0,Lt=0}:
sol:=solve(eq,{b,s,t}):

S:=allvalues(sol);
S:={b=-2u/sqrt(3), s=-2u/sqrt(3),t=Pi/3}, {b=2u/sqrt(3),s=2u/sqrt(3),t=-Pi/3}

Substituting these into the equation g=0 gives {s=b=M/3, t = Pi/3} and {s=b=M/3,t=-Pi/3}.

Alternatively, we can ask Maple for a solution of all 4 equations in the 4 unknowns s,b,t and u. It finds 4 solutions, three of which have either t = 0 or t = Pi (so area = 0); the fourth solution has two branches: the command
allvalues(sol[4]) produces the two solutions given above.

You can also develop the solution manually. From $L_b=0 \text{ we get } u = -s \sin(t).$ Putting that into L_s gives $L_s = \sin(t)[2s \cos(t) + b - 2s],$ so either sin(t) = 0 or $b = 2s[1-\cos(t)].$ Choosing the latter in the equation L_t = 0 gives $s^2 [2 \cos(t) - 1] = 0.$ Thus, $t = \pi/3,$ then b = s, and so b = s = M/3 and t = π/3.

RGV

6. Apr 2, 2012

### inevitable08

so I don't have to use Lagrange multipliers. I can use the partials of f and substitute the constraint into each partial and then solve? Either way this seems to be a messy problem by hand with all the trig involved. This is a problem that my professor wants us to solve by hand not getting straight to it by plugging it into the computer. :/

One question is do you two agree with my area formula for a trapezoid that i derived?

7. Apr 2, 2012

### Ray Vickson

Aside from interchanging sin and cos, we are using the same formula; your angle is the complement of mine. BTW: it is better to _not_ use double-angle formulas, etc.: better by far to take derivatives first, then see if trig identities can be used to simplify things. And, of course, you don't need to use Lagrange multipliers, since you can eliminate the constraint by expressing one of the three variables in terms of the other two. However, I do believe you get simpler equations/expressions by keeping the Lagrangian form, but that is primarily a personal preference.

RGV

8. Apr 2, 2012

### K^2

And I have a perfect example of it. I entered θ instead of 2θ while typing the area formula into Mathematica, which threw the solution off. After a quick fix, it spits out the same solution that Ray provided.

9. Apr 3, 2012

### inevitable08

Wow what a problem! Thank you so much for the help you guys! I did it all by hand and it was quite long but I was able to get the same b = s = m/3 = 12/3 = 4 and the base angles to be 120° which is essentially pi/3 because i used sin(θ-90) and cos(θ-90). Thanks again for the help, it was a little hard trying to understand your notations but I finally understood what truly had to be done. This has opened my eyes to some other things I haven't seen before when solving equations like these. :D