# How to correctly apply Newton-Raphson method to Backward Euler method?

I'm solving a system of stiff ODEs, at first I wanted to implement BDF, but it seem to be a quite complicated method, so I decided to start with Backward Euler method. Basically it says that you can solve an ODE:

$y'=f(t,y)$, with initial guess $y(t_0)=y_0$

Using the following approximation:

$y_{k+1}=y_k+hf(t_{k+1},y_{k+1})$, where $h$ is a step size on parameter $t$

Wikipedia article says that you can solve this equation using Newton-Raphson method, which is basically a following iteration:

$x_{n+1}=x_n-\frac{g(x_n)}{g'(x_n)}$

So, the question is how to correctly mix them together? What initial guess $x_0$ and function $g$ should be?
Also $f$ is quite complex in my case and I'm not sure if it possible to find another derivative of it analytically. I want to write an implementation of it by myself, so predefined Mathematica functions wouldn't work.

• If computing the derivative of $f$ is not possible, you can try the secant method instead of Newton's method. – user856 May 31 '12 at 21:33

Your aim is to solve the following equation for $y_{k+1}$: $$g(y_{k+1}):=y_{k+1}-y_k-hf(t_{k+1},y_{k+1})=0,$$ where $f$ is a known function and $y_k, t_{k+1}$ and $h$ are known values. This gives you the $g$ for a Newton-Raphson method. As an initial guess, I'd suggest that you use a 1-step forward Euler method to explicitly calculate $$\hat{y}_{k+1} := y_k+hf(t_{k+1},y_k),$$ and use $\hat{y}_{k+1}$ as your initial guess for $y_{k+1}$.
• Thank you, this help a lot. But how can I find $g'$? Function $f$ is quite complex and I can't analytically differentiate it. – Andrew May 31 '12 at 21:31