Cevris said:
While searching for finding a solution to my problem, I came across with this thread. It would be nice if someone could explain to me geometrically what kind of vector is the grad f=(2x,2y,2z).
I mean, I can understand that grad g is perpendicular to the surface, but I can't get why grad f and grad g are parallel vectors, since the distance x^2 + y^2 + z^2 is already a vector that passes through that point of the surface and the origin.
Think of it this way: the gradient, \nabla f always points in the direction of fastest increase so if you objective is to maximize f, you should move in the direction of f. If your objective is to minimize f, move opposite to f. In either case, move
parallel to f.
Here, the objective is to minimize the the distance to (0, 0, 0). The gradient of the square of the distance is <2x, 2y, 2z>= 2<x, y, z>. If you want to maximize distance, move in the direction of <x, y, z>, directly
away from <0, 0, 0>. If you want to minimize distance, move in the direction of -<x, y, z>, directly
toward <0, 0, 0>. That makes sense!
You keep doing that until there is no "direction" to \nabla f- until is is 0 which happens when you are
at (0, 0, 0). But if you are restricted to a given surface, you
cannot alway move parallel to \nabla f. The best you can do look at the projection of \nabla f onto the surface and follow that- if \nabla f is a little to the right of perpendicular, go that way. You can do that until \nabla f does NOT have a "projection" onto the surface- until it is perpendicular to the surface. But if the surface is given by G(x, y, z)= constant, then \nabla G is perpendicular to the surface. That is, you can go no further
on that surface toward your maximum of minimum of f(x,y,z) when \nabla f is perpendicular to the surface which means it is in the same direction as \nabal G- \nabla f and \nabla G are parallel there which means one is a multiple of the other: [iitex]\nabla f= \lambda\nabla G[/itex].