# Is there any closed expression of this definite integral?

$$\int_0^\theta \frac{1}{(1+e\cos x)^2} dx = ?$$ in which $\theta(\le\pi/2)$ and $e$ are constants.

I guess you are dealing with Kepler's second law, so I am going to assume that the eccentricity $e$ belongs to the interval $(-1,1)$. As suggested in the comments, by setting $x=2\arctan\frac{t}{2}$ the integral boils down to an elementary integral, but it is probably easier to apply a geometric approach: your integral is related with the area of an elliptic sector, that can be decomposed as a triangle and a sector centered at the centre of the ellipse. Through an affine map that becomes a circle sector, whose area is simple to compute. By computing the determinant of the involved affine map you also get the area of the original elliptic sector, namely
$$\frac{2}{(1-e^2)^{3/2}}\,\arctan\left(\sqrt{\frac{1-e}{1+e}}\tan\frac{\theta}{2}\right)-\frac{e\sin(\theta)}{(1-e^2)(1+e\cos\theta)}$$ not that nice, indeed.
This formula summarizes Kepler's relations about the mean, eccentric and true anomalies: $$M = E-e\sin E,\qquad (1-e)\tan^2\frac{\theta}{2}=(1+e)\tan^2\frac{E}{2}.$$ In the original problem we are interested in $M$, given $e$ and $\theta$.