# Thread: [SOLVED] Numerical solutions of ordinary dif eqs

1. ## [SOLVED] Numerical solutions of ordinary dif eqs

Hello there;

I have a wee question, itd be great if I can get a solution for this. (I am putting it up on behalf of a friend as Im not really sure where to start, hes studying maths at uni.... Im a lazy engineer that asks mathemticians )

Thanks!

The question is

solve (1+x^2)y'' - xy'- 3y = 6x-3 with

y(0)-y'(0)=1

y(1)=2 on [0,1]

with h=0.2

hint: use central difference for each derivatives.

2. Originally Posted by olionel
Hello there;

I have a wee question, itd be great if I can get a solution for this. (I am putting it up on behalf of a friend as Im not really sure where to start, hes studying maths at uni.... Im a lazy engineer that asks mathemticians )

Thanks!

The question is

solve (1+x^2)y'' - xy'- 3y = 6x-3 with

y(0)-y'(0)=1

y(1)=2 on [0,1]

with h=0.2

hint: use central difference for each derivatives.
Tell your friend to start by substituting the difference quotients

$\displaystyle y_i^{''} = \frac{y_{i+1} - 2y_i + y_{i-1}}{h^2}$

and

$\displaystyle y_i^{'} = \frac{y_{i+1} - y_{i-1}}{2h}$

into the ODE. Simplify the result to get a difference equation of the form $\displaystyle ay_{i+1} + by_i + cy_{i-1} = d$.

There are five (why?) unknowns: $\displaystyle y_0, y_1, y_2, y_3, y_4$. $\displaystyle y_5 = 2$ (why?)

Use the difference equation to obtain four equations involving these unknowns. And don't forget that $\displaystyle y_0 - y^{'}_0 = 1$ (why?). Set up the matrix equation representing these equations. Solve for the unknowns.

3. hi,

i am the friend of olionel call me lazy mathematician :P