I just calculated the gravitational field on the $x$-axis created by a thin rod of mass $M$ and length $L$ by applying the formula:
I got this:
However there are some issues that I don't get. If I plug $ x = \pm L/2$ on the equation, gravitational field goes to infinity. Why? What's its physical meaning?
Another thing that bothers me is the fact that when I plug $x=0$ in the equation the result is $\vec{g}(x=0)= \frac{4GM}{L^2}\vec{i}$, but shouldn't it be 0 since $x=0$ is in the middle of the rod and by simmetry it looks like the net field right there is 0?