Finding the maximum value of a function

Click For Summary

Homework Help Overview

The discussion revolves around finding the maximum value of the function f(x) = sin x / x using Newton's 1D method. Participants are exploring the application of Newton's method in the context of optimization rather than root finding.

Discussion Character

  • Exploratory, Assumption checking, Problem interpretation

Approaches and Questions Raised

  • The original poster attempts to apply Newton's method but expresses confusion over the results, particularly regarding the convergence point. Some participants question the appropriateness of using the second derivative in this context and seek clarification on the correct formula for Newton's method.

Discussion Status

Participants are actively discussing the validity of the original poster's approach and the formula used. There is recognition that the method may lead to local minima rather than the global maximum, prompting suggestions to try different starting points. Some participants are reflecting on the nature of the function and the challenges of identifying the global maximum.

Contextual Notes

There are indications of confusion regarding the application of Newton's method for optimization versus root finding. The original poster's results suggest a misunderstanding of the method's behavior based on the chosen starting point. The discussion also touches on the need for safeguards in practical implementations of Newton's method to avoid divergence.

yugeci
Messages
61
Reaction score
0

Homework Statement



Find the extremizing (maximum) value of the function f(x) = sin x / x using Newton's 1D method.

Homework Equations



upload_2015-12-4_16-13-34.png
[/B]

The Attempt at a Solution



I know the maximum point in this equation is (0, 1). When I differentiated the equation twice and used the formula above, I managed to get a converging value of x at 4.49 radians and my corresponding value of f(x) is -0.217. I checked this using wolframalpha as well, and the converging value is 4.49 radians also. I'm sure I didn't make any silly algebraic errors, so what could be wrong here?
 
Physics news on Phys.org
1 Check the formula. It doesn't make sense to me to bring in a second derivative !

2 Where did you start ? Show what you did in more detail. You and I are not interested in the answer, we want the correct path to find it !

-- :smile:
 
Last edited:
I think the formula should be right. My teacher derived it from the Taylor Series, but I don't have my notes right now so I can't show that.

It would take a while to type my working in LaTeX so I just took pictures of what I did. Just simple differentiation twice and then simplification. Then I took the initial value of x as 3 radians, and then kept iterating. Converged at ~4.49 radians.
 

Attachments

  • 1.jpg
    1.jpg
    61.6 KB · Views: 515
  • 2.jpg
    2.jpg
    62.5 KB · Views: 506
yugeci said:
I think the formula should be right. My teacher derived it from the Taylor Series, but I don't have my notes right now so I can't show that.
Well, the formula in the OP is not Newton's Method, which is why your results are incorrect. :frown:

The correct formula is ##x_{new} = x_{old} - \frac{f(x)}{f'(x)}##

https://en.wikipedia.org/wiki/Newton's_method
 
  • Like
Likes   Reactions: yugeci
I thought that method was for root finding? I am finding the maximum value of a function. Unless my concepts are wrong here..
 
99ca3ee7752a4df7bf1c4bbb7c963595.png
(##\leftarrow##clickable link) is what they say in general. Makes much more sense if you look at it.
Nice picture too: here
 
yugeci said:
I thought that method was for root finding? I am finding the maximum value of a function. Unless my concepts are wrong here..
You're right. Late nite. Scratch that post.
 
OK I got it. But please correct me if I am wrong:

upload_2015-12-4_16-56-45.png


The formula you posted will give me the red circled values (function when x = 0), and the one I posted gives me the green value (converging value of x)? Just let me know if I'm wrong then I'll look up a book again. :wideeyed:
 

Attachments

  • upload_2015-12-4_16-56-34.png
    upload_2015-12-4_16-56-34.png
    3.3 KB · Views: 500
yugeci said:

Homework Statement



Find the extremizing (maximum) value of the function f(x) = sin x / x using Newton's 1D method.

Homework Equations



View attachment 92880[/B]

The Attempt at a Solution



I know the maximum point in this equation is (0, 1). When I differentiated the equation twice and used the formula above, I managed to get a converging value of x at 4.49 radians and my corresponding value of f(x) is -0.217. I checked this using wolframalpha as well, and the converging value is 4.49 radians also. I'm sure I didn't make any silly algebraic errors, so what could be wrong here?
If you plot y = sin(x) / x with WA, you'll see that this function oscillates quite a bit when x > 0. Your initial guess for x, whatever it was, has led the Newton's method to locate one of the relative minimas, which happens to be located at x ≈ 4.49 rad.

You may have to try different starting points to see what pops out of the Newton's method for this function, since there are a lot of relative extremums, but only one global maximum point at x = 0.
 
  • #10
Interesting. I just realized that now looking at the plot again. Is there no way of figuring out where the global maximum will approximately be beforehand? Or do you have to just keep guessing?
 
  • #11
SteamKing said:
You're right. Late nite. Scratch that post.
Woops, me 2 ! o:) o:)
 
  • #12
yugeci said:

Homework Statement



Find the extremizing (maximum) value of the function f(x) = sin x / x using Newton's 1D method.

Homework Equations



View attachment 92880[/B]

The Attempt at a Solution



I know the maximum point in this equation is (0, 1). When I differentiated the equation twice and used the formula above, I managed to get a converging value of x at 4.49 radians and my corresponding value of f(x) is -0.217. I checked this using wolframalpha as well, and the converging value is 4.49 radians also. I'm sure I didn't make any silly algebraic errors, so what could be wrong here?

Your formula is correct, since you are trying to solve the equation ##f^{\prime}(x) = 0##. However, you need to start from near the solution, and starting from some points can lead to disaster; for example, starting from ##x_0 = 2## give you ##x_1 \doteq -22.617##, and if you choose another ##x_0## near ##2## you can even make ##x_1 < -10^{100}##. Practical implementations of Newton's method build in various "safeguards" to prevent that behavior from occurring, but they can sometimes slow down the convergence rate.

Basically, the way modern "global optimization" packages work is by a sophisticated implementation of "guessing", although there are some methods for 1-variable problems that avoid guessing or trial-and-error. One well-studied method is that of Bruno Shubert (B. Schubert, "A Sequential Method Seeking the Global Maximum of a Function", SIAM Journal on Numerical Analysis (1972), Volume 9, #3, pp. 379-388), but newer variants exist now that may be much more efficient---I haven't kept up with that literature.
 
  • Like
Likes   Reactions: BvU

Similar threads

  • · Replies 5 ·
Replies
5
Views
2K
Replies
3
Views
2K
  • · Replies 6 ·
Replies
6
Views
5K
  • · Replies 2 ·
Replies
2
Views
1K
Replies
2
Views
1K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 10 ·
Replies
10
Views
3K
Replies
2
Views
1K
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K