The deflection of a beam in a roof structure can be determined using the integration method, provided that a single analytical function can represent the bending moment. However, if the loading of the beam requires multiple functions to represent the bending moment, additional constants and equations would be necessary, leading to lengthy calculations. This complexity can be simplified using singularity functions. Consider a prismatic beam supported at the ends carrying an eccentric load. The shear force function of this beam can be represented using an appropriate singularity function. The bending moment function can be derived by integrating this shear force function. The beam's slope and deflection can be obtained by integrating this moment function. The constants in the equations can be determined from the boundary conditions. Using singularity functions eliminates the need for additional constants and equations, simplifying the computation. As a result, singularity functions provide an efficient way to calculate the slope and deflection of a beam under complex loadings.