In the paper the topological derivative for arbitrary shape functional is defined. Examples are provided for elliptic equations and the elasticity system in the plane. The topological derivative can be used for solving shape optimization problems in structural mechanics