in numerical analysis Householder methods
are a class of root finding algorithms,
with this update formula where d denotes the number of algorithm in the householder class:
![7a5b04531fa3e4601f2d6c503c0f980636b4f417](https://private-user-images.githubusercontent.com/53050138/252715381-9aa27e41-9fbf-45ee-8454-9856f754335b.svg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTczNTUwMTMsIm5iZiI6MTcxNzM1NDcxMywicGF0aCI6Ii81MzA1MDEzOC8yNTI3MTUzODEtOWFhMjdlNDEtOWZiZi00NWVlLTg0NTQtOTg1NmY3NTQzMzViLnN2Zz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MDIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjAyVDE4NTgzM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTU3ZDcxMGEyZjdhZWMxMzI0YTA0NjlmNjI3YjgxYmY0YTYwODE0YzQ4ZmI5N2I3MjRkZWJiZDU2ZmZkNjc5ZmMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.-mXfd2d_p_EHltCblul2oScuz2it2Zp9LMl15hyfENg)
but there is another way to use Householder methods not using the mentioned formula!!
writing Taylor_serie of the given function with d sentences (where d denotes the number of algorithm in
the householder class) around $x_n$ with $x_{n+1}$ as the variable, solving it as algebraic equation would give us the update formula!!
lets take an example, consider $cos(x)$ as the function that we want to find its roots with different householder method
writting taylor serie with $d=1$ we would have:
$\frac{f(x_n)}{0!}+ \frac{f'(x_n)}{1!}(x_{n+1} - x_n) = 0$
$\frac{cos(x_n)}{0!}+ \frac{-sin(x_n)}{1!}(x_{n+1} - x_n) = 0$
$cos(x_n) - sin(x_n)x_{n+1} + sin(x_n)x_n = 0$
$x_{n+1} =\frac{-cos(x_n) - sin(x_n)x_n}{-sin(x_n)} = 0$
$x_{n+1} =x_n + cot(x_n) $
here in this jupyter notebook file
I implemented a function to solve $cos(x) = 0$ equation with a given initial guess and number of generation
if you want to solve another equation replace these lines with your function and its derivatives.
f = math.cos(guess)
fprim = -math.sin(guess)
and here it is the result of running with 10 generation & initial guess equal to one(in radian),
notice that the sequence approaches to the nearest answer to the initial guess.
![Screenshot from 2023-07-11 23-12-09](https://private-user-images.githubusercontent.com/53050138/252775219-56cc49e5-2ebe-488a-9323-cdd6e71b03a4.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTczNTUwMTMsIm5iZiI6MTcxNzM1NDcxMywicGF0aCI6Ii81MzA1MDEzOC8yNTI3NzUyMTktNTZjYzQ5ZTUtMmViZS00ODhhLTkzMjMtY2RkNmU3MWIwM2E0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MDIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjAyVDE4NTgzM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTdiNzk5ZWUxYTAwNDA2NTA1ZjQ1MjdjZTlmZWZjMzEwYzgwZmEyMDZmYzFjM2Q5MTI4M2NmZTg2YzhhMjBkOTYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.mHJcnQcrPaRfamGiawvVoEJxAFIw7RELtAkFWAgsfLQ)
lets write taylor serie with $d=2$
$\frac{f(x_n)}{0!} + \frac{f'(x_n)}{1!}(x_{n+1} - x_n) + \frac{f''(x_n)}{2!}(x_{n+1} - x_n) = 0$
$\frac{cos(x_n)}{0!} + \frac{-sin(x_n)}{1!}(x_{n+1} - x_n) + \frac{-cos(x_n)}{2!}(x_{n+1} - x_n)^2 = 0$
$(\frac{1}{2}cos(x_n))x_{n+1}^2 + (-sin(x_n)+cos(x_n))x_{n+1} +(-\frac{1}{2}cos(x_n)x_n^2 + sin(x_n)x_n + cos(x_n)) = 0$
lets solve this equation using delta method, with
$a = \frac{1}{2}cos(x_n)$
$b = -sin(x_n)+cos(x_n)$
$c = -\frac{1}{2}cos(x_n)x_n^2 + sin(x_n)x_n + cos(x_n)$
$\Delta = (-sin(x_n)+cos(x_n))^2 - 4(\frac{1}{2}cos(x_n))(-\frac{1}{2}cos(x_n)x_n^2 + sin(x_n)x_n + cos(x_n))$
$x_{n+1} = \frac{(sin(x_n)-cos(x_n) \pm \sqrt{\Delta})}{cos(x_n)}$
and here it is the result of running with 10 generation & initial guess equal to one(in radian),
compare it with newton raphson result diagram!
![Screenshot from 2023-07-12 02-40-09](https://private-user-images.githubusercontent.com/53050138/252814665-d19b3de8-904c-4c3d-923d-2f8cd4508bce.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTczNTUwMTMsIm5iZiI6MTcxNzM1NDcxMywicGF0aCI6Ii81MzA1MDEzOC8yNTI4MTQ2NjUtZDE5YjNkZTgtOTA0Yy00YzNkLTkyM2QtMmY4Y2Q0NTA4YmNlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MDIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjAyVDE4NTgzM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTIzNzVlN2FjNGJhNzc1MDE5NzhiNTQ5M2M0MTlhNjZmN2IzN2IzY2FmZmNmNTkwODhhYmU3MDkzNTRmOTljNDQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.DuUXHy8OW4WUdVtwVYVliRuCmpl3dLszNaveJHyhANI)
consider Halley method, what happen if $\Delta$ became negative?
the answer would be an update method including a complex function, does the root finding algorithms have meaning in the complex plane?
a related link