Finite Elements : Poisson Problem homogeneous Dirichlet boundary conditions I have to solve this problem :
Write the weak formulation of the homogeneous Dirichlet problem
   $$ \begin{array}{|l}
&−\nabla\cdot (k\nabla u)=f \text{ in } \Omega ⊂ R^2 , \quad\quad\quad (1) 
\\& u = 0 \text{ on the boundary } \partial \Omega
\end{array} 
$$
where $k = k(x) \ge k_0 > 0$, and $f$ is a given function. 
I'm able to do it if it is in the standard form:
                                     $$\Delta u=f\quad\quad\quad (2)$$
where "$u$" is the unknown defined in  $\Omega$
I have tried to expand $\nabla\cdot (k\nabla u)$ using the Divergence property :
                     $$\nabla\cdot (W \varphi) = (\nabla\cdot W ) \varphi + W \cdot \nabla \varphi$$
Where $W$ is the vector entity ($\nabla u$ in my notation) and $\varphi$ is the scalar entity ( $k$ in my notation), but i can't arrive to the form $(2)$.
Can anyone help me please? I think is just a property problem in order to change the form of $(1)$.
Thanks.
Alessandro
 A: You do not have to transform it to the standard form and you can not do it unless $k$ is a constant over the domain $\Omega$.
But you can use the divergence formula that you have cited, applied for $W=k\nabla u$ and $\varphi\in C_0^\infty (\Omega)$ ( or $\varphi\in H_0^1(\Omega)$ - for linear problems both are equivalent). So you multiply both sides of the equation by a test function $\varphi\in C_0^\infty(\Omega)$ (or in $H_0^1(\Omega)$ ) and integrate over $\Omega$:
$$\int\limits_{\Omega}{-\nabla\cdot(k\nabla u)\varphi dx}=\int\limits_{\Omega}{f\varphi dx}$$
$$\Leftrightarrow \int\limits_{\Omega}{k\nabla u\cdot\nabla \varphi dx}-\int\limits_{\Omega}{\nabla\cdot(k\nabla u\varphi)dx}=\int\limits_{\Omega}{f\varphi dx}$$
Now, you use the divergence theorem (Gauss theorem) on the second integral:
$$\int\limits_{\Omega}{k\nabla u\cdot\nabla \varphi dx}-\int\limits_{\partial \Omega}{k\nabla u\cdot n\varphi ds}=\int\limits_{\Omega}{f\varphi dx}$$
Because $\varphi\in C_0^\infty(\Omega)$, the surface integral evaluates to zero and so your weak formulation reads:

Find $u\in H_0^1(\Omega)$ such that 
  $$\int\limits_{\Omega}{k\nabla u\cdot\nabla \varphi dx}=\int\limits_{\Omega}{f\varphi dx},\,\forall \varphi \in H_0^1(\Omega)$$

