In embedding method, the classical solution of partial differential equations is rarely considered for solving the optimal control problems. Applying the classical solution to obtain the optimal inner control for physical systems governed by an inhomogeneous linear wave equation with initial, final and terminal conditions, is the aim of this paper. First, the classical solution is determined. Then, by a metamorphosis, the problem is changed by one in which a linear functional to be minimized on a set of positive Radon measures.The property of the optimal measure causes to identify it as a solution of a finite linear programming problem by two steps of approximation. Therefore, the optimal control is obtained as a piecewise constant function. Moreover, the advantages of this method is explained by numerical examples and comparing the results.