Finding Point where Gradient is the Greatest

  • Thread starter Thread starter mariya259
  • Start date Start date
  • Tags Tags
    Gradient Point
mariya259
Messages
17
Reaction score
0
I have the function:
f(x,y)= x*(y^2)*e^-((x^2+y^2)/4)
I am not sure how to find the point where the gradient is the greatest.
The gradient I found after taking the partials is:
partial with respect to x: e^(-(x^2+y^2)/4)*((y^2)-.5(x^2)(y^2))
partial with respect to y:e^(-(x^2+y^2)/4)*(2yx-.5x(y^3))
What do I do next?
(I have also found min/max points for this function)
 
Physics news on Phys.org
If you are trying to maximize the length of the gradient over the region, you might want to try squaring the gradient, so that it is a map from the plane to the real numbers, and use methods you have on that. (The gradient is longest where it's square is longest.)
 
mariya259 said:
I have the function:
f(x,y)= x*(y^2)*e^-((x^2+y^2)/4)
I am not sure how to find the point where the gradient is the greatest.
The gradient I found after taking the partials is:
partial with respect to x: e^(-(x^2+y^2)/4)*((y^2)-.5(x^2)(y^2))
partial with respect to y:e^(-(x^2+y^2)/4)*(2yx-.5x(y^3))
What do I do next?
(I have also found min/max points for this function)
Hello mariya259. Welcome to PF !

You sure are having fun with this function, aren't you ?

Added in Edit:

It is easier to work with the square of the magnitude of the gradient, rather than with the magnitude of the gradient itself.

Get that by summing the squares of the two components which you have found.

It sure involves some messy algebra !
 
Last edited:
Do you mean taking the square root of each of the partials squared to find the maginitude:
sqrt((e^(-(x^2+y^2)/4)*((y^2)-.5(x^2)(y^2)))^2 + (e^(-(x^2+y^2)/4)*(2yx-.5x(y^3)))^2) ?
 
You don't want to maximize, that, it'll be unnecessarily computationally complicated. If you square it, looking for critical points won't be as messy.
 
So only this part is what I need to do?
e^(-(x^2+y^2)/4)*((y^2)-.5(x^2)(y^2)))^2 + (e^(-(x^2+y^2)/4)*(2yx-.5x(y^3)))^2
 
Yes. Maximize the square of the gradient, to find the point where the gradient is longest.
 
I took the sum of squares. From what I understand now I need to set it equal to 0 and solve for critical points?
 
mariya259 said:
I took the sum of squares. From what I understand now I need to set it equal to 0 and solve for critical points?

No. You need to find the gradient of your new function (which is the square of the length of the gradient of the old function), then set this new gradient to zero. After all, is that not what you do when you want to maximize something?

RGV
 
  • #10
mariya259 said:
Do you mean taking the square root of each of the partials squared to find the maginitude:
sqrt((e^(-(x^2+y^2)/4)*((y^2)-.5(x^2)(y^2)))^2 + (e^(-(x^2+y^2)/4)*(2yx-.5x(y^3)))^2) ?
As algebrat said, if you work with the square of this, life will be easier. The maximum will occur in the same location for both this function and its square.

You can factor out a common factor to simplify matters a bit.

The square of the gradient as you gave it, which I think is correct, is:

\displaystyle \left(e^{-(x^2+y^2)/4}\ ((y^2)-.5(x^2)(y^2))\right)^2 + \left(e^{-(x^2+y^2)/4}\ (2yx-.5x(y^3))\right)^2<br /> =\left(e^{-(x^2+y^2)/4}\right)^2\left(((y^2)-.5(x^2)(y^2))^2+(2yx-.5x(y^3))^2\right)
\displaystyle =e^{-(x^2+y^2)/2}\left(16 x^2 y^2+4 y^4-12 x^2 y^4+x^4 y^4+x^2 y^6\right)/4​

That's still pretty messy.

It turns out that the gradient is maximum where you might expect --- midway between neighboring min & max .
 
  • #11
Alright. To find the partials and critical points can I just use the function with the sum of squares or do I need to take the function of the square root(sum of squares)?
 
  • #12
mariya259 said:
Alright. To find the partials and critical points can I just use the function with the sum of squares or do I need to take the function of the square root(sum of squares)?

This question was already answered. Anyway, instead of asking, just DO IT. If you do it both ways and compare the work involved, you will soon see which method is better. A good way to learn is to try thing yourself.

RGV
 
  • #13
I understand you can use sum of squares instead of the sqrt of everything, I don't understand why you can do that. Wouldn't the square root change the answer of where the maximum is?
 
  • #14
Below is a graph of your function as given by WolframAlpha.
attachment.php?attachmentid=47872&stc=1&d=1338490009.gif


Below is a graph of the square ot the gradient you gave as graphed by WolframAlpha with relative maxima indicated in red.
attachment.php?attachmentid=47877&stc=1&d=1338490365.gif
 

Attachments

  • Function_xy.gif
    Function_xy.gif
    9.2 KB · Views: 550
  • Max_Grad_squared.gif
    Max_Grad_squared.gif
    14.8 KB · Views: 594
  • #15
mariya259 said:
I understand you can use sum of squares instead of the sqrt of everything, I don't understand why you can do that. Wouldn't the square root change the answer of where the maximum is?
No.

If a > b ≥ 0, then a2 > b2. Right ?
 
Back
Top