Actually the slope of my plot is totally different from the observation one. In attached images you can compare these two. The reason for integration is that we are supposed to calculate the cumulative number counts (N>S) and it should be integrated over the redshift range (0,Zmax) and (S, inf.).