Mówimy, że \(\displaystyle{ \alpha }\) jest pierwiastkiem - k=krotnym, funkcji \(\displaystyle{ f }\)
jeśli
\(\displaystyle{ f(\alpha)=f'(\alpha)=f^{''}(\alpha) =...f^(k-1)(\alpha)=0 }\) i \(\displaystyle{ f^{(k)}(\alpha)\neq 0 }\)
Na przykład funkcja
\(\displaystyle{ f(x) = x^3 -7x^2+11x -5 }\) ma pierwiastek \(\displaystyle{ x=1 }\) o krotności dwa.
Zakładamy, że funkcja \(\displaystyle{ f }\) ma pierwiastek \(\displaystyle{ \alpha }\) o krotności \(\displaystyle{ m.}\)
Definiujemy nową funkcję \(\displaystyle{ u(x) = \frac{f(x)}{f'(x)}, \ \ f'(\alpha) \neq 0 \ \ (1)}\)
Rozwijamy funkcję \(\displaystyle{ f }\) w szereg Taylora, w otoczeniu punktu \(\displaystyle{ \alpha.}\)
\(\displaystyle{ f(x) = (x-\alpha)^{m}\cdot h(x) \ \ (2) }\)
gdzie
\(\displaystyle{ h(x)= \frac{f^{(m)}(\alpha)}{m!} + \frac{f^{(m+1)}(\alpha)}{(m+1)!}\cdot (x-\alpha)+ \ \ ...}\)
Obliczamy pierwszą pochodną \(\displaystyle{ (2) }\)
\(\displaystyle{ f'(x) = (x-\alpha)^{m}\cdot h'(x) + m\cdot (x-\alpha)^{m-1}h(x) = }\)
\(\displaystyle{ = (x-\alpha)^{m-1}\dot [ (x-\alpha)\cdot h'(x)+m\cdot h(x)] \ \ (3)}\)
Z \(\displaystyle{ (2), \ \ (3) }\) wynika, że równanie \(\displaystyle{ (1)}\) może napisać w postaci
\(\displaystyle{ u(x) = \frac{x-\alpha) \cdot h(x)}{(x-\alpha)\cdot h'(x)+m\cdot h(x)} = (x-\alpha)\cdot \Psi(x) \ \ (4) }\)
gdzie:
\(\displaystyle{ \Psi(x) = \frac{h(x)}{(x-\alpha)\cdot h'(x)+m\cdot h(x)}. }\)
Ponieważ \(\displaystyle{ h(\alpha) = \frac{f^{(m)}}{m!}, }\) więc
\(\displaystyle{ \lim_{x\to \alpha} \Psi(x) = \frac{1}{m} }\)
i
\(\displaystyle{ \lim_{x\to \alpha} u'(x) = \lim_{x\to \alpha}[(x-\alpha)\cdot \Psi'(x) + \Psi(x)] = \frac{1}{m} \ \ (5) }\)
Z \(\displaystyle{ (4), \ \ (5) }\) wynika, że funkcja \(\displaystyle{ u(x) }\) ma pierwiastek pojedyńczy \(\displaystyle{ x = \alpha. }\)
Zastosowanie metody Newtona do tej funkcji daje
\(\displaystyle{ x_{n+1} = x_{n} - m\cdot \frac{f(x_{n})}{f'(x_{n})} , \ \ f'(x_{n}) \neq 0 \ \ (6) }\)
Równanie \(\displaystyle{ (6) }\) nazywamy Zmodyfikowaną Metodą Newtona.
Program w OCTAVE
Kod: Zaznacz cały
function newton2(f,df,x0,m,tol,n)
iter=0;
u=feval(f,x0);
v=feval(df,x0);
err=abs(m*u/v);
disp('_____________________________________________________')
disp('iter xn f(xn) f'(xn) |xn+1-xn| ')
disp('_____________________________________________________')
fprintf('%2.0f %12.6f %12.6f %12.6f\n',iter,x0,u,v)
while(err>tol)&(iter<n)&(v~=0)
x1=x0-m*u/v;
err=abs(x1-x0);
x0=x1;
u=feval(f,x0);
v=feval(df,x0);
iter=iter+1;
fprintf('%2.0f %12.6f %12.6f %12.6f\n',iter,x0,u,v,err)
pause(1)
y(iter)=err;
endwhile
if(v==0)
disp('Dzielenie przez zero')
end
if(iter>n)
disp('Metoda nie jest zbieżna')
end
function f=f3(x)
f=x.^3-4*x.^2-3*x+18;
function f=df3(x)
f=3*x.^2-8*x-3;
>> newton2('f3','df3',0,2,10^(-12),40)
__________________________________________________________
iter xn f(xn) f'(xn) |xn+1-xn|
__________________________________________________________
0 0.000000 18.000000 -3.000000
1 12.000000 1134.000000 333.000000 12.000000
2 5.189189 34.454544 36.269540 6.810811
3 3.289273 0.442600 3.143766 1.899916
4 3.007700 0.000297 0.077175 0.281573
5 3.000006 0.000000 0.000059 0.007694
6 3.000000 0.000000 -0.000000 0.000006
7 3.000000 0.000000 -0.000000 0.000000