# Integration by parts with Dirichlet boundary conditions

A linear convection-diffusion reaction equation with homogeneous Dirichlet boundary conditions is given by :

$$-\epsilon \Delta u + b.\nabla u + cu= fin\Omega$$ $$u = 0 on \delta \Omega$$

Integration by parts will be :

$$\int_{\Omega} (- \epsilon \Delta u + b\cdot \nabla u+ cu)(x)v(x)dx$$ $$=\int_{\partial \Omega} -\epsilon (\nabla u\cdot n )(s)v(s) ds + \int_{\Omega} (\epsilon \nabla u \cdot \nabla v + ( b \cdot \nabla u + cu)v) (x) dx$$ $$=\int_{\Omega}(\epsilon \nabla u\cdot \nabla v + (b \cdot \nabla u + cu)v)(x) dx$$

$$=\int_{\Omega}f(x)v(x) dx$$

I need some correction if something wrong with my integration, then how to solve the Convection Diffusion problem below using MATLAB :

$$-\epsilon \Delta u + \beta. \nabla u = 0 in \Omega$$ $$u |_{\partial \Omega} =0 on \delta \Omega$$

(Dirichlet boundary conditions) Where $\beta= (cos 15^0, sin 15^0)$, $\epsilon = 10^{-1},10^{-2}$

No correction is needed. Indeed, your first problem is a more general version of your second. To get the second from the first simply set $c=0$. This term plays no role in the integration by parts, so the same argument applies. Note that the key assumption needed to validate the integration by parts is that the "test function" $v$ satisfies the Dirichlet condition $v=0$ on $\partial \Omega$. This choice is made to be consistent with the boundary condition imposed on $u$ itself.