I want to solve boundary value problem in n points, $\displaystyle x_{n}\in(0,1)$:

$\displaystyle -u'(x)(ku'(x))=12x^{2}$

where:

$\displaystyle u(x)\in[0,1]$

$\displaystyle u(0)=0$

$\displaystyle ku'(1)+hu'(1)=hu_{z}$

$\displaystyle x\in R$

with finite difference method instead of finite element method.

I substituted finite difference:

$\displaystyle u'(x)=\frac{u(x_{i-1})-u(x_{i+1})}{2h}$

$\displaystyle h=\frac{1}{n}$

and obtained:

$\displaystyle -kn^{2}[u(x_{i-1})-u(x_{i+1})]^{2}=3x_{i}^{2}$

$\displaystyle i=1,...,n$

And I don't know how to turn that into the matrix equation. Is there a way to do it?