User:Gauge00/sandbox

derivatives of the $$D=1/f$$
Let's define a new function $$D=1/f(x)$$. Then $$D'(x) = -f^\prime/f^2 = -f^\prime D / f$$


 * $$-f D^{\prime} = Df^{\prime} $$

Differentiating multiple times, we get


 * $$-fD^{\prime\prime} = 2D^{\prime} f^\prime + Df^{\prime \prime} $$


 * $$-fD^{\prime\prime\prime} = 3D^{\prime\prime}f^{\prime} + 3D^{\prime}f^{\prime\prime}

+ Df^{\prime\prime\prime}$$


 * $$-fD^{\prime\prime\prime\prime} = 4D^{\prime\prime\prime}f^{\prime} + 6D^{\prime\prime} f^{\prime\prime}

+ 4D^{\prime}f^{\prime\prime\prime} + Df^{\prime\prime\prime\prime} $$

The coefficients of the above equations are those of the Pascal's triangle. Taking $$C(n, k)$$ notation for the binomial coefficient, we would get
 * $$-fD^{(n)} = C(n, 1)D^{(n-1)}f^{\prime} + C(n, 2) D^{(n-2)} f^{\prime\prime}

+ C(n, 3) D^{(n-3)} f^{\prime\prime\prime} + ... + C(n, n) Df^{(n)} $$

Let's expand some of above equations,


 * $$ -fD^{\prime} = f^{\prime}/f $$


 * $$\begin{array}{rl}

-fD^{\prime\prime} = &2D^{\prime}f^{\prime} + f^{\prime\prime}D \\ = & 2 \left( -f^{\prime} /{f^2} \right) f^{\prime} + f^{\prime\prime}/f \\ = &\left( 1/f^2 \right) \left( -2{f^{\prime}} ^2 + ff^{\prime\prime} \right) \end{array} $$


 * $$ -fD^{\prime\prime\prime} = ( 1/f^3 )

(  6{f^\prime}^3 -6ff^\prime f^{\prime\prime} + f^2 f^{\prime\prime\prime} ) $$


 * $$ -fD^{\prime\prime\prime} = ( 1/f^4 )

( -24{f^\prime}^4 + 36f{f^\prime}^2 f^{\prime\prime} - 8 f^2 f^\prime f^{\prime\prime\prime} -6f^2 {f^{\prime\prime}}^2 + f^3 f^{\prime\prime\prime\prime} ) $$

...

Therefore


 * $$ D^{\prime} = (-1/f) f^{\prime}/f $$


 * $$ D^{\prime\prime} = ( -1/f^3 ) ( -2{f^{\prime}} ^2 + ff^{\prime\prime} )$$


 * $$ D^{\prime\prime\prime} = ( -1/f^4 )

(  6{f^\prime}^3 -6ff^\prime f^{\prime\prime} + f^2 f^{\prime\prime\prime} ) $$


 * $$ D^{\prime\prime\prime} = ( -1/f^5 )

( -24{f^\prime}^4 + 36f{f^\prime}^2 f^{\prime\prime} - 8 f^2 f^\prime f^{\prime\prime\prime} -6f^2 {f^{\prime\prime}}^2 + f^3 f^{\prime\prime\prime\prime} ) $$

relation with $$f$$
Follwing the tailor expansion, we get (assuming $$ \Delta = x_1 - x_0 $$
 * $$ f(x_1) = f(x_0)

+ f^\prime (x_0) \Delta + (1/2!)f^{\prime\prime} (x_0) {\Delta}^2 + (1/3!)f^{\prime\prime\prime} (x_0) {\Delta}^3 + ... $$

If $$x_1$$ is close enough to the solution of $$f(x) = 0$$, and by taking only two terms of the right side, we get


 * $$ f(x_1) = 0 = f(x_0) + f^\prime (x_0) \Delta $$

Therefore $$ \Delta = -f(x_0)/f^{\prime} (x_0) $$, and we get


 * $$ x_1 = x_0 - f(x_0)/f^{\prime} (x_0) $$

This is the Newton method.

Let's call above $$\Delta$$ as $${\Delta}_{Newton}$$ or $$\Delta_{(1)}$$

Now by taking three therms of the original tayler series,


 * $$ f(x_1) = 0 = f(x_0)

+ f^\prime (x_0) \Delta + (1/2!)f^{\prime\prime} (x_0) {\Delta}^2 $$

Therefore $$ \Delta = -f(x_0)/(f^{\prime} (x_0) + (1/2!) f^{\prime\prime} (x_0) \Delta$$, and by substituting the $$\Delta$$ of the right hand side by $${\Delta}_{Newton}$$, we get


 * $$ \begin{array}{rl}

\Delta =& -f(x_0)/ \left[ f^{\prime} (x_0) + (1/2!) f^{\prime\prime} (x_0) ( - f(x_0)/f^{\prime}) \right] \\ =& -ff^{\prime} / ({f^\prime}^2 - (1/2)f^{\prime\prime}f ) \\ =& -2ff^{\prime} / (2{f^\prime}^2 - f^{\prime\prime}f ) \end{array} $$

This is the Halley method. And Let's call $$\Delta$$ as $${\Delta}_{Halley}$$ or $$\Delta_{(2)}$$