Based on the notes here I created a finite elements solver for the stationary heat equation (Poission's equation)
$$-u''(x) = f(x)$$
However I would like to solve the stationary heat equation that includes a variable diffusion coefficient $a(x)$
$$-(a(x)u'(x))' = f(x)$$
But if I follow the same procedure as in the link above the solution $u$ and the diffusion coefficient $a$ are 'coupled' and I can't solve for $u$ explicitly. I would like to know how to separate out $u$ from $a$ when I am building the stiffness matrix for this type of equation?
There is now way to decouple $u$ and $a$. Note that the bilinear form in this case is $\int a(x) u'(x) v'(x)dx$. Hence the entries of the stiffness matrix are $\int a(x)\phi_i'(x)\phi_j'(x)dx$.