# Using Lagrange multipliers

Say we want to minimize the distance from the point $(x, y, z)$ to the origin $$f(x,y,z)=x^2+y^2+z^2$$ subject to the constraint that the point lie on the line $x^2+y^2=3, \, z=1$, and we can easily see that all points on the line has a distance of $2$ to the origin

I have two questions:

1. How many tangent planes does a point, let's say,$(1,\sqrt{2}, 1)$ have in 3-dimensional space?infinite? My understanding for a tangent plane is that,any planes only touch the graph on one point can be called an tangent plane, then there are infinite on a line beacuae you can tilt planes in different angles, making it tangent to the point.

2. $\nabla f(x,y,z)=\left \langle 2x,2y,2z \right \rangle$ then how can I write $g(x)$ to use Lagrange multipliers with $\nabla f(x,y,z)$ to find out extrema? (the result should be infinite extrema which is distance of $2$)

• The distance function isn't $f$, though. So your phrasing of the problem is misleading. However, the extrema points of the distance function are the same as $f$'s. You need two $g$'s, one for each constraint, and two Lagrange multipliers (scalars) for each constraint. Commented Aug 18, 2016 at 10:07
• @GitGud The distance function isn't $f$? can you show me the right one plz Commented Aug 18, 2016 at 10:11
• I'm sure you know because you've given a correct answer. The (standard) distance function in $\mathbb R^3$ is $\sqrt f$. Commented Aug 18, 2016 at 10:14
• @GitGud yes, that's what I meant. So how many tangent planes of the point of the circle have? Commented Aug 18, 2016 at 10:23
• Tangent to the circle? Only one on each point of the circle. Commented Aug 18, 2016 at 10:44

A smooth curve $\gamma$ in $3$-space has a unique tangent line at each of its points $p$. If $\pi$ is a plane containing such a tangent then you would say that the curve touches $\pi$, but you would not call $\pi$ a tangent plane to $\gamma$.
In your example $\gamma$ is a circle, given as intersection of a cylinder and a line. The intersection is transversal at all of its points, meaning that the two intersecting surfaces have different normals at the points of intersection.
In such a case Lagrange's method, set up correctly, brings to the fore all points $p\in\gamma$ where $\nabla f(p)$ is orthogonal to the tangent line at $p$. In your example it so happens that this is the case at all points $p\in\gamma$. The conclusion is that $f$ is in fact constant on $\gamma$ – of course you knew that all along.
To segue to your second question, there are two constraint surfaces here. The cylinder $x^2+y^2 = 3$ and the plane $z=1$. So there will be 2 Lagrange multipliers. Let $g = x^2+y^2$ and $h=z$. Solve $\nabla f = \lambda \nabla g + \mu \nabla h$ along with the two constraints. It turns out that every point on the constraint curve is a solution.
• $\nabla f = \left \langle 2x,2y,2z \right \rangle$, $\nabla g=\left \langle 2x,2y,0 \right \rangle$ $\nabla h=\left \langle 0,0,1 \right \rangle$.Is it correct? Commented Aug 18, 2016 at 22:40