Q:

What is Euler doing?

In Euler's paper "De Fractionibus Continuis Dissertatio" (English Translation) he proves that the constant $e\approx 2.71828$ is irrational.1 One step in the proof threw me for a loop, though. In the middle of paragraph 29, Euler solves the ODE
$$
a\,\mathrm{d}q+q^2\,\mathrm{d}p=\mathrm{d}p
$$
by rearranging and integrating to get
$$\begin{align}
\frac{a}{1-q^2}\mathrm{d}q&=\mathrm{d}p\\
\frac{a}{2} \log\left(\frac{1+q}{1-q}\right)&=p+C.
\end{align}$$
So far, so good. But now Euler says (quoting from Wyman's translation) "the constant ought to be determined from this equation by setting $q=\infty$ when $p=0$. Wherefore there follows
\begin{equation}
\frac a2\log\left(\frac{q+1}{q-1}\right)=p."
\end{equation}
This is the part I feel icky about.

My current interpretation of this is that when we choose the initial condition $q=\infty$ and $p=0$, we get $C=\frac a2\log(-1)$, so that
$$\begin{align}
\frac{a}{2} \log\left(\frac{1+q}{1-q}\right)&=p+\frac a2\log(-1)\\
\frac{a}{2} \left(\log\left(\frac{1+q}{1-q}\right)+\log(-1)\right)&=p\\
\frac{a}{2} \log\left(\frac{1+q}{1-q}(-1)\right)&=p\\
\frac{a}{2} \log\left(\frac{q+1}{q-1}\right)&=p.
\end{align}$$
This interpretation leaves more than a little to be desired. For one thing, $\log(-1)$ doesn't even make sense in a purely real context, but if we decide to work in $\mathbb{C}$ then we can't just freely use the sum-to-product rule
\begin{equation}
\log(zw)=\log(z)+\log(w).
\end{equation}
How should I understand this step in Euler's proof?

1) Ed Sandifer claims that this is the first rigorous proof that $e$ is irrational (Link. Note that the linked PDF didn't display correctly in the two browsers I tried, but was fine when I downloaded it.) 

A:

$$p = \frac{a}{2} \log \left(\frac{q+1}{q-1}\right)$$
is certainly a solution of the differential equation with $p \to 0$ as $q \to +\infty$, as can be verified directly.

