Hmm... Without working it out directly, I think the answer to the integral is
F = GmM / [4Lx (x<sup>2</sup> + L<sup>2</sup>)<sup>1/2</sup>]
Note that if the mass m is a long distance away from the cylinder, the cylinder looks like a point mass with mass M, as far as the test mass m is concerned. For this situation, x is much larger than L, so we can ignore the L<sup>2</sup> term in the bracket, to get:
F = GmM / (4Lx<sup>2</sup>)
Notice that in this case the force falls off as the inverse square of the distance x, as we would expect for two point masses.
On the other hand, look what happens when the test mass m is very close to the cylinder, so that x is much less than L. In that case, we ignore the x<sup>2</sup> term in the bracket, to get:
F = GmM / (4L<sup>2</sup> x)
Since L is constant, the force drops off as the inverse of the distance x, when the test mass is close to the cylinder, rather than as the inverse square of the distance.
Hope this helps.
F = GmM / [4Lx (x<sup>2</sup> + L<sup>2</sup>)<sup>1/2</sup>]
Note that if the mass m is a long distance away from the cylinder, the cylinder looks like a point mass with mass M, as far as the test mass m is concerned. For this situation, x is much larger than L, so we can ignore the L<sup>2</sup> term in the bracket, to get:
F = GmM / (4Lx<sup>2</sup>)
Notice that in this case the force falls off as the inverse square of the distance x, as we would expect for two point masses.
On the other hand, look what happens when the test mass m is very close to the cylinder, so that x is much less than L. In that case, we ignore the x<sup>2</sup> term in the bracket, to get:
F = GmM / (4L<sup>2</sup> x)
Since L is constant, the force drops off as the inverse of the distance x, when the test mass is close to the cylinder, rather than as the inverse square of the distance.
Hope this helps.