2
$\begingroup$

I have the following function: $f(x,y) = x(y^2-x^2)- \frac{(x^2 +y^2)^2}{2\rho}+\frac{3x^2(y^2-4x^2)}{\rho}$ where $\rho>0$ is a constant.

My goal is to find the maximum value of this function subject to the constraint $x^2 +y^2 \leq 1$.

What is the best way to solve this problem?

My thoughts:

  1. I think I can replace the second term $\frac{(x^2 +y^2)^2}{2\rho}$ with $\frac{1}{2\rho}$ since due to the constraint $x^2 +y^2 \leq 1$.

But, I am not sure how to proceed. Can someone show me the steps for solving this problem? What would be the easiest way to approach this?

$\endgroup$
4
  • 1
    $\begingroup$ Try this: Maximize[{x (y^2 - x^2) - (x^2 + y^2)^2/(2 rho) + (3 x^2 (y^2 - 4 x^2))/rho, x^2 + y^2 <= 1, rho > 0}, {x, y}]. And you'll see that it depends on the parameter value of $\rho$. $\endgroup$
    – ppp
    Jan 29 at 2:27
  • $\begingroup$ @ppp Is there a way to solve this in mathematical online? I am new to mathematica $\endgroup$
    – wanderer
    Jan 29 at 2:43
  • $\begingroup$ I know there is a free access to Mathematica online for students. $\endgroup$
    – ppp
    Jan 29 at 2:51
  • $\begingroup$ @wanderer For this problem you can use the free online WolframAlpha. Substitute r for rho and Maximize[{x(y^2-x^2)-(x^2+y^2)^2/(2 r)+(3 x^2(y^2-4 x^2))/r,x^2+y^2<=1,r>0},{x,y}] returns a solution in 15 seconds. It goes on to try to do a bunch of additional calculations and formatting, but times out before finishing that, but you got the solution before that $\endgroup$
    – Bill
    Jan 29 at 3:15

1 Answer 1

4
$\begingroup$
$Version

(* "14.0.0 for Mac OS X ARM (64-bit) (December 13, 2023)" *)

Clear["Global`*"]

f[x_, y_] := 
 x (y^2 - x^2) - (x^2 + y^2)^2/(2 ρ) + 3 x^2 (y^2 - 4 x^2)/ρ

MaxValue[{f[x, y], x^2 + y^2 <= 1, 0 < ρ}, {x, y, ρ}]

(* 1 *)

Maximize[{f[x, y], x^2 + y^2 <= 1, 0 < ρ}, {x, y, ρ}]

(* Maximize::natt: The maximum is not attained at any point satisfying the given constraints. 

{1, {x -> -1, y -> 0, ρ -> ComplexInfinity}} *)

f[-1, 0]

(* 1 - 25/(2 ρ) *)

Limit[f[-1, 0], ρ -> ∞]

(* 1 *)

EDIT: If ρ has a fixed value, the maximum is a complicated Piecewise expression that depends on the specific value of ρ

max = Assuming[ρ > 0, 
  MaxValue[{f[x, y], x^2 + y^2 <= 1, 0 < ρ}, {x, y}] // FullSimplify]

enter image description here

$\endgroup$
4
  • $\begingroup$ Thank you. I am having some trouble understanding. Could you please explain the result? Is the maximum value 1? What does this mean? "(* Maximize::natt: The maximum is not attained at any point satisfying the given constraints. {1, {x -> -1, y -> 0, ρ -> ComplexInfinity}} *) " $\endgroup$
    – wanderer
    Jan 29 at 2:42
  • 1
    $\begingroup$ The maximum of 1 occurs when \[Rho] is Infinity. Since Infinity is not a number, it cannot be used to define a point ({x, y, \[Rho]}), i.e., there is no point that satisfies the constraints. The maximum is arbitrarily close to 1, i.e., the maximum is 1 in the limit. $\endgroup$
    – Bob Hanlon
    Jan 29 at 2:53
  • $\begingroup$ Thanks. But, in my case $\rho$ is an unknown constant. So, for a given $\rho$, is the maximum $1-\frac{25}{2\rho}$? $\endgroup$
    – wanderer
    Jan 29 at 3:03
  • $\begingroup$ No. See the edit. $\endgroup$
    – Bob Hanlon
    Jan 29 at 5:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.