Maximum and minimum of a function of two variables under a constraint

Ozma

Junior Member
Joined
Oct 14, 2020
Messages
78
Let [MATH]f(x,y)=x^2+y^2[/MATH], find the extrema of [MATH]f[/MATH] under the constraint [MATH]4x^2+y^2=1[/MATH].
My lecturer told us that isolate [MATH]y^2=1-4x^2[/MATH] from the constraint and substituting it in the expression of [MATH]f[/MATH], that is study the function of only one variable [MATH]f(x,1-4x^2)=1-3x^2[/MATH] to find the extrema is incorrect, but he hasn't told us why. Can someone explain me why this doesn't work? We've used this strategy other times and there weren't problems.
 
Can you give me an example where you used this method other times and it worked?
 
I think what he means is that if you just use [MATH]y^2[/MATH] you are likely to miss the fact that [MATH]y=-1[/MATH] produces a maximum as well as [MATH]y=1[/MATH]
The method works just fine if you use some care.
 
Let [MATH]f(x,y)=x^2+y^2[/MATH], find the extrema of [MATH]f[/MATH] under the constraint [MATH]4x^2+y^2=1[/MATH].
My lecturer told us that isolate [MATH]y^2=1-4x^2[/MATH] from the constraint and substituting it in the expression of [MATH]f[/MATH], that is study the function of only one variable [MATH]f(x,1-4x^2)=1-3x^2[/MATH] to find the extrema is incorrect, but he hasn't told us why. Can someone explain me why this doesn't work? We've used this strategy other times and there weren't problems.
What you specifically wrote is incorrect, as the substitution yields not [MATH]f(x,1-4x^2)=1-3x^2[/MATH] but [MATH]f(x,\sqrt{1-4x^2})=1-3x^2[/MATH]. You replaced \(y^2\), not \(y\), with [MATH]1-4x^2[/MATH]. That is one place where you might overlook the two possible signs of \(y\); but the work as written can be incorrect even if you get the right answer.
 
@Jomo: For example [MATH]f(x,y)=x^2y[/MATH] under the constraint [MATH]2x+y=6[/MATH].

@Romsek: Thanks for your answer!

@Dr.Peterson: Thank you! That was very clear, now I see the possibility of mistake. However there is one last thing I don't get: while I agree with you about the fact that what I've written is wrong because it isn't [MATH]f(x,y^2)[/MATH] but [MATH]f(x,y)[/MATH] and so from [MATH]y^2=1-4x^2 \iff y=\sqrt{1-4x^2} \lor y=-\sqrt{1-4x^2}[/MATH] it is [MATH]f(x,\sqrt{1-4x^2}) \lor f(x,-\sqrt{1-4x^2})[/MATH], I still don't get why we can't substitute from a logic point of view. I mean, if someone says "find the extrema of [MATH]f(x,y)=x^2+y^2[/MATH] under the constraint [MATH]4x^2+y^2=1[/MATH]" shouldn't it mean "find the extrema of [MATH]f[/MATH] such that [MATH]f(x,y)=x^2+y^2 \land 4x^2+y^2=1[/MATH]"?
If it is so, that logical "and" shouldn't mean that the [MATH]y^2[/MATH] for both [MATH]f[/MATH] and the constraint is the same and so I can substitute one in another?
Has it something to do that the writing [MATH]f(x,y)[/MATH] gives the value of [MATH]f[/MATH] for [MATH]x[/MATH] and [MATH]y[/MATH] and not for [MATH]x[/MATH] and the square of [MATH]y[/MATH]?
 
I think each of us is trying to help you with a different guess as to what is "incorrect". You may have to ask your lecturer what he had in mind!

Romsek showed a reason it might be a bad method if you are not careful, but said it is not actually wrong.

I showed that what you wrote is technically incorrect, but did not say that what you actually did is wrong.

So I think we are both agreeing with you. Are you saying that your lecturer explicitly said that "we can't substitute" in this case? You may need to tell us exactly what was said, in addition to showing us your actual work in solving the example you gave Jomo. We only know what you tell us.
 
@Dr.Peterson: You are right, thanks for the time you all are giving me! Unfortunately now I can't talk to my lecturer due to holidays, so that's why I'm asking for your help. In the example I gave to Jomo I have no doubts, but I will proceed to post my work to give all the help possible in being clear.

My work for the example for Jomo: From the equation [MATH]2x+y=6[/MATH] it follows that [MATH]y=6-2x[/MATH] and so, since it must be both true that [MATH]f(x,y)=x^2y[/MATH] and [MATH]2x+y=6[/MATH], it follows that [MATH]f(x,y)=f(x,6-2x)=x^2(6-2x)=6x^2-2x^3=g(x)[/MATH].
So, since [MATH]g[/MATH] is differentiable, it follows that [MATH]g'(x)=12x-6x^2=0 \iff x_1=0 \lor x_2=2[/MATH]. So, finding [MATH]y[/MATH] from the constraint, it follows that the points for the extrema are [MATH]P_1=(0,6) \lor P_2 =(2,2)[/MATH], by direct calculations [MATH]P_1[/MATH] is a point of minimum for [MATH]f[/MATH] and [MATH]P_2[/MATH] is a point of maximum for [MATH]f[/MATH].

About what my lecturer said precisely, it is the following: "The function [MATH]f(x,y)=x^2+y^2[/MATH] is a continuous function on all [MATH]\mathbb{R}^2[/MATH] and the set identified by the equation [MATH]4x^2+y^2=1[/MATH] is compact, so for the Weierstrass theorem [MATH]f[/MATH] admits maximum and minimum in that set. But if we substitute [MATH]y^2=1-4x^2[/MATH], obtained from the constraint, in the function, we get the function [MATH]g(x)=1-3x^2[/MATH] of the only variable [MATH]x[/MATH], and since [MATH]g'(x)=-6x \geq 0 \iff x\leq 0[/MATH] it follows that [MATH]x=0[/MATH] is a maximum for [MATH]g[/MATH] and [MATH]g[/MATH] hasn't a minimum. So it follows that [MATH]f[/MATH] has maximum in the corresponding points and has no minimum; of course this is completely wrong (minimum has to exist because of Weierstrass)."

But, as you can now see, he didn't say why this is wrong. Hope that now is clearer!
 
Ah! That does tell me a lot. It clearly tells you one sort of "why": It's incorrect because it misses the minima.

One thing you might do to find out why that happens (the "why" you are asking), and how you might know ahead of time not to do what you did, is to find those minima and think about what makes those points special. Doing that will probably be more instructive than a direct answer -- and maybe that is why you haven't yet been told.

Another thing I neglected to ask was, what method you have been taught to be correct, and what you found when you applied it. That might give us more context to know what you are learning and what the point of this example is.
 
Top