Suppose I have an ODE of the form
$u(x) - [a(x)u(x)]_{xx}=f(x)$
and I want to solve it with FEM, how do I convert it to the weak form? Using integration by part, the middle term becomes
$(v,-(au)'')=(v',(au)')=(v',a'u+au')=(v',a'u)+(v',au')$
where $v=v(x)$ is the test function. If we let $v=\phi_i(x)$, and $u(x)=\sum_j u_j \phi_j(x)$, then we end up with something like
$\sum_j \left[ (\phi_i,\phi_j) + (\phi_i',a'\phi_j) + (\phi_i',a\phi_j')\right] u_j = (\phi_i,f)$
But I'm not sure if there are any subtleties I have missed. Also now looks like the matrix $A_{ij}$ is no longer symmetric, which is different from other more standard problems I have come across like the usual poisson equation $-(au')'=f$. So I would like to know how to properly convert equations like this to weak form / solving with FEM.