# Is there any closed expression of this definite integral?

\begin{equation} \int_0^\theta \frac{1}{(1+e\cos x)^2} dx = ? \end{equation} 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$.
$\newcommand{\bbx}{\,\bbox[8px,border:1px groove navy]{\displaystyle{#1}}\,} \newcommand{\braces}{\left\lbrace\,{#1}\,\right\rbrace} \newcommand{\bracks}{\left\lbrack\,{#1}\,\right\rbrack} \newcommand{\dd}{\mathrm{d}} \newcommand{\ds}{\displaystyle{#1}} \newcommand{\expo}{\,\mathrm{e}^{#1}\,} \newcommand{\ic}{\mathrm{i}} \newcommand{\mc}{\mathcal{#1}} \newcommand{\mrm}{\mathrm{#1}} \newcommand{\pars}{\left(\,{#1}\,\right)} \newcommand{\partiald}[]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\root}[]{\,\sqrt[#1]{\,{#2}\,}\,} \newcommand{\totald}[]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}} \newcommand{\verts}{\left\vert\,{#1}\,\right\vert}$ \begin{align} \int_{0}^{\theta}{\dd x \over \bracks{1 + \expo{}\cos\pars{x}}^{2}} & = \int_{0}^{\theta} {\dd x \over \braces{1 + \expo{}\bracks{2\cos^{2}\pars{x/2} - 1}}^{2}} = 2\int_{0}^{\theta/2} {\dd x \over \bracks{1 - \expo{} + 2\expo{}\cos^{2}\pars{x}}^{2}} \\[5mm] & = {1 \over 2\expo{}^{2}}\int_{0}^{\theta/2} {\dd x \over \bracks{\pars{1 - \expo{}}/\pars{2\expo{}} + \cos^{2}\pars{x}}^{2}} \\[5mm] & = \left.-\,{1 \over 2\expo{}^{2}}\partiald{}{\mu}\int_{0}^{\theta/2} {\dd x \over \mu + \cos^{2}\pars{x}}\right\vert_{\ \mu\ = \pars{1 - \expo{}}/\pars{2\expo{}}} \\[5mm] &= \left.-\,{1 \over 2\expo{}^{2}}\partiald{}{\mu}\int_{0}^{\theta/2} {\sec^{2}\pars{x}\,\dd x \over \mu\sec^{2}\pars{x} + 1}\right\vert_{\ \mu\ = \pars{1 - \expo{}}/\pars{2\expo{}}} \\[5mm] &= \left.-\,{1 \over 2\expo{}^{2}}\partiald{}{\mu}\int_{0}^{\theta/2} {\sec^{2}\pars{x}\,\dd x \over \mu\tan^{2}\pars{x} + \mu + 1}\right\vert_{\ \mu\ = \pars{1 - \expo{}}/\pars{2\expo{}}} \end{align}