The standard solutions of the L2-disturbance attenuation and optimal control problems hinge upon the computation of the solution of a Hamilton-Jacobi (HJ), Hamilton-Jacobi-Bellman (HJB) respectively, partial differential equation or inequality, which may be difficult or impossible to obtain in closed-form. Herein we focus on the matched disturbance attenuation and on the optimal control problems for fully actuated mechanical systems. We propose a methodology to avoid the solution of the resulting HJ (HJB, respectively) partial differential inequality by means of a dynamic state feedback. It is shown that for planar mechanical systems the solution of the matched disturbance attenuation and the optimal control problems can be given in closed-...