Active control of a vibrating beam using piezoelectric patch actuators is considered. The specific structure to be studied is an Euler-Bernoulli beam with piezoelectric actuators bonded to the top and bottom surfaces of the beam. The equation of motion includes Heaviside functions and their derivatives due to finite size piezo patches which provide the control force to damp out vibrations. Optimal control theory is formulated with the objective function specified as a weighted quadratic functional of the dynamic responses of the beam which is to be minimized at a specified terminal time. The expenditure of the control forces is included in the objective function as a penalty term. The optimal control law is derived using a maximum principle developed by Sadek et al. . The maximum principle involves a Hamiltonian expressed in terms of an adjoint variable with the state and adjoint variables linked by terminal conditions leading to a boundary-initial-terminal value problem. The explicit solution of the problem is developed using eigenfunction expansions of the state and adjoint variables. The numerical results are given to assess the effectiveness and the capabilities of piezo actuation to damp out the vibrations. (C) 2011 Elsevier Ltd. All rights reserved.