Solution (source code)

= Solution

The <Dirichlet boundary condition> is built into the first component's space, while the <Neumann boundary condition> is natural. Thus a <weak solution> is a pair
$$
(u,w)\in H_0^1(U)\times H^1(U)
$$
such that for every $(v,z)\in H_0^1(U)\times H^1(U)$,
$$
\int_U(Du\mathbin\cdot Dv+uv+wv)=\int_Ufv,
$$
$$
\int_U(Dw\mathbin\cdot Dz+wz-3uz)=\int_Ugz.
$$
If $u,w$ are $C^2$ up to the boundary, taking compactly supported <test functions> and applying the <fundamental lemma of the calculus of variations> gives both differential equations pointwise in $U$. Membership of $H_0^1(U)$ gives $u=0$ on $\partial U$. Applying <integration by parts> to the second identity and using its differential equation leaves
$$
\int_{\partial U}\frac{\partial w}{\partial\nu}z=0
$$
for every smooth boundary trace $z$. Hence $\partial w/\partial\nu=0$ on $\partial U$, so the equations and both boundary conditions hold classically.