How to calculate magnetic pull force on armature on shaft?

I am currently designing a motor with complete calculations. While selecting bearing, One of the reference book which I follow has one example of bearing selection for motor shaft in which they have consider magnetic pull on armature. This force was considered as a uniformly distributed load over the span of armature length which was then converted into point load for calculating they bending moment.

If anybody throw some light on this matter, it would be a great help.