I'm trying to find an equation to denote ecliptic longitude (the horizontal angle of the sun observed from the earth) by time. An equation, led from equation of motion and conservation of angular momentum and net energy, looks like this.
$$ \frac{d\theta}{dt} = C(1+D\,\cos\theta)^2$$
$\theta$ is ecliptic longitude, $t$ is time, $C$ and $D$ are constants. $D$ is $0 \leq D < 1$ so $1+Dcos\theta > 0$.
$t$ is given by the following.
$$ \frac{d\theta}{dt} = C(1+D\,\cos\theta)^2 \\ \Leftrightarrow t = \frac{1}{C} \int \frac{d\theta}{(1+D\,\cos\theta)^2} $$
I feel $\int \frac{d\theta}{(1+D\,\cos\theta)^2}$ is pretty hard to solve because of $D$. I could do something like $D = \sin(\arcsin(D))$ since $0 \leq D < 1$ but it would make little difference.
The final form I want is $\theta = f(t)$. This is equivalent to solving $\frac{dx}{dt} = f(x)$ for $x$ but this will be an inverse function of an integral which is pretty hard to solve. I know how to get the integral of an inverse function but the case is quite different from that.
How could I solve this equation?
Edit 2017/12/24
Thanks for comments. Here's my solution.
$$ s=tan(\theta/2) \Rightarrow \frac{1-s^2}{1+s^2} = \frac{1-(\frac{\sin(\theta/2)}{\cos(\theta/2)})^2}{1+(\frac{\sin(\theta/2)}{\cos(\theta/2)})^2} = \frac{\cos^2(\theta/2) - \sin^2(\theta/2)}{\cos^2(\theta/2) + \sin^2(\theta/2)} = \cos\theta \\ \frac{ds}{d\theta} = \frac{1}{2\cos^2(\theta/2)} = \frac{1+s^2}{2}$$
So, the integral can be rewritten using $s$ as follows.
$$\int \frac{d\theta}{(1+D\cos\theta)^2} = \int \frac{1}{(1+D\frac{1-s^2}{1+s^2})^2} \frac{2}{1+s^2} ds \\ =\int (\frac{1+s^2}{(1+D) + (1-D)s^2})^2 \frac{2}{1+s^2} ds \\ =\frac{1}{(1-D)^2} \int (\frac{1+s^2}{E + s^2})^2 \frac{2}{1+s^2} ds \\ (E = \frac{1+D}{1-D}) \\ =\frac{2}{(1-D)^2} \int \frac{1+s^2}{(E + s^2)^2} ds \\ $$
$\frac{1+s^2}{(E + s^2)^2}$ was solved using a partial fraction decomposition as below.
$$ \frac{1+s^2}{(E + s^2)^2} = \frac{A_1}{s^2+E} + \frac{A_2}{(s^2+E)^2} \\ \Leftrightarrow A_1(s^2+E) + A_2 = s^2 + 1 \\ \Leftrightarrow \begin{cases} A_1=1 \\ EA_1 + A_2 = 1 \end{cases} \\ \Leftrightarrow \begin{cases} A_1 = 1 \\ A_2 = 1-E \end{cases} \\ \therefore \frac{1+s^2}{(E + s^2)^2} = \frac{1}{s^2+E} + \frac{1-E}{(s^2+E)^2} $$
Each part was solved as below.
$$ \int \frac{1}{s^2+E} ds = \frac{1}{\sqrt{E}}\int \frac{1}{(s/\sqrt{E})^2+1} d(s/\sqrt{E}) \\ = \frac{1}{\sqrt{E}} \arctan(s/\sqrt{E}) \\ \int \frac{1}{(s^2+E)^2} ds = \sqrt{E}/E^2 \int \frac{1}{((s/\sqrt{E})^2+1)^2} d(s/\sqrt{E}) \\ = \sqrt{E}/E^2 \int \cos^2r dr \,\,\, (\tan(r)=s/\sqrt{E})\\ = \sqrt{E}/E^2 \int (\frac{1}{2}\cos(2r) + \frac{1}{2}) dr \\ = \sqrt{E}/E^2 (\frac{1}{4}\sin(2r) + \frac{1}{2}r) \\ = \sqrt{E}/E^2 (\frac{1}{4}\frac{2\tan(r)}{1+\tan^2r} + \frac{1}{2}r) \\ = \sqrt{E}/E^2 (\frac{1}{2}\frac{s/\sqrt{E}}{1+(s/\sqrt{E})^2} + \frac{1}{2}\arctan(s/\sqrt{E})) \\ $$
So the answer is as follows.
$$ \int \frac{d\theta}{(1+D\cos\theta)^2} =\frac{2}{(1-D)^2} \int \frac{1+s^2}{(E + s^2)^2} ds \\ =\frac{2}{(1-D)^2} \int (\frac{1}{s^2+E} + \frac{1-E}{(s^2+E)^2}) ds \\ =\frac{2}{(1-D)^2} (\int \frac{1}{s^2+E} ds + \int \frac{1-E}{(s^2+E)^2} ds) \\ =\frac{2}{(1-D)^2} (\frac{1}{\sqrt{E}} \arctan(s/\sqrt{E}) + (1-E)\sqrt{E}/E^2 (\frac{1}{2}\frac{s/\sqrt{E}}{1+(s/\sqrt{E})^2} + \frac{1}{2}\arctan(s/\sqrt{E}))) \\ =\frac{(E+1)^2}{4E}(\frac{1+E}{\sqrt{E}}\arctan(s/\sqrt{E}) + \frac{(1-E)s}{E+s^2}) \\ (1/(1-D) = (E+1)/2) \\ =\frac{(E+1)^2}{4E}(\frac{1+E}{\sqrt{E}}\arctan(\tan(\theta/2)/\sqrt{E}) + \frac{(1-E)\tan(\theta/2)}{E+\tan^2(\theta/2)}) \\ $$
But now I'm wondering how to get the inverse.