How to Find the Maximum Values of Two Variables in an Equation?

Click For Summary

Discussion Overview

The discussion revolves around finding the maximum values of two variables, X and Y, within a specific equation involving constants C and K. Participants explore methods for maximizing the sum of these variables, addressing concepts from calculus such as partial derivatives and the relationship between the variables in the context of geometry and optimization.

Discussion Character

  • Exploratory
  • Technical explanation
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant suggests differentiating the equation partially with respect to each variable to find maximum values, but expresses uncertainty about the correct approach.
  • Another participant clarifies that the goal is to maximize a function of two variables rather than finding maximum values of the variables themselves.
  • There is a proposal to maximize the sum of X and Y, leading to discussions about defining a new variable Z as the sum.
  • Some participants argue that X and Y are not independent and that maximizing one affects the other, complicating the search for maximum values.
  • There is a suggestion to minimize the difference between X and Y, with various formulations proposed for this objective.
  • Concerns are raised about the arithmetic and methodology used in the calculations, with requests for clarification on the underlying theory.
  • Participants express confusion about the implications of their equations and the correct relationships between the variables.

Areas of Agreement / Disagreement

Participants generally disagree on the interpretation of the relationship between X and Y, with some viewing them as dependent and others as independent. The discussion remains unresolved regarding the best method to find maximum values and the correct formulation of the problem.

Contextual Notes

Limitations include potential misunderstandings of the relationship between variables, the complexity of the equations involved, and unresolved mathematical steps in the derivations presented.

tim9000
Messages
866
Reaction score
17
I'm just doing some geometry and I can't remember how to find the maximum values of two variables in the same equation. Like, if you differentiate the equation partially for one, then again from the beginning partially for the other and add them together or something.

The equation is something like (where C and K are constants)
[Y*cos(30) +(K^2 + (X/2)^2)^0.5] / cos(30) = C

It's been a long time since I did something like this, though simple it may be, I vaguly remember doing something similar for the maximum size of a rectangle or something.

Thanks
 
Physics news on Phys.org
Your question is not clear. You ask about "how to find the maximum values of two variables in the same equation" but I don't think that is what you want to do. I thing that what you want to do is to find the value of two variables in a function (not equation) that make the value of the function (not the variables) maximum.

To do that take the partial derivative of the function, with respect to the two variables, set them both equal to 0 and solve those two equations for the two variables, not "add them together".

In your example, I think the function you want to maximize is \frac{Y^2 cos(30)+ (K^2+ (X/2)^2)^{1/2}}{cos(30)},
the derivative with respect to X is \frac{X}{2cos(30)(\sqrt{K^2+ (X/2)^{1/2}})} and the derivative with respect to Y is 2Y.
 
If C and K are constants, you have just a convoluted way of expressing y=f(x). If you want to maximize for y, just do it...
 
HallsofIvy said:
Your question is not clear. You ask about "how to find the maximum values of two variables in the same equation" but I don't think that is what you want to do.
Svein said:
If C and K are constants, you have just a convoluted way of expressing y=f(x). If you want to maximize for y, just do it...
Good point, sorry.
I meant like the maximum of the sum of the two variables (biggest X + Y combination to satisfy the equation)

HallsofIvy said:
In your example, I think the function you want to maximize is
Y2cos(30)+(K2+(X/2)2)1/2cos(30)​
\frac{Y^2 cos(30)+ (K^2+ (X/2)^2)^{1/2}}{cos(30)},
the derivative with respect to X is
X2cos(30)(K2+(X/2)1/2−−−−−−−−−−−−√)​
\frac{X}{2cos(30)(\sqrt{K^2+ (X/2)^{1/2}})} and the derivative with respect to Y is
2Y

