1 00:00:00,012 --> 00:00:03,596 [music] This is a story about three bubbles. 2 00:00:03,596 --> 00:00:08,818 Well it's really about three bubble walls, alright? 3 00:00:08,818 --> 00:00:14,454 I imagine that I've got this pane of glass here, alright? 4 00:00:14,454 --> 00:00:20,576 And I've got three points connected by three edges of bubble. 5 00:00:20,577 --> 00:00:24,079 So, where do these bits of bubble end up intersecting? 6 00:00:24,079 --> 00:00:27,641 This actually turns out to be an optimization problem. 7 00:00:27,641 --> 00:00:32,676 Bubbles wants to be as small as possible. So, less colorfully, this is what I'm 8 00:00:32,676 --> 00:00:36,460 really asking for. I imagine that I've got a triangle, and 9 00:00:36,460 --> 00:00:41,516 I'm trying to find a point in the middle of the triangle so that the sum of these 10 00:00:41,516 --> 00:00:45,128 three lengths, a plus b plus c, is as small as possible. 11 00:00:45,128 --> 00:00:48,190 Try to minimize the total length of bubble. 12 00:00:48,190 --> 00:00:52,467 Let's make this concrete. Let's actually pick points and place the 13 00:00:52,467 --> 00:00:56,629 triangle at those point. Anyhow, we should be drawing a picture, 14 00:00:56,629 --> 00:00:59,260 right? We should be starting by drawing a 15 00:00:59,260 --> 00:01:02,388 picture. So, for concreteness, I'm going to put the 16 00:01:02,388 --> 00:01:07,621 3 vertices here at 0,1, 0,0, and 1,0. And then, what am I trying to do, well, 17 00:01:07,621 --> 00:01:13,651 I'm trying to find a point, I call it x,y, in the in the middle of the triangle so 18 00:01:13,651 --> 00:01:20,131 that these lengths this length here, which I'm calling a, the length from x,y to the 19 00:01:20,131 --> 00:01:25,862 origin, I call b, and the length from x,y to the point 1,0, which I'll call c. 20 00:01:25,862 --> 00:01:28,986 I want a plus b plus c to be as small as possible. 21 00:01:28,986 --> 00:01:33,034 I'm trying to minimize the sum of the lengths to the vertices. 22 00:01:33,034 --> 00:01:38,516 The way that I've set up this problem. The way that I've exactly positioned these 23 00:01:38,516 --> 00:01:43,419 3 vertices introduces a symmetry that we can exploit in this problem. 24 00:01:43,419 --> 00:01:48,253 This configuration is symmetric across the line y equals x and the bubbles really 25 00:01:48,253 --> 00:01:53,089 shouldn't prefer one side or the other. I mean, what does bubble knows about left 26 00:01:53,089 --> 00:01:57,247 and right? So the solution, the point that minimizes 27 00:01:57,247 --> 00:02:03,261 the sum of the distances to these 3 vertices should lie on this line, so I can 28 00:02:03,261 --> 00:02:07,616 say that its coordinates are x,x, so what's the goal? 29 00:02:07,616 --> 00:02:13,212 So I'm trying to find the value of x, so, that this point x,x minimizes the sum of 30 00:02:13,212 --> 00:02:17,741 the distances to the 3 vertices. Now, how do I write that down? 31 00:02:17,741 --> 00:02:22,861 Well, here's a formula for the sum of the distances to these 3 vertices. 32 00:02:22,861 --> 00:02:26,550 This first part, the square root of x squared plus x squared. 33 00:02:26,550 --> 00:02:28,992 That's just the Pythagorean Theorem, right? 34 00:02:28,992 --> 00:02:31,382 How far is the point x,x from the point 0,0? 35 00:02:31,382 --> 00:02:35,113 Well, here's a right triangle. And the two legs of this right triangle 36 00:02:35,113 --> 00:02:37,992 both have length x. So, the length of a hypotenuse is he 37 00:02:37,992 --> 00:02:43,444 square root of x squared plus x squared. What, say, this term here, where is the 38 00:02:43,444 --> 00:02:48,038 square root of 1 minus x squared plus x squared come from? 39 00:02:48,038 --> 00:02:52,539 Well, take a look at this little tiny right triangle here. 40 00:02:52,539 --> 00:02:58,625 This right triangle has this leg with length x and this leg with length 1 minus 41 00:02:58,625 --> 00:03:01,951 x. So, how long is the hypotenuse, which is 42 00:03:01,951 --> 00:03:07,104 the distance from x,x to 1,0? Well, it's the square root of 1 minus x 43 00:03:07,104 --> 00:03:11,388 squared plus x squared. This last term, this square root of x 44 00:03:11,388 --> 00:03:16,748 squared plus one minus x squared, that's measuring the distance from 0,1 down to 45 00:03:16,748 --> 00:03:19,217 x,x. I can simplify this, somewhat. 46 00:03:19,217 --> 00:03:24,121 This first term, this square root of x squared plus x squared, well, I could 47 00:03:24,121 --> 00:03:27,559 rewrite that as just the square root of 2x squared. 48 00:03:27,559 --> 00:03:30,412 And both of these terms are actually the same. 49 00:03:30,412 --> 00:03:35,026 It's just the addition is done in a different order but, of course, it doesn't 50 00:03:35,026 --> 00:03:39,634 effect the value at all so I can write this as two copies of just this first one, 51 00:03:39,634 --> 00:03:42,709 the square root of 1 minus x squared plus x square. 52 00:03:42,709 --> 00:03:45,874 So, this is a slightly easier way of writing f. 53 00:03:45,874 --> 00:03:50,519 We should also review if there's any constraints on this problem. 54 00:03:50,519 --> 00:03:56,115 I'm going to find it a little bit easier if I assume that x is bigger than or equal 55 00:03:56,115 --> 00:03:59,214 to 0. In that case, the square root of 2x 56 00:03:59,214 --> 00:04:03,562 squared can be rewritten in an even easier way, right? 57 00:04:03,562 --> 00:04:06,947 The square root of x squared is the absolute value of x. 58 00:04:06,947 --> 00:04:11,741 But if I assume that x is bigger than or equal to 0, then I could rewrite this as 59 00:04:11,741 --> 00:04:16,529 just the square root of 2 times x plus, and this other term, 2 times the square 60 00:04:16,529 --> 00:04:21,544 root of 1 minus x squared plus x squared. So, we've got our function of a single 61 00:04:21,544 --> 00:04:25,020 variable so we can apply calculus. We can differentiate. 62 00:04:25,020 --> 00:04:27,621 So, here we go. I want to differentiate this. 63 00:04:27,622 --> 00:04:32,775 F prime is, well, it's the derivative of a sum, which is the sum of the derivative. 64 00:04:32,775 --> 00:04:35,851 So, I have to first differentiate square root of 2 times x. 65 00:04:35,851 --> 00:04:39,525 As just the square root of 2 plus 2 times something. 66 00:04:39,525 --> 00:04:43,103 So, it will be 2 times the derivative of that thing. 67 00:04:43,103 --> 00:04:48,485 It is the derivative of 1 minus x squared plus x squared, all under this square 68 00:04:48,485 --> 00:04:51,191 root. Alright, and I can keep on going here. 69 00:04:51,191 --> 00:04:55,758 I got the square root of 2 plus 2 times. How do I differentiate a square root? 70 00:04:55,758 --> 00:05:01,242 Well, the derivative of the square root is 1 over 2 times the square root but I use 71 00:05:01,242 --> 00:05:06,305 the chain rule so it will be 1 over 2 times the square of the inside function 72 00:05:06,305 --> 00:05:11,866 here, which is 1 minus x squared plus x squared times the derivative of the inside 73 00:05:11,866 --> 00:05:15,590 function. So, the derivative of 1 minus x squared 74 00:05:15,590 --> 00:05:19,113 plus x squared. Alright, let's do this again. 75 00:05:19,113 --> 00:05:24,789 So, I got the square root of 2, plus, oh, I can cancel this 2 and this 2, so, I've 76 00:05:24,789 --> 00:05:30,279 got 1 over the square root of 1 minus x squared plus x squared times, I got to 77 00:05:30,279 --> 00:05:35,140 differentiate this sum, which is the sum of derivatives again. 78 00:05:35,140 --> 00:05:40,106 So, the derivative of 1 minus x squared, that's 2 times one minus x times the 79 00:05:40,106 --> 00:05:45,306 derivative of the inside function, the derivation of 1 minus x is minus 1, plus 80 00:05:45,306 --> 00:05:48,426 the derivative of x squared, which is just 2x. 81 00:05:48,426 --> 00:05:52,853 So, here's the derivative of f. With the derivative in hand, we can look 82 00:05:52,853 --> 00:05:57,543 for the critical points, places where the function either isn't differentiable or 83 00:05:57,543 --> 00:06:01,527 where the derivative is equal to 0. I don't have to worry about critical 84 00:06:01,527 --> 00:06:06,142 points where the derivative doesn't exist because this function is differentiable 85 00:06:06,142 --> 00:06:09,262 everywhere. So, I'm just looking for values of x where 86 00:06:09,262 --> 00:06:14,032 the derivative is equal to 0. Let me rewrite this derivative even a 87 00:06:14,032 --> 00:06:19,111 little bit more nicely. So, the derivative is the square root of 2 88 00:06:19,111 --> 00:06:23,528 plus, and it's this thing I want to simplify a little bit here. 89 00:06:23,528 --> 00:06:25,229 What do I got? I got 2x. 90 00:06:25,229 --> 00:06:29,105 And then I've got another 2x here. So, it's 4x minus 2. 91 00:06:29,105 --> 00:06:34,766 So, 4x minus 2 over this denominator, the square root of 1 minus x squared plus x 92 00:06:34,766 --> 00:06:36,949 squared. Alright, pretty good. 93 00:06:36,949 --> 00:06:40,724 I'm looking for values of x where that thing is equal to 0. 94 00:06:40,724 --> 00:06:43,897 I'll subtract the square root of 2 from both sides. 95 00:06:43,897 --> 00:06:48,844 That means I'm looking for values of x. So that 4x minus 2 over the square root of 96 00:06:48,844 --> 00:06:53,284 1 minus x squared plus x squared, is equal to negative square root of 2. 97 00:06:53,284 --> 00:06:56,767 And then, I'll multiply both sides by this denominator. 98 00:06:56,767 --> 00:06:59,596 And that means I'm looking for values of x. 99 00:06:59,596 --> 00:07:04,882 So that 4x minus 2 is negative the square root of 2 times the square root of 1 minus 100 00:07:04,882 --> 00:07:09,305 x squared plus x squared. Now, how do I solve an equation like this? 101 00:07:09,305 --> 00:07:14,327 Well, one trick I can use is to square both sides, and that might introduce extra 102 00:07:14,327 --> 00:07:18,680 solutions. But I can go back then and, and figure out 103 00:07:18,680 --> 00:07:24,091 exactly which solution is still a solution to this original problem. 104 00:07:24,091 --> 00:07:29,098 So, let's square both sides. So, I've got 4x minus 2 squared is 105 00:07:29,098 --> 00:07:35,999 negative square root of 2 times 1 minus x squared plus x squared, this whole thing 106 00:07:35,999 --> 00:07:39,733 squared. And now, I can expand that out a bit, 107 00:07:39,733 --> 00:07:42,881 right? What's 4x minus 2 squared? 108 00:07:42,881 --> 00:07:47,961 Well, that's 16x squared minus 16x plus 4. And what's this side? 109 00:07:47,961 --> 00:07:51,336 Well, squaring the negative gets rid of it. 110 00:07:51,336 --> 00:07:57,790 Squaring the square root of 2 is 2, and then the square of this thing, this is 111 00:07:57,790 --> 00:08:04,654 positive so it's just whatever is inside the radical, which is 1 minus x squared 112 00:08:04,654 --> 00:08:10,389 plus x squared. Okay, so I got 16x squared minus 16x plus 113 00:08:10,389 --> 00:08:13,611 4. I can expand this thing out. 114 00:08:13,611 --> 00:08:21,555 Alright, this is a 1 minus 2x and then here, I got a plus x squared and another x 115 00:08:21,555 --> 00:08:29,528 squared so plus 2x squared. I'll expand this whole side out so that's 116 00:08:29,528 --> 00:08:38,600 2 minus 4x plus 4x squared and I'll subtract this from both sides and I'll get 117 00:08:38,600 --> 00:08:44,102 12x uh,squared minus 12x plus 2, is equal to 0. 118 00:08:44,102 --> 00:08:52,608 So, this is just a quadratic equation, alright, and I can solve that quadratic 119 00:08:52,608 --> 00:08:57,303 equation by using say, a quadratic formula. 120 00:08:57,303 --> 00:09:04,434 And I get that x is 1 half 1 plus or minus 1 over the square root of 3, alright? 121 00:09:04,434 --> 00:09:10,911 So this is an application of the quadratic equation to solve this, quadratic. 122 00:09:10,911 --> 00:09:16,904 Now, the issue here is that, it turns out that I'm getting 2 solutions for x. 123 00:09:16,904 --> 00:09:22,936 But only 1 of these is actually a place where the derivative is equal to zero. 124 00:09:22,936 --> 00:09:28,489 So if you're careful, and you check. It turns out that this is in fact, a minus 125 00:09:28,489 --> 00:09:31,109 sign. So this is the only critical point x 126 00:09:31,109 --> 00:09:34,085 equals 1 half 1 minus 1 over the square root of 3. 127 00:09:34,085 --> 00:09:38,945 So, I've got a critical point. Let's draw a picture and see exactly where 128 00:09:38,945 --> 00:09:42,326 the critical point lands inside our triangle. 129 00:09:42,326 --> 00:09:48,520 So, doing a little bit of numerics this critical point ends up at being at point 130 00:09:48,520 --> 00:09:52,076 2,1 and yeah, I mean I can plot this right here. 131 00:09:52,076 --> 00:09:55,736 This is the point x,x when x is equal to this. 132 00:09:55,736 --> 00:10:00,484 And, you know, maybe that looks believable as where these bubble walls would 133 00:10:00,484 --> 00:10:04,246 intersect in order to minimize the sum of these 3 distances. 134 00:10:04,246 --> 00:10:08,462 There's more work to do. To actually show that critical point does 135 00:10:08,462 --> 00:10:13,478 indeed give rise to the global minimum value of this function, we need to do more 136 00:10:13,478 --> 00:10:15,816 work. But let's put that off for now. 137 00:10:15,816 --> 00:10:19,206 Instead, I want to focus in on an angle calculation. 138 00:10:19,206 --> 00:10:24,518 In particular, I want to calculate this angle here, the angle that this bubble and 139 00:10:24,518 --> 00:10:27,966 this bubble make at the point where they intersect. 140 00:10:27,966 --> 00:10:33,156 And I can do that with the law of sines calculation but I also need to know to the 141 00:10:33,156 --> 00:10:38,502 length of this piece of the bubble and if you do the calculation, that will be the 142 00:10:38,502 --> 00:10:42,158 square of 2 3rd. Alright, so I'm going to use the fact that 143 00:10:42,158 --> 00:10:47,056 I know this length, oh, and I also know this bottom length is 1 and I know this 144 00:10:47,056 --> 00:10:50,375 angle, right? The line y equals x makes a 45-degree 145 00:10:50,375 --> 00:10:54,332 angle with the x-axis. So, I put all that information together 146 00:10:54,332 --> 00:10:59,117 into a law of sines calculation, right? Sine of pi over 4, that's this angle, a 147 00:10:59,117 --> 00:11:03,927 45-degree angle divided by the length of the opposite side the square root of 2 148 00:11:03,927 --> 00:11:06,584 3rd. Well, that sine of theta divided by the 149 00:11:06,584 --> 00:11:12,036 length of the opposite side which is 1. Now, I want to try to figure out what sine 150 00:11:12,036 --> 00:11:16,120 of theta is. Well, I've got all the bits of information 151 00:11:16,120 --> 00:11:20,040 here that I need. I know sine of pi over 4 is 1 over the 152 00:11:20,040 --> 00:11:23,945 square root of 2. So, it's 1 over the square root of 2, 153 00:11:23,945 --> 00:11:28,342 divided by the square root of 2 3rd is equal to sine of theta. 154 00:11:28,342 --> 00:11:33,895 And this, yeah, if it calculate it, it's the square root of 3 over 2. 155 00:11:33,895 --> 00:11:39,613 Now, you might be tempted just to apply arc sine to the square root of three over 156 00:11:39,613 --> 00:11:42,772 two. But you have to think a little bit about 157 00:11:42,772 --> 00:11:47,179 the domain here, exactly where does this angle theta lie? 158 00:11:47,179 --> 00:11:52,562 It's not between 0 and 90 degrees. A theta, if you look at the picture, is 159 00:11:52,562 --> 00:11:58,358 bigger than 90 degrees, so I'm looking for an angle between, say, 90 and 180 degrees 160 00:11:58,358 --> 00:12:04,456 whose sine is the square root of 3 over 2, and that actually nails down theta for us. 161 00:12:04,456 --> 00:12:09,246 Theta is 2 pi over three radians or 120 degrees. 162 00:12:09,246 --> 00:12:16,548 So, these bubble walls meet at 120 degree angles and we can see this for real in 163 00:12:16,548 --> 00:12:20,566 nature. Look at these 120 degree angles. 164 00:12:20,566 --> 00:12:27,467 The calculations that we're doing here are just symbols on the page. 165 00:12:27,467 --> 00:12:35,007 And yet, somehow, they manage to govern the real physical world, right? 166 00:12:35,007 --> 00:12:45,184 What do bubbles know about Calculus? But somehow, Calculus knows about bubbles.