Minimizing a multivariable function

Yosty22
Messages
182
Reaction score
4

Homework Statement



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

Homework Equations





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 into 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 into 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?
 
Physics news on Phys.org
Yosty22 said:

Homework Statement



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

Homework Equations


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 into 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 into 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?

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:
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?
 
Yosty22 said:
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?

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##?
 
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 into 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?
 
Yosty22 said:
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 into 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?

You aren't doing anything wrong. You hit a correct wall. ##\lambda=2## doesn't lead to any solutions. What about ##\lambda=-2##?
 
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?
 
Yosty22 said:
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?

Sounds correct.
 
  • Like
Likes   Reactions: 1 person

Similar threads

Replies
1
Views
2K
Replies
2
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
Replies
7
Views
2K
  • · Replies 5 ·
Replies
5
Views
1K
Replies
6
Views
2K
  • · Replies 26 ·
Replies
26
Views
4K
  • · Replies 8 ·
Replies
8
Views
3K
Replies
8
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K