# An indefinite integral containing functions that are solutions to a 2nd order linear ODE

I am trying to evaluate an indefinite integral of the form

$\int \frac{dz}{A u_1^2 + Bu_2^2 + Cu_1u_2}$

where $u_1$ and $u_2$ are two independent solutions to the ODE

$u'' + F(z)u = 0$

This integral has arisen because the quantity $\sqrt{A u_1^2 + Bu_2^2 + Cu_1u_2}$ is a solution to the Ermakov-Pinney equation, $u'' + F(z)u + \Lambda u^{-3} = 0$. I can simplify by setting one or both of $A$ or $B$ to zero, but $C$ is dependent: $C \equiv 2\sqrt{AB + \Lambda/W^2}$, where $W$ is the Wronskian of $u_1$ and $u_2$, which here is always constant.

In this particular situation (due to the form of $F(z)$), another way of writing the solutions $u$ is as

$u = \sqrt{p} y$

where $y$ satisfies the Sturm-Liouville problem

$-(py')' = \lambda \omega y$

but we do not necessarily have $\lambda \geq 0$.

Is it possible to say anything about the integral above in general? I am particularly keen to know under what conditions the antiderivative is a) expressible in closed form, and b) invertible in closed form.

For example, when $u = e^{\pm z/2}$, both a) and b) are true.

• A small remark. You should have $C = 2\sqrt{AB+\Lambda/W^2}$ for your formulas to work. – Igor Khavkine Mar 7 '17 at 19:54

Assuming $4AB-C^2 \ne 0$, let $$J(z) =\frac{2}{W \sqrt{4AB-C^2}}\;\arctan \left(\frac{2B}{\sqrt{4AB-C^2}} \frac{u_2(z)}{u_1(z)} + \frac{C}{\sqrt{4AB-C^2}}\right)$$ where $W$ is the (constant) Wronskian of $u_1$ and $u_2$. Then I get $$\dfrac{dJ}{dz} = \frac{1}{A u_1^2 + B u_2^2 + C u_1 u_2}$$
• Amazing, exactly what I was looking for, thank you very much! In fact in our case the quantity $\sqrt{4AB - C^2}$ will always be imaginary, but that presents no difficulty. – Edward Lilley Mar 7 '17 at 22:21
• Just to give the full solution for every case: your solution includes the $A = 0$ case trivially; to obtain the $B = 0$ case just swap $u_1$ and $u_2$; and finally, the $A = B = 0$ case is given by $\int \frac{dz}{u_1 u_2} = \log{\frac{u_2}{u_1}}$. – Edward Lilley Mar 8 '17 at 18:22