This paper is devoted to optimization of so-called firstorder differential (P C ) inclusions in the gradient form on a square domain. As a supplementary problem, discrete-approximation problem (P A ) is considered. In the Euler-Lagrange form, necessary and sufficient conditions are derived for the problems (P A ) and partial differential inclusions (P C ), respectively. The results obtained are based on a new concept of locally adjoint mappings. The duality theorems are proved and duality relation is established.