Troubleshooting Newton's Method for f(x) and g(x)

In summary, the speaker is trying to use Newton's method to find the intersection of two functions, f(x) = x and g(x) = tan(x). They subtracted the two functions to get a new function, H(x) = x - tan(x), and found its differential to be 1 - sec^2 (x). They estimated the solution to be around 4.1 by looking at the graph, but their calculated answer using Newton's method was wrong. They realize they need a better first approximation and receive advice from others on how to choose a suitable starting point for the method.
  • #1
RadiationX
256
0
i have the answer to this problem i just see why I'm not getting the same answer as my solution manuel. i Have two functtions f(x) = x and g(x) = tan(x)
and i have to find where these two functions are equal using Newtons method.
i subtracted the two functions to get this new function H(x) = x -tan(x) then i found the differential of this new function to be 1 - sec^2 (x). now by looking at the given graph of the first two functions i estimated the soulution to be about 4.1. then by unising Newtons method i calculated two iterations and got an answer of 8.5987, which is wrong the answer is 4.493. what could i be doing wrong? i know how to use Newtons method.
 
Physics news on Phys.org
  • #2
You need to use a better first approximation.
 
  • #3
RadiationX said:
i have the answer to this problem i just see why I'm not getting the same answer as my solution manuel. i Have two functtions f(x) = x and g(x) = tan(x)
and i have to find where these two functions are equal using Newtons method.
i subtracted the two functions to get this new function H(x) = x -tan(x) then i found the differential of this new function to be 1 - sec^2 (x). now by looking at the given graph of the first two functions i estimated the soulution to be about 4.1. then by unising Newtons method i calculated two iterations and got an answer of 8.5987, which is wrong the answer is 4.493. what could i be doing wrong? i know how to use Newtons method.

Are you sure that the two functions are only equal in one place? x and tan x intersect in *lots* of places.
 
  • #4
x has to be between pi/2 and 3pi/2 these are the asmyspotes.
 
  • #5
Muzza said:
You need to use a better first approximation.

You need a real good first approximation, otherwise it never converges. If you know that the tangent of 3 pi/2 is undefined and start a little lower than that, you're okay. If your guess is less than around 4.29, you won't converge.
 
  • #6
thanks guys the last reply helped me out.
 

1. What is Newton's method for solving equations?

Newton's method is an algorithm used to find the roots of a given equation. It involves using the derivative of the equation to iteratively refine an initial guess until the desired accuracy is achieved.

2. How does Newton's method work?

Newton's method works by starting with an initial guess for the root of the equation. The derivative of the equation is then calculated at that point, and the tangent line is drawn. The point where the tangent line intersects the x-axis becomes the next guess, and this process is repeated until the desired accuracy is reached.

3. What is the significance of f(x) and g(x) in troubleshooting Newton's method?

f(x) is the original equation for which we are trying to find the root, while g(x) is the derivative of f(x). These functions are used in Newton's method to calculate the tangent line and to determine the next guess for the root.

4. What are some common issues that can arise when using Newton's method to solve equations?

Some common issues include getting stuck in an infinite loop, not reaching the desired accuracy, and encountering division by zero errors. These issues can be avoided by carefully choosing the initial guess and ensuring that the equation and its derivative are well-behaved.

5. How can I troubleshoot and fix issues with Newton's method?

To troubleshoot and fix issues with Newton's method, you can try changing the initial guess, using a different equation or derivative, or using a different method altogether. It is also important to carefully check for any errors in the code and to understand the behavior of the algorithm to identify potential issues.

Similar threads

  • Calculus
Replies
13
Views
1K
Replies
11
Views
1K
Replies
7
Views
4K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
1K
  • Calculus
Replies
13
Views
2K
  • Calculus
Replies
11
Views
1K
Replies
18
Views
2K
Back
Top