That's great thanks, except there was no y^2, with that in mind, are you saying the maximum of of the equation is:
X/ [2cos(30)*((K^2+ (X/2)^(1/2))] = 0

Because y' = 0

I still can't remember though, so I've added them both together, is the sum of the partial derivitives still = 0
or is it equal to a the constant 'C'?
And how is this finding the values of the variables, under which they are at maximum values satisfying the equation.
Sorry I am SO rusty.
 
tim9000 said:
I meant like the maximum of the sum of the two variables (biggest X + Y combination to satisfy the equation)

If you want to maximize y+x and you already have y = f(x), then define z = y + x = f(x) + x...
 
Svein said:
If you want to maximize y+x and you already have y = f(x), then define z = y + x = f(x) + x...

So:

Y = [C - (K^2 + (X/2)^2)^0.5] / cos(30) ] / cos(30)

then

Z = [C - (K^2 + (X/2)^2)^0.5] / cos(30) ] / cos(30) + X
Then Z' = X/ [2cos(30)*((K^2+ (X/2)^(1/2))] + 1 = 0 ?

So then rearrange for X maximum value?

If so, then do I just put that value back into the original equation for Y's maximum value?
 
tim9000 said:
So then rearrange for X maximum value?

If so, then do I just put that value back into the original equation for Y's maximum value?

Well, solve for X and the calculate Y. You just maximized X + Y.

You keep getting back to solving for X and Y. But your function specifies that Y depends on X. Therefore you cannot look for the maximum of X and Y separately since, given X, the value of Y is also given.
 
Svein said:
You keep getting back to solving for X and Y. But your function specifies that Y depends on X. Therefore you cannot look for the maximum of X and Y separately since, given X, the value of Y is also given.

I wasn't the one that said it was Y = f(X), as far as I am concerned it is just an expression with two independent variables. Where the Left hand side has to equal the constant C. And I want X and Y to be fairly ballanced out, not just one big variable and one small one.
 
tim9000 said:
The equation is something like (where C and K are constants)
[Y*cos(30) +(K^2 + (X/2)^2)^0.5] / cos(30) = C
This equation sets up a relation between X and Y. If you choose X, then Y is given by the formula above. If you choose Y, then you get two values of X. Thus, X and Y are not independent.
 
  • #10
Yes, that's true, although I did realize the implications of that, thanks for pointing out that I did misuse the term 'independent'. I should choose more clearly and carefully.
Is my question clear though now? You can choose a value for X or Y, so how do I calculate which value to choose for X or Y that will result in X and Y being closest to each other?
Thanks
 
  • #11
tim9000 said:
Is my question clear though now? You can choose a value for X or Y, so how do I calculate which value to choose for X or Y that will result in X and Y being closest to each other?

In what sense? Do you want to minimize Y - X or |Y - X| or...?
 
  • #12
Svein said:
In what sense? Do you want to minimize Y - X or |Y - X| or...?
Well I don't mind which is bigger, X or Y, but like if Z1 = X - Y or Z2 = Y - X, then Z1 or Z2 is as small as possible.
So if X and Y are on a seesaw they're as close as being ballanced as possible.
 
  • #13
tim9000 said:
Well I don't mind which is bigger, X or Y, but like if Z1 = X - Y or Z2 = Y - X, then Z1 or Z2 is as small as possible.
So if X and Y are on a seesaw they're as close as being ballanced as possible.

Then I propose that you minimize (Y - X)2. So y - x = (C -(K^2 - (x/2)^2)^(0.5)/cos(30))/cos(30) -x.
Square it and observe that cos(30) = √3/2. Derive and set equal to zero...
 
  • #14
Why (Y - X)2 and not (X - Y)2? I can't say I understand what you're getting at, but never the less:

(Y - X)2 = [(2C/√3) - √(K2-(X/2)2)*4/3]2 - X2

d[(Y - X)2] /dx = (4/3)2*2*X/2 - 2X = 0
= (16/9)X-2X = 0
which I don't think makes sense...
 
  • #15
tim9000 said:
(Y - X)2 = [(2C/√3) - √(K2-(X/2)2)*4/3]2 - X2

Check your arithmetic! There are several errors here.
 
  • #16
Svein said:
Check your arithmetic! There are several errors here.

All I really did was sub in for √3/2 for the two Cos, and then simplify so it became 4/3.
I'm not seeing my errors, sorry.

