Many graphing calculators have a numerical function for approximating the derivative of a given function. You can make use of that to simplify your process of Newton's method iteration to find the maximum. (Many graphing calculators will also find the maximum for you.)
Using the graphing calculator at the source link, we have defined an iterator (g1(x)) for the function g(x) = f'(x), the derivative of the given f(x). The function f will have a maximum where its derivative is zero. Newton's method works well for finding zeros.
Using the graph value of the x-coordinate of the peak of f(x) as a starting point, we can simply start typing g1(2.029...) to find that the iterated value is 2.208.... Backing up one digit, we can continue typing the iterated value shown to get the x-value of the maximum,
.. x ≈ 2.02875783811
Since we are asked for the maximum value of f(x), we must evaluate f(x) at that point.
The maximum of f(x) is very near f(2.02875783811) ≈ 16.3773516704 ≈ 16.377352
To find the maximum value for this function, we need to differentiate!
f(x) = 9xsinx
f'(x) = 9sinx + 9xcosx
We now set this derivative equal to zero and solve for 'x':
f'(x) = 0 (max value)
9sinx + 9xcosx = 0
sinx + xcosx = 0
We 'cannot' solve this equation since it a non - linear equation and cannot be solved using algebraic methods. What we need to do is use the Newton - Raphson method to find the root!
Newton - Raphson formula :
x₁ = x₀ - [f(x₀)/f'(x₀)]
Since we are working on the interval 0 ≤ x ≤ π, we take a point estimate to be last say x₀ = π/2.
So we have :
x₀ = π/2
f(x₀) = 1
f'(x₀) = - π/2
Substitute these values into the Newton - Raphson formula :
x₁
= x₀ - [f(x₀)/f'(x₀)]
= (π/2) - [1/(- π/2)]
≈ 2.207416
So out first estimate x₁ using the formula is x₁ ≈ 2.207416. We now take this estimate and perform another iteration using the same formula :
x₁ = 2.207416
f(x₁) = - 0.508156
f'(x₁) = - 2.963966
We now substitute these values into the iterative formula in order to find our second estimate :
x₂
= x₁ - [f(x₁)/f'(x₁)
= 2.207416 - [- 0.508156/- 2.963966]
= 2.035971
Hence our second estimate is x₂ ≈ 2.035971
Let's find out third estimate shall we?!
x₂ = 2.035971
f(x₂) = - 0.01955
f'(x₂) = - 2.71679
Applying our iterative formula yields :
x₃
= x₂ - [f(x₂)/f'(x₂)]
= 2.035971 - [- 0.01955/- 2.71679]
= 2.028775
We getting closer!
Yaaaaaaay !!!!!!!!!!!!!!!!!!!!!!!!!
Let's perfom one more iteration shall we?!
x₃ = 2.028775
f(x₃) = - 0.000046405
f'(x₃) = - 2.7039777
On substituting these values yields :
x₄
= x₃ - [f(x₃)/f'(x₃)]
= 2.028775 - [- 0.000046405/- 2.7039777]
≈ 2.028757859
Thus our fourth estimate is : x₄ ≈ 2.028757859
The actual maximum occurs at :
x = 2.028757859
So we are accurate to 7 dp!
That's pretty impressive don't you think considering it only took us four iterations to get there?!
Hope this helps !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
P.S. (Don't forget to vote me best answer as being the first to correctly answer your question!) ☺
Answers & Comments
Many graphing calculators have a numerical function for approximating the derivative of a given function. You can make use of that to simplify your process of Newton's method iteration to find the maximum. (Many graphing calculators will also find the maximum for you.)
Using the graphing calculator at the source link, we have defined an iterator (g1(x)) for the function g(x) = f'(x), the derivative of the given f(x). The function f will have a maximum where its derivative is zero. Newton's method works well for finding zeros.
Using the graph value of the x-coordinate of the peak of f(x) as a starting point, we can simply start typing g1(2.029...) to find that the iterated value is 2.208.... Backing up one digit, we can continue typing the iterated value shown to get the x-value of the maximum,
.. x ≈ 2.02875783811
Since we are asked for the maximum value of f(x), we must evaluate f(x) at that point.
The maximum of f(x) is very near f(2.02875783811) ≈ 16.3773516704 ≈ 16.377352
f(x) = 9x sin(x)
f'(x) = 9 sin(x) + 9 x cos(x)
to solve f'(x) = 0
g(x) = 9 sin(x) + 9 x cos(x)
g'(x) = 9 cos(x) + 9 cos(x) - 9 x sin(x)
g'(x) = 18 cos(x) - 9 x sin(x)
Start off with a guess value x0=2x0 = 3.000000000
x1 = x0 - f(x0) / f'(x0) = 3 - (-25.45971734) / (-21.63010516) = 1.822949905
x2 = x1 - f(x1) / f'(x1) = 1.8229499 - (4.6221262) / (-20.37855116) = 2.049763193
x3 = x2 - f(x2) / f'(x2) = 2.04976319 - (-0.51468797) / (-24.66748408) = 2.028898156
x4 = x3 - f(x3) / f'(x3) = 2.02889816 - (-0.00341486) / (-24.33778748) = 2.028757845
x5 = x4 - f(x4) / f'(x4) = 2.02875784 - (-1.6e-7) / (-24.33552245) = 2.028757838
x6 = x5 - f(x5) / f'(x5) = 2.02875784 - (0) / (-24.33552234) = 2.028757838
x = 2.028757838
The critical value of f(x) is x = 2.028758
g''(x) = -18sin(x)-9sin(x)-9x cos(x)
g''(x) = -27sin(x) -9x cos(x)
g''(2.028758) = -16.14 < 0 so f(x) is maximum at x=2.028758
OK, here we go sweetheart :)
To find the maximum value for this function, we need to differentiate!
f(x) = 9xsinx
f'(x) = 9sinx + 9xcosx
We now set this derivative equal to zero and solve for 'x':
f'(x) = 0 (max value)
9sinx + 9xcosx = 0
sinx + xcosx = 0
We 'cannot' solve this equation since it a non - linear equation and cannot be solved using algebraic methods. What we need to do is use the Newton - Raphson method to find the root!
Newton - Raphson formula :
x₁ = x₀ - [f(x₀)/f'(x₀)]
Since we are working on the interval 0 ≤ x ≤ π, we take a point estimate to be last say x₀ = π/2.
So we have :
x₀ = π/2
f(x₀) = 1
f'(x₀) = - π/2
Substitute these values into the Newton - Raphson formula :
x₁
= x₀ - [f(x₀)/f'(x₀)]
= (π/2) - [1/(- π/2)]
≈ 2.207416
So out first estimate x₁ using the formula is x₁ ≈ 2.207416. We now take this estimate and perform another iteration using the same formula :
x₁ = 2.207416
f(x₁) = - 0.508156
f'(x₁) = - 2.963966
We now substitute these values into the iterative formula in order to find our second estimate :
x₂
= x₁ - [f(x₁)/f'(x₁)
= 2.207416 - [- 0.508156/- 2.963966]
= 2.035971
Hence our second estimate is x₂ ≈ 2.035971
Let's find out third estimate shall we?!
x₂ = 2.035971
f(x₂) = - 0.01955
f'(x₂) = - 2.71679
Applying our iterative formula yields :
x₃
= x₂ - [f(x₂)/f'(x₂)]
= 2.035971 - [- 0.01955/- 2.71679]
= 2.028775
We getting closer!
Yaaaaaaay !!!!!!!!!!!!!!!!!!!!!!!!!
Let's perfom one more iteration shall we?!
x₃ = 2.028775
f(x₃) = - 0.000046405
f'(x₃) = - 2.7039777
On substituting these values yields :
x₄
= x₃ - [f(x₃)/f'(x₃)]
= 2.028775 - [- 0.000046405/- 2.7039777]
≈ 2.028757859
Thus our fourth estimate is : x₄ ≈ 2.028757859
The actual maximum occurs at :
x = 2.028757859
So we are accurate to 7 dp!
That's pretty impressive don't you think considering it only took us four iterations to get there?!
Hope this helps !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
P.S. (Don't forget to vote me best answer as being the first to correctly answer your question!) ☺
I have tried many times but all my answers were wrong !!!
I spent all my trials except the last one !!
either
I get the point or not!!!