• 0

C# Newton Raphson Method


Question

Just stumbled on a website providing a solution to the Newton Raphson method of solving polynomials.

Newton Raphson Website

However the particular example that they implement asks for a series of real coefficients which makes sense, but it also asks for 'imaginary coefficients', but i have no idea why it asks for them.

To try and solve an equation such as x^2 + 5x + 6, i put in 1,5,6 (at least i think this is correct) and because i dont know what to put for the imaginary coefficients i put the same. It gives me the correct answers of -2 and -3 along with some other weird answers.

Any ideas what this could be for and what i should put for them? I wont be dealing with complex numbers at all so can i just delete it? The rest of the code requires the list that it produces so i guess not.

However for other equations such as 2x^2 + 10x - 15 i put in 2,10,-15 for both and it gives me one correct answer but the other one doesnt work, is it me putting in the coefficients wrong or something to do with the code?

I am particulary interested in this code because of the way it solves for all roots instead of just the one that i am currently solving for in my implementation.

Thanks in advance

Link to comment
https://www.neowin.net/forum/topic/973194-c-newton-raphson-method/
Share on other sites

2 answers to this question

Recommended Posts

  • 0

I understand how the method works and the article says nothing about imaginary roots appart from in their implementation

On a completely different note i dont understand their method of finding other roots once one has been found.

In their example they use x^2 − 3x + 2 = 0 and get a first root of 2. I understand how to get to 1 * 2 + ( − 3) = − 1 by multiplying the coefficients etc but i get lost when it says how to display the results as 1 * x − 1 = 0. If i use this template all is good for other equations but i dont know how they actually got there. Plus is the same method applicable for cubic equations and if some what is the procedure?

Thanks for the reply

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.