# Minimizing a multivariable function

1. Feb 16, 2014

### Yosty22

1. The problem statement, all variables and given/known data

Find the shortest distance from the origin to the surface x=yz+10

2. Relevant equations

3. The attempt at a solution

So I said that my main function, f(x,y,z) = x^2 + y^2 + z^2 (the function I want to minimize)
Then I said that g(x,y,z) is my constraint function where g(x,y,z) is yz-x=-10. I took the partial derivative with respect to each variable of both g and f. I got fx=2x, fy=2y, fz=2z, gx=-1, gy=z, and gz=y. Once I did this, set fx = λ gx etc. (same format for each partial). This is where I am confused.

My final equations are:
2x + λ = 0 (1)
2y - λz = 0 (2)
2z - λy = 0 (3)
yz - x = 10 (4)

Once I have these, I am confused as to how to solve them properly. What I did so far was solve equation 2 for z. Once I solved for z in terms of y and λ, I substituted it back in to equation 3 and got 4y/λ - λy = 0. Multiplying lambda across, I get 4y = λ2y. This shows me that either λ=2 or y=0. Once I get these, for each case I solved and when y = 0, plugging back in to equation 2, I get z = 0, and this means that x=10 (equation 4). However, if λ = 2, then by equation 1, x=-1.

My question is:
What should I be looking for here? What do I solve for to answer the question properly?

2. Feb 16, 2014

### Dick

You want all of the possible sets of three values x, y and z that solve all of those equations. You've got one x=10, y=0, z=0. Now just keep following all of the possibilities. And be careful, $\lambda^2=4$ has two solutions. And you've got a typo in equation (4). It should be yz-x=(-10).

Last edited: Feb 16, 2014
3. Feb 16, 2014

### Yosty22

Okay, so I continued with what I was doing before and fixed lambda = 2 to lambda = +/- 2. Doing this, I got three points:
1). (10,0,0)
2). (-1,-1,11)
3). (1,1-9)

Now that I have these points, the question confuses me. The question asks for the shortest distance from the origin to the plane. All of these points are on the plane, so do I use the distance formula to calculate the magnitude of the distance from the point on the plane to the origin?

4. Feb 16, 2014

### Dick

It's not a plane, but yes, you would check those points to find out which minimizes distance. If they were correct. But they aren't. I think you went a little too fast. If $\lambda=2$ can't you conclude $y=z$?

5. Feb 16, 2014

### Yosty22

Oh, yes I see that. So if y=z, I can change the last equation to y^2-x=-10 when lambda = 2. After that, however, I seem to hit a wall of sorts. So I used equation 1 and lambda = 2 to solve for x. That gives me: 2x+2=0, so x=-1. However, when I plug that back in to the equation, it cannot work out correctly. That means I have y^2+1=-10, or y^2=-11, which cannot be right. Any ideas where I'm going wrong?

6. Feb 16, 2014

### Dick

You aren't doing anything wrong. You hit a correct wall. $\lambda=2$ doesn't lead to any solutions. What about $\lambda=-2$?

7. Feb 16, 2014

### Yosty22

Okay, so after looking at the points again, I have 3 points. When lambda is 2, y=z, but it doesn't work. However, when lambda = -2, y=-z. Doing some substitutions, I get the points (1,3,-3) and (1,-3,3,). Testing the points (10,0,0) and (1,+/-3,+/-3) I get sqrt (19) and 10 (using the distance formula). This shows that the shortest distance between yz-x=-10 and the origin is sqrt(19), or about 4.36. Does this sound correct?

8. Feb 16, 2014

### Dick

Sounds correct.