 This next example is going to be a purely geometric situation, but it certainly doesn't have to be so geometric here. This idea in this question here was going to minimize distance. Imagine you have a parabola, y squared equals 2x. Now, you'll notice I'm actually squaring the y and not the x, and so this is going to go as a concave right parabola here. We want to find the point on the parabola which is closest to the point 1, 4 which is not on the parabola. On the picture, you can see an estimate of where that closest point might be. If we're looking for a point that's closest to the point, what we're trying to do here is we're trying to minimize distance. If you're trying to minimize distance, we're going to have to use the distance formula in order to make that work. The general distance formula, you're going to take x2 minus x1, squared plus y2 minus y1, squared, and this all sits inside of the square root right here. Well, one of the points is fixed. It's the point 1, 4. Really, we're looking at x minus 1, squared plus y minus 4, squared. We go from there. This is the distance we're trying to minimize. Now, at the moment, it has the two variables x and y. We'll come back to that in just a second, but a very useful trick that comes into play when one tries to deal with minimizing distance, because the distance formula is complicated in terms of derivatives, because of the square root and the necessary chain rule. What often one can do is if you square both sides, you look at the distance squared. This removes the square root on the right-hand side, so you just get x minus 1 squared plus y minus 4 squared. And this is often more preferable, because in order to minimize distance, you can accomplish this at the same time if you try to minimize distance squared. And that is you can find the minimal distance implicitly. This leads to a much easier derivative calculation. All right, but we're still stuck with the situation that we have two variables, x and y. How do we get rid of them? Well, we need to constraint. What is the constraint in the situation? It's the parabola itself, y equals x squared, because after all, the point has to be a point on the parabola. And so we use the parabola as the constraint. You have y squared equals 2x. Think about the forthcoming derivative. If you solve for y, you get y equals the square root of 2x. We don't want square roots in our derivative, but we can avoid it. On the other hand, if you divide both sides by two, you get x equals y squared over two. And that's gonna be a much simpler calculation in terms of the derivative. So we're gonna make that substitution in for x right here. All right, so let's see what it would look like d squared is equal to y squared over two minus one squared plus y minus one, sorry, minus four squared. So now this thing is prepped for taking derivatives. If we take the derivative, you're gonna end up with a two dd prime equals, let's see, by the chain rule, you're gonna get two times y squared over two minus one. Then don't forget the inner derivative for which case you're just gonna get a y. And then add to that two times y minus four. And this should all equal zero. Now, if you look at the left-hand side, we have that two dd prime equals zero. Well, okay, well, if a product of things equals zero, it's because one of the factors was zero. Well, what's factor? What's not two? Two doesn't equal zero, so that's not the culprit. Could it be d? D is the distance. Is the distance equal to zero? Well, like we saw above, the d equals zero would mean that 1.4 lived on the parabola. But you can check that it doesn't happen. Y squared gives you 16 and two times x gives you two, that's not a solution. So the distance does not equal zero in this context. So the only way that this product equals zero is of d prime equals zero. Now is the justification why we can work with distance squared instead of just distance. All right, so what do we have here? Distribute and multiply things out a little bit. We will end up with a y squared. Oops. Let's switch it back to white. We've got a y squared, actually y cubed minus two y. Plus two y minus eight equals zero. You can see that the y's cancel out and we're left with y squared minus eight. Y cubed, excuse me, minus eight equals zero. Solving for y cubed, we get y cubed equals eight and taking the cube root will get y equals two, the cube root of eight. Now, this is our critical number and so there's seems like high hopes that this will give us the closest point. And if we come back up to the picture we had before, y equals two, y equals two right here, that kind of seems to be about where we put this thing. Again, this was just an estimate where it is, but it seems like y should equal two. But what would the x coordinate be? Well, if you come to the parabola when y equals two, you can get two squared equals two x. So you get four equals two x divided by two, x equals two and that seems to be the point. Two comma two seems to be the best point there. In terms of domain though, what would the domain of this thing be? Like how close can we get or how far can we get? Well, if you follow down this trajectory down here, you can get arbitrarily farther and farther and farther away. Turns out if you go down this path, the distance from one four is gonna go to infinity. That's not the minimum distance, but if we go down the other trajectory, go farther and farther and farther away, same issue, we're gonna get farther and farther and farther away from this point and that can get arbitrarily large going to infinity as well. So it would appear that our single critical number actually gives us our closest point. Two comma two is the closest point on the parabola to the point one comma four.