Lagrange multipliers, using tangency to solve constrained optimization

Поделиться
HTML-код
  • Опубликовано: 20 янв 2025

Комментарии • 245

  • @Burneynator
    @Burneynator 7 лет назад +486

    Somehow you've managed to compress a 1 hour long lecture into 9 minutes long video with better explanations than my lecturer, thanks a lot! :)

    • @BROWNKEY
      @BROWNKEY 4 года назад +1

      8.42 minutes , not 9

    • @Burneynator
      @Burneynator 4 года назад +10

      @@BROWNKEY Well, all the better

    • @rhn122
      @rhn122 4 года назад

      Aye a 3 yo comment just got replied 2 days ago. Plus he's the man and the legend Grant 3Blue1Brown himself o7

    • @garyjia7703
      @garyjia7703 4 года назад

      It is the case. Lecturer in my university explain these concepts for 3 hours but still leave us confused

    • @mintylemon66
      @mintylemon66 9 месяцев назад

      @@BROWNKEY I'd say 8.7 minutes

  • @hoodarrock2453
    @hoodarrock2453 8 лет назад +201

    the new guy for khan academy is so mathematical ... I love his explanations so much they are so deep instead of just giving a set of techniques and methods on how to solve exams he gets in the core of things... that's what we always for in Khan Academy

    • @themax1234521
      @themax1234521 8 лет назад +40

      Hoodar Rock look for his own RUclips channel, 3blue1brown. Amazing explanations and great videos.

    • @jipuragi6483
      @jipuragi6483 2 года назад

      @@luffy5246 hii what is the name of that channel?

    • @astradrian
      @astradrian Год назад +9

      @@jipuragi6483 3Blue1Brown.

    • @jipuragi6483
      @jipuragi6483 Год назад +1

      @@astradrian thanks a ton

    • @bofa722
      @bofa722 Год назад

      ​@@jipuragi6483 bruh

  • @Cyrusislikeawsome
    @Cyrusislikeawsome 7 лет назад +4

    This guy is just maths bae. Best maths channel on RUclips and best Khan Academy videos for maths. what a beast.

  • @saahilnayyer6865
    @saahilnayyer6865 3 года назад +2

    Khan Academy has really revolutionized learning. Today we have so many online learning platforms and all of these are in a way off-springs of Khan Academy. Topic wise learning makes the hour long lecture approach of colleges redundant. Most professors at universities are very knowledgable no doubt but not so great educators. To be able to impart the knowledge you hold is an art. Cheers to Khan Academy.

  • @jonaqpetla_
    @jonaqpetla_ 7 лет назад +893

    Is that 3blue1brown? OMG!

    • @asadullahfarooqi254
      @asadullahfarooqi254 6 лет назад +42

      yeah i think so because he have worked for sal khan (khan academy)..

    • @perfumedsea
      @perfumedsea 6 лет назад +55

      Oh. I was thinking this voice is so not Khan and somehow very familiar. Then I saw this comment. Interesting to know ;)

    • @jinanlife
      @jinanlife 6 лет назад +25

      his iconic voice

    • @muhammadjoshua7464
      @muhammadjoshua7464 6 лет назад +3

      I was about to comment the same thing !

    • @BlackRose4MyDeath
      @BlackRose4MyDeath 5 лет назад +3

      Lol, same thought. I was like, Grant?!?

  • @spencertaylor6910
    @spencertaylor6910 6 лет назад +43

    Grant hits that yeet again. What a boss

  • @miksaile
    @miksaile 3 года назад +23

    this is divine. This just cleared my mind up 😭😭 your explanations are so clear and mathematical, yet intuitive! Thanks a lot 😊

  • @hellelo.5840
    @hellelo.5840 6 лет назад +17

    3blue1brown Congratulation, I love the fact you are working with Khan Academy, thats great...

  • @MrSkizzzy
    @MrSkizzzy 6 лет назад +8

    This was so well explained that i'd call it a masterpiece.

  • @ednaT1991
    @ednaT1991 6 лет назад +28

    With math it's always the same way: When you don't understand it, it's hell but when you got it, it's pretty cool. :)
    Thank you for such a nice explanation!

    • @missghani8646
      @missghani8646 4 года назад +1

      thats what makes mathematics beautiful

  • @garronfish8227
    @garronfish8227 2 месяца назад

    I did this in University 2nd year Maths and basically came to the conclusion that it was magic. Now I'm starting to understand it thank you so much!

  • @fjgozzi
    @fjgozzi 4 года назад +2

    I´ve just contributed pt-br subtitles, please accept them so that this great material is available to a larger audience!

  • @tinayang7351
    @tinayang7351 7 лет назад +1

    thank you for doing this. I liked that they are put into small pieces instead of a long lecture.

  • @robertcohn8858
    @robertcohn8858 4 года назад +2

    Very nicely done! I haven't done anything with math like this for 40+ years, and I was able to follow along very well. Thank you.

  • @kylewolfe_
    @kylewolfe_ 2 года назад

    Wow, was not expecting to get an explanation from Grant when I clicked on a Khan Academy video. Very cool!

  • @nevgongivuup
    @nevgongivuup Год назад

    Thanks for saving my life, Grant. You are the best.❤

  • @charliethatcher404
    @charliethatcher404 6 лет назад +1

    You legit just saved my test grade tomorrow. Cheers

  • @maxbardelang6097
    @maxbardelang6097 2 года назад +3

    4:27 Though his name may sound French, Lagrange was actually Italian. Actually he was born Italian, his birth name beeing Lagrangia, then migrated to France and changed his name.

  • @franciscorivas4036
    @franciscorivas4036 4 года назад +9

    Thank you very much!! this explanation is life-saving. I'm trying to understand Lagrange duality for support vector machines and I've watched many videos but I'm still stuck. Now I have a better taste of what it is about.

  • @mantacid1221
    @mantacid1221 7 месяцев назад

    I am literally Watching this the day before my final, and this is way better than how my textbook went about this.

  • @rfolks92
    @rfolks92 5 лет назад +30

    Lagrange was Italian. I don't know why, but we know him by his French name "Joseph Louis Lagrange" rather than his Italian name: "Giuseppe Luigi Lagrangia".

    • @liammckenna1479
      @liammckenna1479 4 года назад +7

      I thought you were joking but you're not lol, I just looked it up and it looks like he was naturalized French.

    • @joshuaflackua
      @joshuaflackua 3 года назад +1

      It's complicated. Lagrange was born in Piedmont, Italy. However, he later moved to France, and in an unrelated series of events, Piedmont was annexed by France. As a result, he gained French citizenship and French and Italians both claimed him as their own.
      As for his parentage, he actually comes from a family that is both French AND Italian, and he spent more of his life in Paris than in Piedmont.
      On a plaque that was placed on the Eiffel Tower when it opened he was listed as a "prominent French scientist", but today his place of birth still lies in Italy.
      I think if you had asked him whether he was French or Italian he would have either expounded on his indifference to nationalism, or explained that citizenship is more complicated than one's place of birth.
      It certainly doesn't seem incorrect for Grant to refer to him as French though.

  • @gigglification
    @gigglification 6 лет назад +1

    Thankyou!! It was tremendously helpful. You are saving lives here.

  • @real_john_doe
    @real_john_doe 4 года назад

    This video's example makes sense. The problems that pop up on the test are a different story.

  • @turbopotato4575
    @turbopotato4575 7 лет назад +2

    I havent watched the video yet and have no idea what Lagrange multipliers are, but here is how I'd do it:
    1=x^2 +y^2
    x=sqrt(1-y^2)
    f(x,y)=x^2y
    f(y)= (1-y^2)y= y - y^3
    f'(y)=1- 3y^2 = 0
    y = +-sqrt(1/3)
    x = +-sqrt(2/3)
    f(+ - sqrt(2/3),+ - sqrt(1/3))= + - 2*sqrt(1/3)/3

    • @turbopotato4575
      @turbopotato4575 7 лет назад +1

      And I was right. But I understand the need for a more general method to solve these since its not always this easy to express one variable explicitly from another. But this method can serve as a great shortcut.

  • @poiuwnwang7109
    @poiuwnwang7109 4 года назад +1

    f = lambda*g is super. I learned that in university, but his explanation is really insightful.

  • @NicolasSchmidMusic
    @NicolasSchmidMusic 4 года назад

    I feel so stupide for not having watched these videos when I was strugeling to understand multivariable calculus, but it still feels good to watch them in my free time :)

  • @nahblue
    @nahblue 3 года назад +1

    While the lagrange method with lambda is great to learn, it is actually a lot less gruel in examples such as these to solve the equations without involving lambda. Take the requirement grad f || grad g and write it as a determinant, det(fx fy; gx gy) == 0 grad f and grad g are parallel; that's one equation and the constraint is another equation -> two equations and two unknowns. :)

    • @joshuaflackua
      @joshuaflackua 3 года назад

      I noticed this, but my professor mentioned that there are some equations where lambda plays a role. I'm not sure what they could be though.

  • @foadabodahood9509
    @foadabodahood9509 7 лет назад +1

    Finally!! at 4:15 it all makes sense! THANK YOU

  • @learningindia6733
    @learningindia6733 2 года назад +2

    Genius, real mathematics......

  • @matlabmalayalam3288
    @matlabmalayalam3288 3 года назад +1

    World-class teaching...

  • @goclbert
    @goclbert 2 года назад

    I love how the visual makes it clear that Lagrange Multipliers are eigenvalues

  • @giorgossartzetakis8771
    @giorgossartzetakis8771 4 года назад +1

    OMG this guy is pure genious!

  • @Johncowk
    @Johncowk 4 года назад +1

    That was SO clear I cannot thank you enough.

  • @ND-kl8lo
    @ND-kl8lo 11 месяцев назад

    3Blue1Brown you are awesome bro, love it! Great teaching, and teaching voice, makes learning simpler, faster, more enjoyable, and the visuals help so much.

  • @AngeloArrifano
    @AngeloArrifano 3 года назад

    I recognize this voice ! I'm pretty sure it's Grant from the 3 Blue 1 Brown channel !!
    Excellent explanation, as always !

  • @diannebanal1650
    @diannebanal1650 8 лет назад

    This video helped me visualize everything about lagrange multipliers! thank you for posting

  • @guillermo._._
    @guillermo._._ 4 года назад

    Excellent geometric intuition!

  • @jigneshrathod3714
    @jigneshrathod3714 7 лет назад +5

    Hi.. Nice video... Can anyone share which playlist it is part of.. I want to watch the whole course and somehow suggestions that youtube gives for next video is kind of random...

  • @ddos87
    @ddos87 5 лет назад

    Khan crushing it as usual

  • @GOPALS1967
    @GOPALS1967 4 года назад +1

    Beautifully explained.

  • @mertbeser9837
    @mertbeser9837 3 года назад +1

    The explanation is perfect. I wonder which program do you use to visualize it ? Or anyone know what program is this

  • @alias40anon
    @alias40anon 7 лет назад +1

    Mate you nailed it, excellent explanation

  • @adrianpabloalvarez2523
    @adrianpabloalvarez2523 2 года назад +3

    Thank you. I understood the concept quite easily but probably not as completely as I would like. What could happen if the two surfaces have more than a point with the gradients being proportional but not touching each other? it can't happen when using the constraint itself as an equation right? but could the equations touch each other in different points?

  • @jadedjimmy
    @jadedjimmy 6 лет назад +4

    6:26 pullin out that Sal impression

  • @annang.3176
    @annang.3176 6 месяцев назад

    Beautiful explanation

  • @queenstrategy904
    @queenstrategy904 4 года назад

    Gradient is a vector with the partial derivative for x and partial derivative for y

  • @justadude8716
    @justadude8716 2 года назад

    If you are interested, this was found by Joseph-Louis Lagrange, author of Mécanique analytique matching Newton's Principia in comprehensiveness over mechanics. If you have taken physics and are familiar with Newtonian mechanics, then read "The Lazy Universe" by Jennifer Coopersmith, where she gives an introductory view into the Principle of Stationary Action and Lagrange was key in defining it. Remember: most beautiful and useful mathematics come from understanding nature, and this method you are learning does just that, it maximizes/minimizes some "thing" which is what nature loves to do.

  • @AAA-uv1ny
    @AAA-uv1ny Год назад

    thank you! the animation and explanation are awesome, it helps a lot

  • @samuelvaldezgil
    @samuelvaldezgil 2 года назад

    Im in love with this dude

  • @luciafresnopm
    @luciafresnopm 4 года назад +4

    i couldn't find "the next video" . could you please link it somewhere here? thank you :)

    • @ahmednesartahsinchoudhury2628
      @ahmednesartahsinchoudhury2628 7 месяцев назад

      for future viewers: there is a playlist called "multivariable calculus" that contains all these lectures. you can find the playlist from the description!

  • @danawen555
    @danawen555 3 года назад

    thanks!!! very good and exhaustive explanation

  • @dennishuang3498
    @dennishuang3498 5 лет назад

    Clear explanation ! Thanks for all your effort!

  • @christopherandrewmartin494
    @christopherandrewmartin494 2 года назад

    Very helpful. Thanks for all your videos!

  • @jeatig
    @jeatig 6 лет назад

    (A problem in an Earl W. Swokowski calculus book) "Find the points on the graph of 1/x + 2/y + 3/z = 1 which are closest to the origin." Answer: (a, 2^(1/3)a, 3^(1/3)a), as a = 1 + 2^(2/3) + 3^(2/3), approx. (4.667, 5.881, 6.732). The shortest distance is approx. 10.084. Why is this so; as x=1, y=-2, z=3 is used; which makes the equation equal to 1; and the distance from the origin is sqrt (1^2 + (-2)^2 + 3^2) = sqrt (14) which is approx. 3.742; which is less than 10.084?? Is this problem restricted only to the octant where x, y, and z are all positive??

  • @scoffer2150
    @scoffer2150 Год назад

    Thank you so much for this epic! Worth watching.

  • @ambresipahimalani4198
    @ambresipahimalani4198 4 месяца назад

    but what if the maximum is "in the circle", like a montain that would have its summit above the center of the circle, the two curves would'nt be tangent, would they ?

  • @speedracer1702
    @speedracer1702 3 года назад

    Amazing explanation!

  • @ruralmetropolitan
    @ruralmetropolitan 8 лет назад +166

    "Lagrange one of those famous french mathematicians...".... Italians getting triggered! :D

    • @GreyEyedAthena
      @GreyEyedAthena 7 лет назад +8

      Quasnt Hered naturalized French , so French.

    • @ihbarddx
      @ihbarddx 6 лет назад +2

      I know I did! :-)
      Other than that, nice explanation!

    • @philippelaferriere2661
      @philippelaferriere2661 5 лет назад

      He did end up finishing his life in France ;)

    • @OfficialAnarchyz
      @OfficialAnarchyz 5 лет назад +6

      Huh maybe some nerds are getting triggered. As an Italian, I feel like we have enough mathematicians and scientists to claim already B-)

    • @Labroidas
      @Labroidas 4 года назад

      @@OfficialAnarchyz Yeah you have enough! Give some to us Austrians xD

  • @studyselection2881
    @studyselection2881 2 года назад

    Why can we set the function to a constant and it is still a function? It should be a single point right?
    For example:
    x^2 + y = 10
    => x = some value
    and y is some value

  • @benisbuff
    @benisbuff 8 лет назад +37

    Literally have an exam on this in 4 hours :) cheeeers

  • @arpitbahety5643
    @arpitbahety5643 3 года назад +1

    Question: Consider we have a continuously decreasing function i.e. the value of the function decreases as we move away from the origin in the x-y plane. In such a case, the point that maximizes the function whilst satisfying the constraint won't be at the tanget, right (in the words of the video - where the two curves just kiss each other)?

    • @bendaniels7346
      @bendaniels7346 3 года назад

      I believe it will, but only on one side

  • @andreasstolten9179
    @andreasstolten9179 Год назад

    Often time the light modifier is in the frame or the background is uneven. I wonder how the finela pictures turn out.

  • @AmitDotAcademy
    @AmitDotAcademy 9 месяцев назад

    Nice video. Which tool do you use to generate the graph from equation ?

  • @doctorb9264
    @doctorb9264 4 года назад

    excellent presentation.

  • @Revetice
    @Revetice 7 лет назад

    very well explained and nice quality. thanks!

  • @aashsyed1277
    @aashsyed1277 3 года назад +8

    3 blue 1 brown?????

  • @tsrevo1
    @tsrevo1 7 лет назад

    Wow. excellent explanation.

  • @DennyMapleSyrup
    @DennyMapleSyrup 8 лет назад +4

    If only this was posted 2 weeks ago when we had our test on it :(

    • @randomdude135
      @randomdude135 8 лет назад

      math1052??

    • @DennyMapleSyrup
      @DennyMapleSyrup 8 лет назад

      randomdude135 No I'm in high school :(

    • @randomdude135
      @randomdude135 8 лет назад +2

      Daveed 78 dammn. You're doing this in hs??? I'm doing this in university hahaha

    • @DennyMapleSyrup
      @DennyMapleSyrup 8 лет назад +1

      randomdude135 I lucked out,my high school does a dual credit with a local college

    • @amidg4x4
      @amidg4x4 8 лет назад +2

      doing on the 2nd year of university... Lagrange multipliers... MATH251

  • @bfedkjwerfegregfrerg
    @bfedkjwerfegregfrerg 2 года назад

    Little non-mathematical correction: Joseph-Louis Lagrange was Italian. Born in the Italian city of Turin with the name of Giuseppe Luigi Lagrangia and later naturalized as Fench.

  • @williamcaldbeck
    @williamcaldbeck 5 лет назад

    This is fantastic. Thank you

  • @mermaid6380
    @mermaid6380 5 лет назад

    Thank you! I don't understand my prof but I can understand this

  • @yavarjn2055
    @yavarjn2055 4 года назад +1

    What tool do you use to have an interactive 3d graphics in the presentation?

  • @arslanhojiyev5996
    @arslanhojiyev5996 4 года назад

    If it doesn't ask to maximize (or minimize), how can we know that it indeed maximizes (or minimizes) the given expression?

  • @praneelmadhuvanesh3770
    @praneelmadhuvanesh3770 Год назад

    What if f got bigger as the contour lines got closer though? Then wouldn't the tangent point be where it is at its minimum?

  • @safooraranjbaran1466
    @safooraranjbaran1466 3 года назад

    How can I find the first video of this series, please?

  • @ahnafinqiyadarko6841
    @ahnafinqiyadarko6841 3 года назад

    Which playlist this video is part of?

  • @محمدالشهري-ظ2ك
    @محمدالشهري-ظ2ك 2 года назад

    I am wandering why the direction of the gradient in the half below of the plan goes in the opposite direction? when you draw the vector gradient for g(x,y)=x^2+y^2 all the directions for the vectors of the gradient were going outward vector? why is that?

    • @carultch
      @carultch 2 года назад

      Because the function has a local minimum at the origin on the x-y plane. All paths of steepest ascent lead away from this point. Thus, the gradient diverges at this point. The gradient diverges at every point on this particular function of g(x)=x^2+y^2 .

  • @laraeldabet6299
    @laraeldabet6299 3 года назад

    Thats nice, but how would we visualize it graphically if it was a minimization problem? So for maximization, it's when both graphs are tangent, what about minimization?

  • @leosin5767
    @leosin5767 Год назад

    3blue1brown deserves a Nobel Prize in math education

    • @skrgrnd
      @skrgrnd Год назад

      there's no nobel prize for math or education

  • @ericbischoff9444
    @ericbischoff9444 6 лет назад

    I'm wondering hard why use a lambda constant to express proportionality, one could have used a determinant. Is it because of simpler computations ? because lambda has a meaning ? or is it purely historical that this approach has been preferred ?

  • @gajrajsingh51
    @gajrajsingh51 3 года назад

    how are these videos made? like which software is used?

  • @carlossal04
    @carlossal04 3 года назад

    What program are you using for those graphs????

  • @Shadowfax2
    @Shadowfax2 5 лет назад

    Hi. If we imagine f(x,y) to be such that the contour lines of f(x,y) are lines parallel to the y-axis such that the contour line corresponding to the max f(x,y) is x=0. In that case, would this method apply all the same? g(x,y) and the constraint g(x,y) = 1 is assumed to be the same. Thanks!

    • @apoorvmishra6992
      @apoorvmishra6992 2 года назад

      Did you get an answer?
      I'm struggling with the same question.

  • @ravipratapmishra7013
    @ravipratapmishra7013 5 месяцев назад

    I don't get the part where two gradients are proportional, i do understand that they will be in same direction, but why they should be proportional to each other.

  • @blopotchok
    @blopotchok 5 лет назад

    But here we are lucky because the two curve are tangent, what if it is
    not the case? I do not understand how we can generalize this for all
    constrained optimizations, though I know it is possible. For instance what if we want to optimize f on
    the set x²+(y-1)²=1? Then there are no tangency of the curves f(x,y)=c and
    x²+(y-1)²=1but still the langrangian method works. Some argument is missing
    here...

  • @richardfredlund3802
    @richardfredlund3802 4 года назад

    i can see why Lagrange Multipliers works here because of tangency. What about if f(x,y)=3-y^2 ... then we know the maximum is on the line y=0 but this contour is NOT tangent to the constraint. (although you do still get the right answer if you apply the method). Why is this? Are there some functions this method won't work for? If so what is the condition?

  • @chandreshmaurya8102
    @chandreshmaurya8102 3 года назад

    Anyone knows which software is used to draw the counter and gradients?

  • @pacchutubu
    @pacchutubu 3 года назад

    if we eliminate y in f(x,y), using the circle equation, and then differentiate f(x,y(x)), won't that work?

  • @reshovroy7799
    @reshovroy7799 4 года назад

    could someone tell me which playlist this is?

  • @queenstrategy904
    @queenstrategy904 4 года назад

    Lambda is the same thing as lagrange multiplier. Is lambda just a scalar for vectors?

    • @joshuaflackua
      @joshuaflackua 3 года назад

      I think it's just a tool to help us establish a relation in this case. However, you could definitely think about it as a vector multiplier if that makes more sense. After all, we do use the gradient vector to establish the relation.

  • @Majestic469
    @Majestic469 5 лет назад +1

    What happens if you have more than one constraint equation?

    • @ilyakulakov6484
      @ilyakulakov6484 5 лет назад

      You have fewer possible points to consider for being a maxima.

  • @karthik-ex4dm
    @karthik-ex4dm 6 лет назад

    awesome video!

  • @hadimulji
    @hadimulji 3 года назад

    Which software is that?

  • @张梓良-f5e
    @张梓良-f5e Год назад

    Great explanation, thanks for the efforts. For the interpretation(insight) on ∇f(x)=λ∇g(x) where x=[x1,x2,...,xn] is the solution for the extreme, is it because that such extreme only exist when the pulling force of the gradients are proportional to each other because they have the same tangent line? for example, if we expand the size of the circle g(x) in the original example, the original f(x) overlaps with g(x) at points where they have different tangent lines, which implies gradients on different directions on f and g correspondingly, which means that there is a space for improvement for f(x)? Can anyone help?

  • @shahabansari5201
    @shahabansari5201 3 года назад

    Simply beautiful...

  • @devkunjadia3792
    @devkunjadia3792 Год назад

    awesome video

  • @jacobhm7429
    @jacobhm7429 5 лет назад

    Is it possible to use f(x, y) = 1 as the third equation instead of the constraint, x² + y² = 1?
    edit: would this not give you 1/lambda?

    • @valeriuok
      @valeriuok 4 года назад

      No. The contour line of f tangent to the unit circle is not of value 1. You may be tricked by the fact that the clip shows the contour lines of f extending in the same XY plane as the circle, but in fact they are extending upwards, in the Z direction. What you see are projections in the XY plane.

  • @alecmac6975
    @alecmac6975 Год назад

    You saved me for my Micro Econ test

  • @drennal9516
    @drennal9516 4 года назад

    why do you use vector and not sum?

  • @swarnavasinharoy7023
    @swarnavasinharoy7023 2 года назад

    I almost forgot. 3B1B used to work for Khan Academy