Wikipedia:Reference desk/Archives/Mathematics/2013 March 5

= March 5 =

A maximum/minimum value question
Dear Wikipedians:

A question calls for the finding of the absolute maximum and minimum value of $$f(x,y,z)=x^2+y^2+z^2$$ subject to the constraints $$x-y=1$$ and $$y^2-z^2=1$$

Using Lagrange multipliers, I set up the following function:


 * (start preformatted section as 13 seconds faster):

$$L(x,y,z,\lambda,\mu)=x^2+y^2+z^2+\lambda(x-y-1)+\mu(y^2-z^2-1)$$

Setting the first partial derivatives of L to zero, we obtain

From (3) I find $$\mu = 1$$, substituting into (2):

$$2y-\lambda+2y=0$$

$$\lambda=4y$$ (6)

Substituting (6) into (1):

$$2x+4y=0$$

$$x=-2y$$ (7)

Substituting (7) into (4):

$$-2y-y-1=0$$

$$-3y=1$$

$$y=-\frac{1}{3}$$

Substituting $$y=-\frac{1}{3}$$ into (5):

$$\left(-\frac{1}{3}\right)^2-z^2-1=0$$

$$z^2=-\frac{8}{9}$$ (end preformatted section)

This means that there are no real solutions to the original problem. However the official solutions clearly indicate the existence of real solutions. I am wondering what is going on?

Thanks for all your help. 74.14.60.239 (talk) 02:42, 5 March 2013 (UTC)


 * Equation 3 has an alternate solution. There is no absolute maximum subject to those constraints, but there is certainly an absolute minimum. Looie496 (talk) 03:49, 5 March 2013 (UTC)


 * I'm going to do it a bit differently. I notice that we can get the function in terms of y only:


 * (start preformatted section, as 17 seconds faster):

$$x - y = 1$$

$$x    = 1 + y$$

$$y^2 - z^2 = 1$$

$$ - z^2 = 1 - y^2$$

$$ z^2 = y^2 - 1$$

$$ z = sqrt(y^2 - 1)$$

$$f(x,y,z) = x^2 + y^2 + z^2$$

$$f(y) = (1 + y)^2 + y^2 + (sqrt(y^2 - 1))^2$$

$$f(y) = (1 + 2y + y^2) + y^2 + (y^2 - 1)$$

$$f(y) = 2y + 3y^2$$


 * From here, set the derivative equal to zero:

$$0 = 2 + 6y$$

$$y = -1/3$$


 * Now find x and z:

$$x    = 1 + y$$

$$x    = 1 + (-1/3)$$

$$x    = 2/3$$

$$ z = sqrt(y^2 - 1)$$

$$ z = sqrt((-1/3)^2 - 1)$$

$$ z = sqrt((1/9) - 1)$$

$$ z = sqrt(-8/9)$$ (end preformatted section)


 * So, I get the same results as you. What does the book list as the solution(s) ?  StuRat (talk) 04:35, 5 March 2013 (UTC)


 * What you have demonstrated with perfect clarity is that that method doesn't work. The problem is that the equation $$y^2 - z^2 = 1$$ limits the range of y -- it can never be between -1 and 1.  So when looking for the extrema, in addition to the point where the derivative is zero you also have to consider the edge points of the range. Looie496 (talk) 04:53, 5 March 2013 (UTC)


 * I may have missed something when solving for $$(sqrt(y^2 - 1))^2$$. This should also have a negative root, I think:

$$f(y) = (1 + y)^2 + y^2 + (sqrt(y^2 - 1))^2$$

$$f(y) = (1 + 2y + y^2) + y^2 + -(y^2 - 1)$$

$$f(y) = (1 + 2y + y^2) + y^2 - y^2 + 1$$

$$f(y) = 2 + 2y + y^2$$


 * From here, set the derivative equal to zero:

$$0 = 2 + 2y$$

$$y = -1$$


 * Now find x and z:

$$x    = 1 + y$$

$$x    = 1 + (-1)$$

$$x    = 0$$

$$ z = sqrt(y^2 - 1)$$

$$ z = sqrt((-1)^2 - 1)$$

$$ z = 0$$


 * So, if we plug in (0,-1,0), we get:

$$f(x,y,z) = x^2 + y^2 + z^2$$

$$f(x,y,z)= 0^2 +(-1)^2 + 0^2$$

$$f(x,y,z)= 1$$


 * Not sure if that's the min or max, though. I'd have to try a few nearby values to test it out.  Does this match the book answer ? StuRat (talk) 05:01, 5 March 2013 (UTC)


 * The minimum and the maximum are to be found amongst the roots of the first derivative. All you have to do is reduce the function in question to a single-variable function. And you do precisely that by replacing x and y with expressions in z. From y2 - z2 = 1 we deduce that y2 = 1 + z2. And from x - y = 1 we deduce that x = 1 + y = 1 ± √(1 + z2) ⇔ x2 = 2 + z2 ± 2√(1 + z2). Our function thus becomes f(x, y, z) = F(z) = 3 + 3z2 ± 2√(1 + z2). All we have to do now is calculate F'(z), find its roots, and see which of them has the smallest, respectively the largest value. F'(z) = 2z(3 ± 1 / √(1 + z2)), whose roots are z0 = 0 and z1, 2 = ±2i√2/3. Since complex solutions are apparently not acceptable, F(0) = 3 ± 2, meaning your minimum and maximum value are 1 and 5, respectively. — 79.113.208.129 (talk) 05:04, 5 March 2013 (UTC)


 * We agree on the minimum, but not the max. How about the case of $$f(3,2,sqrt(3)) = 16$$ ?  That's more than 5, and seems to be consistent with the constraints. StuRat (talk) 05:23, 5 March 2013 (UTC)


 * Yes, stupid mistake: a point (in this case, 0) cannot be both maximum and minimum at the same time ! And -apart from that silly blunder-, I forgot to add that one also has to take into account the values of the function at the extreme points of its interval of definition, in this case $$\pm\infty$$, both of which are $$+\infty$$. So the minimum and the maximum are the smallest and largest values from among 1, 5, and $$\infty$$. Ergo, the minimum is 1 and the maximum is $$+\infty$$. — 79.113.208.129 (talk) 05:47, 5 March 2013 (UTC)


 * Very good, we are now in complete agreement. StuRat (talk) 05:53, 5 March 2013 (UTC)


 * EXCEPT you don't need z here and the whole mess with possibly complex square roots. Just leave $$z^2=y^2-1$$ and plug that z2 directly into the f formula. --CiaPan (talk) 17:03, 5 March 2013 (UTC)


 * That's what I did, although I did need to take into account the negative root. StuRat (talk) 02:42, 6 March 2013 (UTC)


 * Additionally I would exclude +infinity form the final answer. The maximum value of a real function would be a real number and infinity is not a real number. The answer 'maximum of f is infinity' is incorrect IMHO, it should be 'there is no global maximum, f is not bounded above'. --CiaPan (talk) 10:04, 6 March 2013 (UTC)


 * Yea, that's how I'd say it, but I'm flexible. StuRat (talk) 17:42, 6 March 2013 (UTC)

Thanking all of you for your help. 74.14.60.239 (talk) 22:08, 11 March 2013 (UTC)