TITLE: When is an elliptic integral expressible in terms of elementary functions?
QUESTION [31 upvotes]: After seeing this recent question asking how to calculate the following integral
$$ \int \frac{1 + x^2}{(1 - x^2) \sqrt{1 + x^4}} \, dx $$
and some of the comments that suggested that it was an elliptic integral, I tried reading a little bit on the Wikipedia article about elliptic integrals.
It seems that the point is that most elliptic integrals cannot be expressed in terms of elementary functions. The Wikipedia article defines an elliptic integral as an integral of the form
$$\int R \left( x, \sqrt{ P(x) } \right ) \, dx$$
where $R(x, y)$ is a rational function and $P(x)$ is a polynomial of degree $3$ or $4$ with no repeated roots.
Now, the article does mention in its introductory section that two exceptions in which the elliptic integrals can be expressed in terms of elementary functions are when the polynomial $P(x)$ has repeated roots or when the rational function $R(x, y)$ does not contain odd powers of $y$. 
In the example in question we have $P(x) = 1 + x^4$ and 
$$R(x, y) = \frac{1 + x^2}{(1 - x^2)y}$$
so certainly it does not correspond to the two exceptions mentioned before. Thus I have a couple of questions about this:

1) What are the conditions for an elliptic integral (as defined in the Wikipedia article) to be expressible in terms of elementary functions? More specifically, are the two above cited conditions the only exceptions or are there any others which may explain why the above integral is expressible in terms of elementary functions?
2) Depending on the answer to my first question, why is it that the above "elliptic integral" can be expressed in terms of elementary functions?

Note: I'm not sure but I suppose that some conditions must be put on the rational function $R(x, y)$ so to avoid trivial cases, but I don't want to speculate.
Thank you very much in advance.

REPLY [8 votes]: I might be coming at this too late to interest anyone, but let me build on Matt E's answer. Suppose that we have a elliptic curve $E$ given as $y^2 = P(x)$ and a differential form $\eta = f(x, \sqrt{P(x)}) dx/\sqrt{P(x)}$ on  $E$. We would like to know whether or not there is a map $\phi: \eta \to \mathbb{P}^1$, and a differential form $\omega$ on $\mathbb{P}^1$, such that $\eta = \phi^* \omega$. I'll explain how to solve this, using the current problem as an example.
Recall that $dx/\sqrt{P(x)}$ has no zeroes or poles on $E$. So the poles of $\eta$ are precisely those of $f(x, \sqrt{P(x)}$. In our case, $f$ has poles at the points where $1-x^2 =0$, namely the four points $(x,y) = (\pm 1, \pm \sqrt{2})$. If $\eta = \phi^* \omega$, then the poles of $\eta$ will occur at precisely the preimages of the poles of $\omega$. Moreover, if $\phi(a) = b$, with $\phi$ ramified of order $e$ at $a$, then the residue of $\phi^* \omega$ at $a$ is going to be $e$ times the residue of $\omega$ at $b$. So we can guess which poles of $\eta$ come from the same pole of $\omega$ by seeing which ones have residues which are in positive rational ratios.
In this case, the residue is $1/ \sqrt{2}$ at $(1, \sqrt{2})$ and $(-1, - \sqrt{2})$, and is 
 $- 1/ \sqrt{2}$ at $(1, -\sqrt{2})$ and $(1, - \sqrt{2})$. So the most obvious guess is that $\phi(1, \sqrt{2}) = \phi(-1, -\sqrt{2})$ and $\phi(-1, \sqrt{2}) = \phi(-1, \sqrt{2})$, with branching of equal orders at these points. If I were going to write a careful algorithm, I'd have to consider other possibilities, but I'll just try this possibility.
So, we would like to know whether or not there is a rational function $\phi$ on $E$, of degree $2$, with $\phi(1, \sqrt{2}) = \phi(-1, -\sqrt{2})$ and $\phi(-1, \sqrt{2}) = \phi(-1, \sqrt{2})$, and with branching of some order $e$ at all these points? In other words, does $e (1, \sqrt{2}) + e (-1, -\sqrt{2}) = e (-1, \sqrt{2}) + e (-1, \sqrt{2})$ in the group law of $E$? Note that if you just chose $4$ random points on an elliptic curve, there would be no relations between them in the group law, consistent with the fact that there are usually no elementary solutions to elliptic integrals.
In this case, we win! Notice that the line $y= \sqrt{2} x$ is tangent to $E$ at the points $(1, \sqrt{2})$ and $(-1, -\sqrt{2})$. Similarly, $y = -\sqrt{2} x$ is tangent to $E$ at the other two points. So 
$2 \cdot (1, \sqrt{2}) + 2 \cdot (-1, -\sqrt{2}) = 2 \cdot (-1, \sqrt{2}) + 2 \cdot (-1, \sqrt{2}).$
Explicitly, the map $\phi$ should be $x \mapsto (\sqrt{x^4+1} - \sqrt{2} \cdot x)/(\sqrt{x^4+1} + \sqrt{2} \cdot x)$. We know that $\omega$ should be a form which has poles of residue $1/2 \sqrt{2}$ at $0$ and $\infty$, so it should be $du/2 \sqrt{2} u$.
Ask your favorite computer algebra system to pullback $du/2 \sqrt{2} u$ along $x \mapsto (\sqrt{x^4+1} - \sqrt{2} \cdot x)/(\sqrt{x^4+1} + \sqrt{2} \cdot x)$. It will whine a lot but, if you make it keep expanding and factoring, you will get the original integrand.