Analysis and design of reinforced beams