# Max and Min of a function of four variables

1. Oct 14, 2012

### Artie

1. The problem statement, all variables and given/known data
Find the maximum and minimum values of the function f(x,y,z,t)=x+y+z+t subject to the constraint x^2+y^2+z^2+t^2=400.

2. Relevant equations
I think the Lagrange multiplers can be used ∇f=λ∇g

3. The attempt at a solution
So I found ∇f=<1,1,1,1> and ∇g=<2x,2y,2z,2t>
and when i set each component equal to each other I get x=y=z=t. I don't know where to go from here, or if this was even the right path to take in the first place

2. Oct 14, 2012

### Simon Bridge

3. Oct 14, 2012

### Artie

Sorry, I forgot that there was a designated spot for homework questions. But yes I've looked all over the internet for how to do this problem. So what is the next step?
I know how to use Lagrange multipliers for just two variables, f(x,y), but I dont understand how to use it for four.

4. Oct 14, 2012

### Simon Bridge

The next step is to construct the Lagrange equation.

The method is supposed to be useful for any number of independent variables.
http://www.karlscalculus.org/pdf/lagrange.pdf [Broken]

Last edited by a moderator: May 6, 2017
5. Oct 14, 2012

### Artie

okay so, for each component:
1=λ2x
1=λ2y
1=λ2z
1=λ2t

6. Oct 14, 2012

### Simon Bridge

That's 4 equations and five unknowns.
You are missing one.

7. Oct 14, 2012

### Artie

if so, i don't know an equation for that which doesnt include atleast one other variable

8. Oct 14, 2012

### Ray Vickson

You can solve for the 4 variables x,y,z,t in terms of λ. So, if you know λ you are done. You still need to satisfy the constraint equation. Try substituting your expressions for x,y,z,t in the constraint to see what you get.

That is more-or-less the standard solution method for Lagrange multiplier problems, whether you have 2 variables or 2000 variables.

RGV

9. Oct 14, 2012

### Simon Bridge

... in that method, you'd end up using three relations wouldn't you? Did you go look at either of the links I gave you? The second explicitly deals with the case of more than two variables.

10. Oct 15, 2012

### Artie

Okay I think I got it!
Since all of the components are equal to 1, you can set them equal to each other. And you end up with x=y=z=t. So you plug that into the constraint function g(x,y,z,t)=400, substituting x for all the other values. And you get (x^2)+(x^2)+(x^2)+(x^2)=400. And from there you get x=+/-10. Which means that y,z, and t also equal +/-10. So you plug these values back into the function f(x,y,z,t) and you get a max value of 40 occuring at the point (10,10,10,10) and a min value of -40 occurring at the point (-10,-10,-10,-10)
Right?

11. Oct 15, 2012

### Artie

Okay I think I got it!
Since all of the components are equal to 1, you can set them equal to each other. And you end up with x=y=z=t. So you plug that into the constraint function g(x,y,z,t)=400, substituting x for all the other values. And you get (x^2)+(x^2)+(x^2)+(x^2)=400. And from there you get x=+/-10. Which means that y,z, and t also equal +/-10. So you plug these values back into the function f(x,y,z,t) and you get a max value of 40 occuring at the point (10,10,10,10) and a min value of -40 occurring at the point (-10,-10,-10,-10)
Right?

12. Oct 15, 2012

### Artie

Okay I think I got it!
Since all of the components are equal to 1, you can set them equal to each other. And you end up with x=y=z=t. So you plug that into the constraint function g(x,y,z,t)=400, substituting x for all the other values. And you get (x^2)+(x^2)+(x^2)+(x^2)=400. And from there you get x=+/-10. Which means that y,z, and t also equal +/-10. So you plug these values back into the function f(x,y,z,t) and you get a max value of 40 occuring at the point (10,10,10,10) and a min value of -40 occurring at the point (-10,-10,-10,-10)
Right?