Flexural vibrations of smart beams with integrated piezoelectric actuators and sensors are considered. For the case of a spatial variation of the sensor/actuator activity, actuator and sensor equations are derived taking into account the interaction of mechanical, electrical and thermal fields. Self-sensing actuators are included. With respect to the non-uniform spatial distribution of the sensors/actuators, shaping problems are formulated. Possible non-uniqueness of these inverse problems is pointed out. Shape functions responsible for non-uniqueness of the shaping problems are termed nilpotent solutions. Within the context of simplified sensor/actuator equations widely used in the literature, a class of nilpotent shape functions is derived for redundant beams by analogy to an auxiliary quasi-static problem of thermally induced flexure. Nilpotent shape functions of the sensor/actuator shaping problem thus turn out to correspond to bending moments in the auxiliary thermoelastic problem.