This paper presents theoretical results about control of the coefficient function in a hyperbolic problem with Dirichlet conditions. The existence and uniqueness of the optimal solution for optimal control problem are proved and adjoint problem is used to obtain gradient of the functional. However, a second adjoint problem is given to calculate the gradient on the space W210,l. After calculating gradient of the cost functional and proving the Lipschitz continuity of the gradient, necessary condition for optimal solution is constructed.