It would help if I understood the theory behind why we're taking the difference and squaring it.
As a simplified analogy. Say for instance you had a rectangle, and you had X and Y lengths and you wanted to find the closest you could make X and Y to make a shape of some constant surface area. Well we know intuitively that you can make X = Y and it will be a square, this is the same thing but it's a bit more complex so I don't know intutively what values of X and Y are the closest most ballenced values.
 
Last edited:
  • #17
tim9000 said:
All I really did was sub in for √3/2 for the two Cos, and then simplify so it became 4/3.
I'm not seeing my errors, sorry.
y - x = (C -(K^2 - (x/2)^2)^(0.5)/cos(30))/cos(30) -x. Substitute Cos(30)=√3/2 and get y - x = C - √(K^2 - (x/2)^2))*2/√3 - x. Square that, and get
(y-x)^2 = (C - x)^2 -2(C-x)*√(K^2 - (x/2)^2))*2/√3 + (K^2 - (x/2)^2))*4/3. Multiply and reorder:
(y-x)^2 = (C^2 + 4(K^2)/3) - 2Cx + (4x^2)/3+ 2(C-x)√(K^2 - (x/2)^2))*2/√3. Now do the rest.
tim9000 said:
It would help if I understood the theory behind why we're taking the difference and squaring it.
Because you specified that you wanted to minimize the difference between Y and X. Now the difference between Y and X may be negative and a large negative number is a valid minimum. You could minimize |Y - X|, but this is troublesome mathematically. Minimizing the square of the difference is better mathematically and removes the problem with negative differences.
 
  • #18
I see, I rearranged Y to be the wrong function in the first place, so:

[Y*cos(30) +(K^2 + (X/2)^2)^0.5] / cos(30) = C

Y = C - [√(K^2 + (X/2)^2) ] / cos(30) = C - 2*[√(K^2 + (X/2)^2) ] / √3

That's interesting, so you treated "C - X" as one term and expanded the right hand side as a perfect square? I didn't think to do that.
You still didn't answer me about : "Why (Y - X)2 and not (X - Y)2?" Is there no difference?So back to your method, that product and chain rule is a nightmare:
d [(Y - X)2 ] /dx = -2C + 8X/3 - [2XC−4X^2+8k^2] / [√3*√(2k−X)*√(X+2k)] = 0

(I used a derivative calculator)


X = something too complicated for me to work out because of that nasty fraction...

At this point I think I'd be better off trying to plot curves of the equation graphically in Excel or something and find a cross over point or something to tell me the smallest difference between X and Y satisfying the expression.
 
  • #19
I think I'd prefer to do away with all this and start again, say I had the equation 3X + Y = 100

same basic set-up, but a jolly lot simpler, so If I wanted to find the closest values of X and Y to each other to satisfy the equation, how would I do it?
Cheers!
 
  • #20
tim9000 said:
Why (Y - X)2 and not (X - Y)2?" Is there no difference?

No. (Y - X) = - (X - Y) and (-a)2 = a2
tim9000 said:
I think I'd prefer to do away with all this and start again, say I had the equation 3X + Y = 100

same basic set-up, but a jolly lot simpler, so If I wanted to find the closest values of X and Y to each other to satisfy the equation, how would I do it?
Cheers!
Same procedure. Your equations says Y = 100 - 3X and you want to minimize (Y - X). (Y - X) = 100 - 4X. (Y - X)2 = 10000 - 800X + 16X2.
The derivative is -800 + 32X, giving X = 25 and therefore Y = 100 - 3X = 100 - 75 = 25.
 
  • #21
Svein said:
No. (Y - X) = - (X - Y) and (-a)2 = a2

Ooh, so that's what you meant

Svein said:
Same procedure. Your equations says Y = 100 - 3X and you want to minimize (Y - X). (Y - X) = 100 - 4X. (Y - X)2 = 10000 - 800X + 16X2.
The derivative is -800 + 32X, giving X = 25 and therefore Y = 100 - 3X = 100 - 75 = 25

You're brilliant, thanks HEAPS.
I should have asked a simple version of the question like that in the first place!
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 16 ·
Replies
16
Views
3K
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K