# Two-Step backward differentiation

• stvoffutt
In summary, stvoffutt was having trouble deriving a formula for an equation with second order accuracy. He tried expanding the equation around the indices yj+1 and yj-1, but this produced an equation with first order accuracy. After realizing this, he tried expanding the equation around the indices yj+

## Homework Statement

By using Taylor expansion, derive the following two-step backward differentiation which has second
order accuracy:
$$\frac{3y_{j+1}-4y_j+y_{j-1}}{2h}=f(t_{j+1},y_{j+1})$$

## Homework Equations

Taylor expansion
ODE
$$y^{\prime}=f(t,y) , y(0)=\alpha$$

## The Attempt at a Solution

I find the expansion for $$y_{j+1}=y_j+hy^{\prime}_j+\frac{h^2}{2!}y^{\prime \prime}+\cdots$$
and
$$y_{j-1}=y_j-hy^{\prime}_j+\frac{h^2}{2!}y^{\prime \prime}+\cdots$$

This is where I get stuck. If I multiply $y_{j+1}$ by 3 and add $y_{j-1}$ I get the needed left hand side but the right hand side is $f(t_{j},y_{j})=y^{\prime}_j$. How can I have an expansion that includes$f(t_{j+1},y_{j+1})$ that will yield the LHS of the derivation? Am I going about this all wrong? This problem seems relatively simple yet I think I am missing an important step.

Your equation doesn't have second order accuracy. It only has first order accuracy. Do your expansion around tj+1 and yj+1, going 1 step back and 2 steps back. You need to end up with an equation that has a zero coefficient for the second derivative.

It does have second order accuracy, Chester. This is an implicit integration technique as both the left and right hand sides involve yj+1.

stvoffutt, what this means is that you should be doing your expansions about yj+1 rather than yj.

D H said:
It does have second order accuracy, Chester. This is an implicit integration technique as both the left and right hand sides involve yj+1.

stvoffutt, what this means is that you should be doing your expansions about yj+1 rather than yj.
I think you might have misunderstood what I said. The original equation does have second order accuracy, but stvoffutt's derived formula does not. My suggested method is the same as yours for deriving the original formula (featuring 2nd order accuracy).

Actually, stvoffutt wasn't able to derive a formula. That was his problem.

D H said:
Actually, stvoffutt wasn't able to derive a formula. That was his problem.
Actually, it was clear to me that that the formula he came up with was:

$$\frac{3y_{j+1}-4y_j+y_{j-1}}{2h}=f(t_{j},y_{j})$$

This was the source of his concern. It didn't match the given equation. Also, he didn't realize that, as a consequence of the method that he used, this formula is not 2nd order accurate. The method that both you and I suggested will yield the desired formula, and the derivation will automatically lead to 2nd order accuracy (by requiring that the coefficient of the second derivative in the final equation is zero).

So should I expand like this?
$$y_{j+2}=y_{j+1}+2hy^{\prime}_{j+1}+\frac{4h^2}{2!}y^{\prime \prime}_{j+1}+\cdots$$
and do the same thing for $y_{j-2}$?

No. There is no yj+2 anywhere in the problem statement. You don't need it. You should expand yj and yj-1 in terms of yj+1.

I'm not sure how to expand y_j in terms of y_j+1. Can you point me in the right direction?

Sure you do. You did it right here:
stvoffutt said:
$$y_{j-1}=y_j-hy^{\prime}_j+\frac{h^2}{2!}y^{\prime \prime}+\cdots$$

$y_j=y_{j+1}+hy^{\prime}_{j+1}+\frac{h^2}{2!}y^{\prime \prime}_{j+1}+O(h^3)$?

No. That's yj+2. You want yj.

$y_j=y_{j-1}-hy^{\prime}_{j-1}+\frac{h^2}{2!}y^{\prime \prime}_{j-1}+O(h^3)$?
I'm sorry. I am having a hard time trying to keep all of this straight. This is my first course in numerical analysis.

No! Don't just guess. You want yj on the left, terms involving yj+1 and it's time derivatives on the right.

## What is Two-Step Backward Differentiation?

Two-Step Backward Differentiation is a numerical method used to approximate derivatives of a function at a specific point. It involves taking two steps backward from the given point and using the values of the function at those two points to calculate the derivative.

## How does Two-Step Backward Differentiation differ from other numerical methods?

Unlike other numerical methods, Two-Step Backward Differentiation only requires two function evaluations to approximate the derivative at a specific point, making it more efficient and less computationally expensive.

## What are the advantages of using Two-Step Backward Differentiation?

One advantage of Two-Step Backward Differentiation is its simplicity, as it only requires basic arithmetic operations. It also has a higher accuracy compared to other numerical methods, especially when the function is smooth and the step size is small.

## What are the limitations of Two-Step Backward Differentiation?

Two-Step Backward Differentiation may not be suitable for functions with discontinuities or sharp changes, as it relies on the values of the function at two points close to the given point. In such cases, other numerical methods may be more appropriate.

## How is Two-Step Backward Differentiation used in real-world applications?

Two-Step Backward Differentiation is commonly used in scientific and engineering fields for tasks such as solving differential equations, curve fitting, and optimization. It is also used in financial modeling and risk management to calculate sensitivities of financial instruments.