yego.me
💡 Stop wasting time. Read Youtube instead of watch. Download Chrome Extension

Lagrange multiplier example, part 2


4m read
·Nov 11, 2024

So where we left off, we have these two different equations that we want to solve. Um, and there's three unknowns: there's S, the tons of steel that you're using; H, the hours of labor; and then Lambda, this Lagrange multiplier we introduced that's basically a proportionality constant between the gradient vectors of the revenue function and the constraint function.

And always the third equation that we're dealing with here to solve this is the constraint itself that gives us another equation that'll help solve for H and S, and ultimately Lambda if that's something you want as well.

So as kind of a first pass here, I'm going to do a little more simplifying, but I'm going to make a substitution that'll make this easier for us. So I see S over H here, and they're both to the same power, so I feel it might be a little bit easier if I just substitute U in for S / H. What that'll let me do is rewrite this first equation here as 3/23 * U^(1/3), and that's equal to 20 * Lambda.

Then likewise, what that means for this guy is, well, this is H over S, not S over H, so that one's going to be 1003, not times U^(2/3), but times U^(-2/3) because we swapped the H and S here. So that's U^(-2/3), and this is just to make it a little bit cleaner; I think we kind of want to treat H and S in the same package.

Now let me go ahead and put all the constants together, and I'm going to take this guy and multiply it by 3, divide by 200, and multiply both sides of that just to cancel out what's on the left side here. What that's going to give me, and I'll go ahead and write it over here, kind of all over the place, U^(1/3) is equal to, let's see, 3/200. So that 20 almost cancels out with the 200; it just leaves a 10, so that's going to give me 3/10 * Lambda.

Then similarly over here, I'm going to take this whole equation and multiply it by 3 over 100, and what that's going to leave me with is that U^(-2/3) is equal to, let's see, this 2,000 when we divide by 100 becomes 20, and that 20 * 3 is 60. So that'll be 60 * Lambda.

Alright, so now I want a way to simplify each of these, and what I notice is they look pretty similar on each side. You know that it's something related to U equal to Lambda. So if I can get this in a form where I'm really isolating U, that would be great. The way I'm going to do this is I'm going to multiply each one of them by U^(2/3).

I'm going to multiply it into this guy, and I'm going to multiply it into that guy because on the top it's going to turn this into just U, which will be nice, and on the bottom, it'll cancel out that U entirely. So it feels like it'll make both of these nicer, even though it might make the right side a little uglier. Those right sides will still kind of be the same, and we'll take advantage of that.

So when I do that to the top part, like I said, that U^(1/3) * U^(2/3) ends up being U, and then on the right side we have our 3/10 * Lambda but now U^(2/3). Then on the bottom here, when I multiply it by U^(2/3), the right side becomes one because it cancels out with U^(-2/3), and the right side is 60 * Lambda * U^(2/3).

Now these right sides look very similar, and the left sides are quite simple, so I'm going to multiply this top one by whatever it takes to make it look exactly like that right side. So in this case, I'm going to multiply that top by 10, which will get it to 30, and then by another 20 to make that constant 60.

So I'm going to multiply this entire top equation by 200, and what that gives me is that 200 * U is equal to 60 * Lambda * U^(2/3). Now these two equations have the same right side, so this is the same as saying 200 * U is equal to, well, one, because each one of those expressions equals the same complicated thing.

And now, 200 * U, well that's S / H, so this is the same thing as saying 200 * (S / H) = 1, which we can write more succinctly as H is equal to 200 * S. Great! So I'm going to go ahead and circle that: H is equal to 200 * S.

Now what we apply that to is the constraint: 200 * H + 2,000 * S equals our budget. I'll go ahead and kind of write that down again: that our 20 * H, I think 20 * the hours of labor plus $2,000 per ton of steel is equal to our budget of $20,000.

Now we can just substitute in. Instead of H, I'm going to write 200S. So that's 200; sorry, 20 * 200S plus 2,000 * S is equal to 20,000. Now this right side, 20 * 200 is equal to 4,000, and I'm just going to go ahead and kind of write, so this here is 4,000S.

So the entire right side of the equation simplifies to 6,000S is equal to 20,000, and when those cancel out, what that gives us is S is equal to 20 / 6, which is the same as 10 divided by 3.

So that's how many tons of steel we should get. S is 10 over 3. Then when we apply that to the fact that H is 200 * S, that's going to mean that H is equal to 200 times that value, 10 over 3, which is equal to 2,000 over 3. That's how many hours of labor we want.

So evidently, in our original problem where we have this model for our revenue function for our widgets, with $20 per hour of labor and $2,000 per ton of steel, with a budget of $20,000, the allocation that you should make is to buy 10/3 of a ton of steel and 2,000/3 hours of labor.

More Articles

View All
Analyzing vertical asymptotes of rational functions | High School Math | Khan Academy
We’re as to describe the behavior of the function Q around its vertical asymptote at x = -3. Like always, if you’re familiar with this, I encourage you to pause it and see if you can get some practice. If you’re not, well, I’m about to do it with you. Al…
Be Like Sal: 3 Ways a Tablet Can Energize Your Digital Teaching!
Thank you so much for joining today or this evening, depending on where you’re calling from. This is Jeremy Schieffen at Khan Academy, and I’m so excited they’re joining with us because if anything at Khan Academy, 2020 has been the year of the tablet. We…
Office Hours with Kevin & Qasar at Startup School SV 2014
All right, so my name is Kevin Hail. Uh, my name is Cas Unice, and we’re Partners at Y Combinator. What that means really, Billy, is that especially when we’re not in batch, we’re out there trying to recruit and talk to as many founders as possible. In…
Who Were the Rough Riders? | Explorer
A century has passed since Washington wrote, “To be prepared for war is the most effectual means of promoting the peace.” In 1897, as Assistant Secretary of the Navy, TR finds a cause that can help him redeem his family’s honor in Cuba. A long-simmering i…
Khan Academy Ed Talks featuring Asst. Supt. Beth Gonzalez - Thursday, Dec. 17
Hi everyone! Sal here from Khan Academy. Welcome to the Ed Talks live stream subset of the Homeroom. We have a very exciting conversation with Beth Gonzalez, Assistant Superintendent of Detroit Public Schools. So, start thinking of questions for Beth, and…
Warren Buffett: How to Find Great Stocks for 2023
Okay, so you’ve seen that the market is down at the moment. You know you should be investing right now, but how on Earth do you actually find great stocks to invest in? Well, in this video, we’re going to talk about a surprisingly simple screening method …