Sigh.
Not even the modelling of a straight line segment does it seem you are able to accomplish.
I'll do this problem for you; pay CLOSE attention to the structure of the solution procedure:
1. Modelling of a straight line segment:
We have only need of a single coordinate variable (or ordinate, strictly speaking) to describe the linie segment:
We let one end point of the rod lie at x=0, whereas the other end point lies at x=L. (L is the length of the rod)
Thus, the rod is modeled by the interval 0\leq{x}\leq{L}, where any point ON the rod is assigned its own ordinate number "x", lying between 0 and L, where the interpretation of its specific x-value is the distance between the point on the rod and the end-point that has been assigned x-value 0.
2. Positioning of separate point mass:
We let the point mass be placed a distance "a" to the left of the end point at x=0, i.e, the point mass has the position x=-a
3. Uniform density:
The mass density at any point on the rod is M/L.
Therefore, a portion of the rod with length I has mass (M/L)*I.
In particular, an infinitesemal portion of length dx has (infinitesemal) mass dM=(M/L)*dx
4. Gravitational attraction on point mass:
This is quite simply the sum of the attractions it experiences from each point of the rod (each with a location between 0 and L). Thus, summing over the attractions of these mass points (individually called dF)will give us the total force F:
F=\int_{rod}dF=\int_{rod}\frac{GmdM}{(x-(-a))^{2}}=\int_{rod}\frac{GmMdx}{L(x+a)^{2}}=\frac{GMm}{L}\int_{0}^{L}\frac{dx}{(a+x)^{2}}=\frac{GMm}{L}(-\frac{1}{a+L}+\frac{1}{a})=\frac{GMm}{L}\frac{L}{(a+L)a}=\frac{GMm}{a(a+L)}
A somewhat interesting observation can be made of this:
If a>>L, then the gravitational force acting upon the mass point is the same as if the rod's mass was concentrated at its center of mass, whereas if L<<a, then the gravitational force acting upon the mass point is the same as if the rod's mass was concentrated at the geometric mean between "a" and "L".