- #1

- 325

- 51

- TL;DR Summary
- How do you find real roots using Newton-Raphson method on functions that are only real for part of their domain?

I'm trying to code Newton Raphson's method for finding zeros. I realize that even if the solution is real, it's possible for guesses to be complex. For example:

$$y=\sqrt{x-6}-2$$

While 10 is a valid real root, for any guess less than 6, the result is complex.

I tried to run the code allowing for complex numbers, starting with 1. It converged on ##11+8.94i## which may be a solution, but I was hoping it would be able to find the real solution of 10.

Would it be possible to get the method to find real roots on functions with complex values, without a priori knowing where the real part of the domain is?

Thanks!

$$y=\sqrt{x-6}-2$$

While 10 is a valid real root, for any guess less than 6, the result is complex.

I tried to run the code allowing for complex numbers, starting with 1. It converged on ##11+8.94i## which may be a solution, but I was hoping it would be able to find the real solution of 10.

Would it be possible to get the method to find real roots on functions with complex values, without a priori knowing where the real part of the domain is?

Thanks!