Understanding Lagrange Multipliers Visually

Sdílet
Vložit
  • čas přidán 22. 08. 2021
  • When you first learn about Lagrange Multipliers, it may feel like magic: how does setting two gradients equal to each other with a constant multiple have anything to do with finding maxima and minima? Here's a visual explanation.
    ~~~
    This video was funded by Texas A&M University as part of the Enhancing Online Courses grant.
    ~~~
    The animations in this video were mostly made with a homemade Python library called "Morpho". You can find the project here:
    github.com/morpho-matters/mor...

Komentáře • 304

  • @scalex1882
    @scalex1882 Před rokem +421

    This is one of these things where you are sitting in university, getting fed the final formula with an absolutely insane proof of the formula that makes you question reality and when you see this video it takes no more than 10 minutes to understand the entire concept. Absolutely incredible, thank you so much!

    • @lehninger2691
      @lehninger2691 Před rokem

      Wait, you guys are getting an absolutely insane proof???

    • @ico-theredstonesurgeon4380
      @ico-theredstonesurgeon4380 Před rokem +8

      Why the heck dont they teach these things visually in university?? This video is literally higher quality education for free. It makes no sense at all

    • @pyropulseIXXI
      @pyropulseIXXI Před rokem +12

      You should start reading the textbook and doing the proof yourself. This stuff in the video is basically just straight from the textbook. As for visualizations, you should be visualizing this stuff in your head.
      If your 'learning method' is to just sit in lecture and let a professor program you, you won't ever learn anything, which is why you'll be confused all the time until someone basically does the learning for you (like this video).

    • @ico-theredstonesurgeon4380
      @ico-theredstonesurgeon4380 Před rokem +14

      @@pyropulseIXXI that's true but I would argue that sometimes visualisations really speed up the learning process, and teachers are often not the best at drawing.

    • @ahmedbenmbarek9938
      @ahmedbenmbarek9938 Před rokem +2

      ​@@ico-theredstonesurgeon4380it is not free it is sponsored by a university.
      The main issue with understanding math is to have a teacher who really understands maths to begin with. Most math teachers are simple folks looking for a fat salary. Maybe themselves do not understand the concept so they simply regurgitate what another teacher did to them.
      Anyway all thanks to CZcams that allowed brilliant teacher to explain mathematics from simplest concepts to the most complicated ones.

  • @GiulioDean
    @GiulioDean Před 7 měsíci +23

    I'm doing a PhD in aerospace engineering and never have I seen a video so clear on this topic. chapeau!

  • @rintepis9290
    @rintepis9290 Před rokem +166

    I am so impressed by how clear this video manages to explain the intuition behind the Lagrange Multipliers. The only part I had to pause and ponder is to show the gradient of f must be perpendicular to the level curve when the point is a local maximum on the boundary curve.

    • @shouligatv
      @shouligatv Před rokem

      Same, if anyone has an intuitive explanation, please do share it !

    • @jozsefnemeth935
      @jozsefnemeth935 Před rokem +3

      @@shouligatv it was explained by the ball on the slope: a perpendicular barrier to the ball trajectory will stop the ball, hence the barrier is in the horizontal plane.

    • @gdvirusrf1772
      @gdvirusrf1772 Před rokem +9

      @@shouligatv If you imagine the parametrized curve of the boundary of f(x,y), you'll know that the maxima/minima occur at points where the derivative of the parametrized curve is equal to 0 (the single variable calculus way of solving the problem). The thing is, if the derivative is nonzero, then it must either point to the right (positive derivative) or to the left (negative derivative) on the parametrized curve. But this must also mean the gradient vector on the actual function f(x,y) itself must _also_ point to the right or left!
      Another way to say this is that for a point on the boundary of f(x,y), any deviation in the gradient vector away from perpendicular _must_ imply that the derivative of the parametrized curve of the boundary is nonzero at that point, and hence it _cannot_ be a max/min. So only the points where the derivative of f(x,y) is perpendicular could possibly be a max/min.

    • @sender1496
      @sender1496 Před rokem +5

      It follows from the definition of the gradient. At a local min/max, the slope of f is zero along the boundary curve, meaning that f doesn't change in that direction. The gradient gives you the direction and magnitude in which a function changes the most and is thus perpendicular to this. In other words, if the gradient were to have a component in the "boundary curve"-direction (ie not perpendicular), then surely it couldn't have slope zero since f would be increasing/decreasing when wandering on the boundary.

    • @jozsefnemeth935
      @jozsefnemeth935 Před rokem

      @@shouligatv another way to look at the problem: we search for points where a level curve of the f-surface is tangent to the constraint curve. The perpendicular to these curves belonging to the X,y plane will be the same. By definition, the gradient on the respective surfaces provides this perpendicular.

  • @StarContract
    @StarContract Před 6 dny +3

    In my opinion, good mathematical education should strive to develop your mathematical intuition, which in turn you would be able to turn into formality. This video is literally perfect.

  • @leonvonmoltke7923
    @leonvonmoltke7923 Před 2 lety +70

    I would like to say that it is not often that people explain things better than khan academy. Well done sir.

    • @NemoTheGlover
      @NemoTheGlover Před 2 lety +11

      once you go past Cal I, khan academy content isint that great in my opinion

    • @agrajyadav2951
      @agrajyadav2951 Před rokem +2

      @@NemoTheGlover what

  • @CG119Animator
    @CG119Animator Před 13 dny +2

    That explanation was stellar! You broke down a tough concept without frying anyone's brain cells.

  • @omargaber3122
    @omargaber3122 Před rokem +8

    I can't believe I managed to understand Lagrange Multipliers after all these years!!!!!!!
    , how magical math is when it's understood, thank you so much

  • @hatelovebowel4571
    @hatelovebowel4571 Před 2 lety +23

    this is fking amazing. The best explanation and Calculus should be taught with geometry, it is so clear.

  • @richardvondracek496
    @richardvondracek496 Před 4 měsíci +8

    I have been waiting for this video my whole life.
    Although I did many calculations with Lagrange multipliers in my life It never clicked in my brain the way other things did.
    Close to half century old and you have just completed my brain. ♥♥
    Thank you so much for this. ♥♥
    Damn.. this feel good. You are my new hero!!

  • @firstkaransingh
    @firstkaransingh Před rokem +71

    I salute you for taking a complex concept and breaking it down to understand at a very basic level.
    More power to you.

  • @egeecagan
    @egeecagan Před 7 dny +1

    best explanation ever without killing some of my brain cells

    • @verracaelum5258
      @verracaelum5258 Před 5 dny

      agam bu tarz animasyonlarla anlatan başka bildiğin kanallar var mı bu adamın az videosu varmış böyle

  • @krittaprottangkittikun7740
    @krittaprottangkittikun7740 Před 2 lety +13

    This video is way underrated, it is very clear and nice!

    • @SerpentineIntegral
      @SerpentineIntegral  Před 2 lety +5

      @joseph ramos Hey, hello! I still make new videos, but not on this channel anymore. I put all my new stuff on a new channel called Morphocular. You can find it here: czcams.com/channels/u7Zwf4X_OQ-TEnou0zdyRA.html

  • @Murphyalex
    @Murphyalex Před rokem +12

    That whole framing in terms of terrain, seas and what counts as the shoreline are fantastic metaphors to aid the conceptual understanding of this method. Very, very well represented, here.

  • @derrick20
    @derrick20 Před rokem +7

    A neat way to conceptualize this idea is to think of the constraint function as a filter of sorts, since we know every point along the constraint curve has a gradient perpendicular to the curve (this can also be understood in the sense that everything is a local extremum, since they are all equal, so the direction of max increase shouldn’t be biased to either side similar to the ball analogy in the video).
    So, when setting the gradients of the two functions equal, we just filter only the extreme in the objective function

  • @dannis5165
    @dannis5165 Před 3 měsíci

    that rolling ball analogy is so insane. i never understood a concept more clearly before.

  • @boutainabenhmida6071
    @boutainabenhmida6071 Před rokem +2

    never seen a visual explanation better than this

  • @klevisimeri607
    @klevisimeri607 Před rokem +3

    This video is more valuable than gold!

  • @qwerasdliop2810
    @qwerasdliop2810 Před rokem +5

    Absolutely incredible! Can't believe something so simple yet incredible was fit into such a simple set of equations, just under the surface!

  • @JulianHarris
    @JulianHarris Před 3 měsíci +2

    Outstanding. Just spent a whole morning trying to understand these things and the visualisations really really crystallise the relationships. Obviously this is an advanced topic and the prerequisites involve simultaneous equations, a little bit of linear algebra and partial derivatives. But once you’re in that position, I think this is possibly the best way to understand Lagrange multipliers.

  • @alperyldrm4788
    @alperyldrm4788 Před rokem

    That is wonderful how you visualize and construct the idea step by step! Grateful!

  • @eklhaft4531
    @eklhaft4531 Před 4 měsíci

    I have no idea why they couldn't explain it like this at the university instead of just throwing a bunch of boring letters at us but here we are. I feel like you just removed an ulcer from my brain that's been sitting there for couple of years. Thanks.❤

  • @gohanmineiro
    @gohanmineiro Před rokem +9

    Simple, clear, and concise explanation. Kudos.

  • @plekkchand
    @plekkchand Před rokem +1

    Wonderful, direct, lucid, free of affected cuteness and cosmic background music. Thank you!

  • @flatmajor6802
    @flatmajor6802 Před 3 měsíci

    This presentation of L.M is much easier than the presentation that the level curve of the max of f is tangent to the level curve of g. Completely bypasses the need to show why they would be tangent at all.
    Ty🔥

  • @ktgiahieu1
    @ktgiahieu1 Před 5 měsíci

    Thank you very much for such impressive video. The concept used to be so blurry to me, yet it is as clear as bright day now!

  • @harshal8956
    @harshal8956 Před rokem +1

    This just blew my mind. This is what I was looking for. Great work.

  • @mase4256
    @mase4256 Před 21 dnem

    That was the best explanation I’ve ever seen in multivariable calculus, definitely subscribing

  • @jasonspencer7267
    @jasonspencer7267 Před 2 měsíci

    This is the best explanation on this topic that I've seen, after seeking them out for years. I really wish math would be taught more like this, where the intuition comes first, and then you see how it is just notated in equations (that will then have some conceptual meaning.) _Very_ nicely done!

  • @lh2738
    @lh2738 Před rokem +1

    Thanks a lot for such a well explained and drawn video, it really helps a lot to understand the subject. This channel is pure gold.

  • @franciscorivas4036
    @franciscorivas4036 Před 11 měsíci

    Best explanation I've found so far about lagrange multipliers. Thank you.

  • @user-dz9eb7fu2f
    @user-dz9eb7fu2f Před 2 lety +9

    Very clearly explained, this clarified a lot for me thank you so much

  • @davidebic
    @davidebic Před rokem +1

    This is exactly the intuition I had trying to understand Lagrange Multipliers!

  • @KYosco
    @KYosco Před 6 měsíci

    That makes it extremely intuitive! I don't think one can explain it any better than that.

  • @gossipGirlMegan
    @gossipGirlMegan Před rokem +1

    Excellent work I ever met ! Tanks a lot ,deer professor!!!

  • @NicolasMartinezAngulo
    @NicolasMartinezAngulo Před 7 měsíci

    Could not have explained it any better. Probably top 3 math videos I've ever seen.

  • @zhuleung2938
    @zhuleung2938 Před rokem +2

    excellent work. you've just made me understand what confuse me throughout my whole collage life.

  • @rhke6789
    @rhke6789 Před 6 měsíci

    Best explanation of Lagrange multipliers on CZcams. Congrats and thank you

  • @breitbandfunker4332
    @breitbandfunker4332 Před rokem +2

    best video for understanding lagangian multipliers - now i understood it :-)

  • @meirgold
    @meirgold Před rokem +2

    Excellent and clear explanation. Thanks very much!

  • @zacharydavis4398
    @zacharydavis4398 Před rokem +1

    Solid content 👍🏾Thanks for spending the time to create and share 🤙🏾

  • @anthonytafoya3451
    @anthonytafoya3451 Před rokem +2

    Wow! Thank you for this video. Visuals GO A LONG WAY my brother. Cheers and you have a new subscriber :)

  • @christostsaggaras1821
    @christostsaggaras1821 Před 13 dny

    Read the Wikipedia article and then came back here. While there it was fairly understandable, here the explanation was absolutely brilliant.

    • @pyropulseIXXI
      @pyropulseIXXI Před 12 dny

      I'm sure this video did absolutely nothing for your ability to actually solve problems. That is, you didn't learn anything; you only felt like you did

  • @agaz1985
    @agaz1985 Před 3 měsíci

    This is THE way to explain things. Thanks!

  • @VectorSpace33
    @VectorSpace33 Před 2 měsíci

    This video was executed perfectly. Great job.

  • @sandeepmandrawadkar9133
    @sandeepmandrawadkar9133 Před 5 měsíci

    Unbelievably super simplified explanation 👏

  • @autumnreed2079
    @autumnreed2079 Před 6 měsíci

    This is beautiful! I wanted something to help me explain Lagrange Multipliers better as a tutor and this was brilliant. Thanks

  • @jmajumder15
    @jmajumder15 Před 2 lety

    Amazing explanation !
    Pure gold

  • @yendrian44
    @yendrian44 Před 8 měsíci

    Holy shit when you said that lamda in this case is called the Lagrange multiplier I could literally feel the creation of new neuron connections in my brain. This video is a masterpiece

  • @Speak4Yourself2
    @Speak4Yourself2 Před 10 měsíci

    Outstanding visuals. Thanks a lot!

  • @LucaSalemi
    @LucaSalemi Před rokem +1

    Brilliant explanation and visuals!

  • @canowow11
    @canowow11 Před rokem +1

    really good video on a difficult math problem, but visually you made it easy

  • @user-wr4yl7tx3w
    @user-wr4yl7tx3w Před rokem +1

    Wow, that is really well and clearly explained.

  • @user-ky5ve8ss3x
    @user-ky5ve8ss3x Před 2 lety +1

    every teacher should teach like this! very excellent illustration

  • @NoNTr1v1aL
    @NoNTr1v1aL Před rokem +2

    Absolutely amazing video! Subscribed.

  • @paulgerlach2625
    @paulgerlach2625 Před rokem

    insane video. cant express how much this helped me

  • @trippymccube8735
    @trippymccube8735 Před 2 lety

    This video made my brain tingle, thank you very much!

  • @jackyyeh8763
    @jackyyeh8763 Před 5 měsíci

    Fantastic explanation. Thanks!

  • @chamnil8666
    @chamnil8666 Před 2 lety +2

    very very useful and amazing explanation.Thank you so very much.

  • @kaytea2983
    @kaytea2983 Před 4 měsíci

    Very nice for developing intuition re Lagrange multipliers.

  • @Words-.
    @Words-. Před 7 měsíci

    The visuals are soooo well done

  • @mehdiardavan
    @mehdiardavan Před rokem +4

    Fantastic video. Well visualized and explained. I was just wondering what you used to make the graphical effects while showing LaTeX formula rotate in 3D?

  • @shankhasinha1444
    @shankhasinha1444 Před 4 měsíci

    Thank you so much for making this video.

  • @user-qs3ih3ll5f
    @user-qs3ih3ll5f Před rokem +1

    Thank you. I love this explanation.

  • @adwaitkesharwani3569
    @adwaitkesharwani3569 Před rokem

    Thank you for the clear explanation!

  • @ronaldjorgensen6839
    @ronaldjorgensen6839 Před rokem

    thank you for your time and persistence

  • @laodrofotic7713
    @laodrofotic7713 Před rokem

    This is a good video, congratulations on helping millions around the globe with this.

  • @atirmahmood7058
    @atirmahmood7058 Před 7 měsíci

    Awesome just awesome because of the perfect visualisation

  • @Yeahagreed
    @Yeahagreed Před rokem

    Absolutely insane. Thank you so much.

  • @suhasisroy7240
    @suhasisroy7240 Před 2 lety

    Such a great visualisation

  • @yosef7947
    @yosef7947 Před 2 lety

    The best video by far on the topic!!!

  • @vladimirkolovrat2846
    @vladimirkolovrat2846 Před rokem

    Brilliant graphics and explanation.

  • @dufrain79
    @dufrain79 Před rokem +9

    A very good informative video for beginners in optimisation. Very good entry level for understanding Lagrange Multipliers. Such a beautiful use of the Morpho library under Python.

  • @jesusfuentes7589
    @jesusfuentes7589 Před rokem

    Hats off, man, really good one. Thank you very much.

  • @cadedulaney1522
    @cadedulaney1522 Před rokem +1

    Incredible explanation this helped me so much

  • @samfriedman5031
    @samfriedman5031 Před rokem

    Amazing explanation and graphics!

  • @ilong4rennes
    @ilong4rennes Před rokem +1

    thank you so much for your extraordinary video! this helps me a lot!

  • @federicoferraro7080
    @federicoferraro7080 Před rokem +1

    Even yhough I knew the answer, this helped to visualise the concepts and even helped me make links with other concepts (fluid mechanics). So thanks a lot !

  • @englemanart
    @englemanart Před rokem

    Brilliant presentation!

  • @sidhpandit5239
    @sidhpandit5239 Před rokem

    beautifully done

  • @mahxylim7983
    @mahxylim7983 Před 2 lety

    Clearly explain! thank you so much

  • @curtpiazza1688
    @curtpiazza1688 Před 4 měsíci

    Interesting presentation! Love the graphics! 😊

  • @tranngoctuan4197
    @tranngoctuan4197 Před 9 měsíci

    Fantastic video. Thank you very much

  • @odysseus9672
    @odysseus9672 Před rokem +18

    From the point of view of finding the minimization, lambda tells you nothing. If you're working with a Lagrangian, though, then the Lagrange multiplier tells you the force needed to maintain the constraint.

    • @gaboqv
      @gaboqv Před rokem +7

      It actually also tells you how a little change in the constraint could make this max much higher or lower, in economics this is important as optima with very high sensititivity could mean that having the correct measurements of constraints is paramount.

    • @PacoCotero1221
      @PacoCotero1221 Před rokem

      Its also, in microeconomics, the marginal effect of budget variations in utility + budget constraint problems in some instances

  • @CaRmEn899
    @CaRmEn899 Před rokem

    This is just awesome. Really thanks

  • @dorol6375
    @dorol6375 Před dnem

    Idea for finding the extrema on a boundary: use that boundary's parametric equation and plug it into the function which will result in a 1d function. From that it's as trivial to fund the extrema as it would be on a 1d function!

  • @user-gr5lr7sm9e
    @user-gr5lr7sm9e Před rokem +2

    The first thing I come up with when considering Lagrange Multipliers is that it is a pure hella substitutions if the number of constraints are less than the number of dimensions..

  • @hereigoagain5050
    @hereigoagain5050 Před rokem +1

    Amazing graphics really help to understand Lagrange Multipliers. My middle name must be "Lambda" because I don't contribute to the solution :)

  • @AnimeLover-su7jh
    @AnimeLover-su7jh Před 6 měsíci +2

    It's extremely sad, how this and so many other (books, lectures, videos etc.) don't actually discuss Lagrange multiplier correctly as it was discussed by Lagrange himself.

  • @yolo2709
    @yolo2709 Před 4 měsíci

    The day I understood this with one of my friend was the day it stopped being a weird cooking recipe and Lagrange multipliers finally started to make sense!

  • @gourbiswas7176
    @gourbiswas7176 Před rokem

    Excellent, many thanks to you .

  • @yaronyahav656
    @yaronyahav656 Před 11 měsíci

    this is so so so good. thank you.

  • @Strausse12
    @Strausse12 Před 2 lety

    absolutely fantastic!

  • @harrymorris5319
    @harrymorris5319 Před 10 měsíci +1

    4:07 for Lagrange multipliers to work - need to have the constraint expressed as some expression involving x and y set equal to a constant x^2 + y^2 = 4
    6:57
    8:33
    10:30
    11:20
    The max or min of a function f(x,y) which has a constraint g(x,y) = k must occur where ∆f (gradient of f) is parallel to ∆g (gradient of g) .
    If two vectors are parallel one is a scalar multiple of another.
    So ∆f = λ ∆g and λ the scalar multiple is called the Lagrange multiplier
    How to solve 12:13

  • @AJ-et3vf
    @AJ-et3vf Před rokem

    Awesome video! Thank you!

  • @readjordan2257
    @readjordan2257 Před rokem +4

    I really enjoy this channel. I love the presentation and explanations. I watch a lot of math channels, but this one is (for me) just as good as any of them.

  • @ascanius398
    @ascanius398 Před rokem

    Thank you. I was struggling with this.

  • @NCPROF.
    @NCPROF. Před 9 měsíci

    What an impressive explanation, Thank you!

  • @youpushtoomuch7095
    @youpushtoomuch7095 Před rokem +1

    So amazing!

  • @formlessspace3560
    @formlessspace3560 Před 4 měsíci

    Amazing video!

  • @colins.9367
    @colins.9367 Před rokem

    You are a life saver, thank you!