Elastic and elasto-plastic bending of rectangular beams with variable stiffness along axial direction