  In this work, we investigate a neural network based solver for optimal
control problems (without / with box constraint) for linear and semilinear
second-order elliptic problems. It utilizes a coupled system derived from the
first-order optimality system of the optimal control problem, and employs deep
neural networks to represent the solutions to the reduced system. We present an
error analysis of the scheme, and provide $L^2(\Omega)$ error bounds on the
state, control and adjoint in terms of neural network parameters (e.g., depth,
width, and parameter bounds) and the numbers of sampling points. The main tools
in the analysis include offset Rademacher complexity and boundedness and
Lipschitz continuity of neural network functions. We present several numerical
examples to illustrate the method and compare it with two existing ones.
