I want to study the rational points on a cubic. Eventually I found Nagell's algorithm from http://webs.ucm.es/BUCM/mat/doc8354.pdf, but I cannot immediately apply it because I don't know a rational point on the curve. I tried to use the point at infinity and skip to step 2 of the algorithm, but this causes $e_2$ and $e_3$ to both be $0$ even though the curve doesn't factor. The examples in the book practically skip over finding an initial rational point, but after some thought I'm almost certain that using the point at infinity doesn't work and have some ideas about finding an initial rational point. The main problem is that my cubic is a trivariate polynomial.
The cubic equation I'm studying is
$$F(a_x, b_x, r)=40(a_x+b_x)a_x b_x - (4r+100)(a_x^2 + b_x^2) - (4r + 300)a_x b_x + (20r + 500)(a_x + b_x) + (3r + 25)(r - 25).$$
Clearly this polynomial is symmetric in $a_x$ and $b_x$, cubic overall, and quadratic in each variable.
I think the problem with using a point at infinity is that the tangents to the graph at the point at infinity are the asymptotes. For this curve, the asymptotes are $a_x=\frac{4r+100}{40}$, $b_x=\frac{4r+100}{40}$, and $a_x+b_x=\frac{50-2r}{20}$. The horizontal and vertical asymptotes actually do intersect the graph at finite points, so I'm not sure if further abusing Nagell's algorithm by using one of these asymptotes as the tangent line and one of these finite intersections as $Q$ in the algorithm has any merit, but I will look into that. However, the oblique asymptote does not intersect the curve except at the critical values of $r$ ($0$, $25$, and $\frac{125}{2}$). (These are where the graph transitions from having an ellipse like "island" and three narrow hyperbola like "branches", to having one narrow "branch" and two wide "branches" which bend in the region where the "island" would go. At these critical values, the graph has self intersections instead. There are two other critical values near $0.3$ and $18.1$ between which the "island" disappears, but these are not relevant.)
So it seems that using the point at infinity as the initial rational point in Nagell's algorithm is "cheating" and will not be rewarded. For any finite rational point, the discriminant of $F$ as a polynomial in $a_x$, $b_x$, and $r$ must be a perfect square over the rationals. As stated, these are all quadratic. This is pretty much where I've been directing my attention, but the discriminants are $$16(a_x^4 + b_x^4) + 48a_x^2b_x^2 + 32(a_x^2 + b_x^2)a_x b_x - 160(a_x^3 + b_x^3) - 800(a_x + b_x)a_x b_x + 2000(a_x^2 + b_x^2) + 4800a_x b_x - 8000(a_x + b_x) + 10000$$ for $r$ and $$1600b_x^4 + 320b_x^3 r - 8000b_x^3 - 48b_x^2 r^2 - 2400b_x^2 r + 10000b_x^2 - 320b_x r^2 + 8000b_x r + 48r^3 + 800r^2 - 10000r$$ for $a_x$ (obviously the former is symmetric in $a_x$ and $b_x$ and the discriminant for $b_x$ is the same as the one for $a_x$ but with $a_x$ replaced with $b_x$).
The first one is symmetric and so it's simpler so that's the one I've been focusing on, however it is not a perfect square, cannot be written as the sum or difference of the squares of two symmetric polynomials in $a_x$ and $b_x$, and cannot be written as the sum of the squares of two symmetric polynomials in $a_x$ and $b_x$ plus the square of an integer. I stopped checking at that point so perhaps it is the sum of three or more squares of such polynomials or two or more plus the square of an integer, but after two that's really of rapidly diminishing usefulness. (I checked this by writing coefficient matching equations and searching for solutions using groebner bases, eg to show the discriminant cannot be the sum of two squares we take the expression $A(a_x^2+b_x^2)+Ba_x b_x + C(a_x+b_x) + D$, square it, add to the same expression but with $E$, $F$, $G$, and $H$, and coefficient match.)
Is my understanding of why Nagell's algorithm fails if we use the point at infinity correct?
Is there a good way to find when the discriminants mentioned are perfect squares of rational numbers, or if not, is there a good way to find and initial rational point on the cubic? I don't want an explanation of how to find all the rational points, just an initial one.
Introduction
I'm still not sure if there's a general finite rational point for the $a_x$ $b_x$ curve for fixed $r$, but I did find a general rational point for the $b_x$ $r$ curve for fixed $a_x$, and I've come to a better understanding of why using the point at infinity didn't work.
Why Nagell's Algorithm requires a finite rational point
In Nagell's algorithm, we try to convert $f(u, v)$ into $$F(U, V, W) = F_3(U, V) + F_2(U, V)W + F_1(U, V)W^2,$$ where each $F_i$ is a homogeneous polynomial of degree $i$. In fact, each $F_i$ is the components of $f(u, v)$ with degree $i$ after the substitution $u=\frac{U}{W}$ and $v=\frac{V}{W}$.
We have to shift $f$ so that it has a rational point at the origin $(u,v)=(0,0)$. This means when we convert to projective coordinates, $F_1(U, V)$ is tangent to the curve at $(0,0)$
However, if we try to use a point at infinity instead, $F_1$ is zero and corresponds to the line at infinity, rather than a useful tangent line that we can find an intersection with the curve for. (We can't simply shift a point at infinity to the origin, instead we have to convert to projective coordinates and then shift and permute the coordinates so the point at infinity is mapped to the origin, but this isn't really relevant.)
So that's why using a point at infinity doesn't work.
Converting our cubic to an elliptic curve
As I mentioned in a comment, if we look at the discriminant of the curve as a quadratic in $r$, it's pretty inscrutable: $$16(a_x^4 + b_x^4) + 48a_x^2b_x^2 + 32(a_x^2 + b_x^2)a_x b_x - 160(a_x^3 + b_x^3) - 800(a_x + b_x)a_x b_x + 2000(a_x^2 + b_x^2) + 4800a_x b_x - 8000(a_x + b_x) + 10000.$$ However, if we substitute $b_x=a_x$, which is one of the top three substitutions to try, we see something nice happens: the discriminant becomes: $$144a_x^4 - 1920a_x^3 + 8800a_x^2 - 16000a_x + 10000$$ which factors as $$16(a_x - 5)^2(3a_x - 5)^2.$$ This is very nice, we can use this to find a finite rational point on the curve for any fixed $a_x$, in particular $(a_x, b_x, r)=(a_x, a_x, \frac{5}{3}(4a_x - 5))$ or $(a_x, a_x, (2a_x - 5)^2)$
Let's proceed with the first point. We can define $f(u, v) = 3G_9(a_x, u + a_x, v + \frac{5}{3}(4a_x - 5))$ where $G_9(a_x, b_x, r)$ is simply our cubic. This $f$ is clearly a bivariate cubic in $u$, $v$ with a root at the origin and the $v$ coefficient nonzero, so we can proceed further into Nagell's algorithm. We substitute $u=\frac{U}{W}$ and $v=\frac{V}{W}$ and get $$F=F_3+F_2 W+F_1 W^2=0$$ $$F_3=(-12)U^2 V$$ $$F_2=40(a_x - 5)U^2 - 12(3a_x - 5)UV + 9V^2$$ $$F_1=40(3a_x - 5)(a_x - 5)U - 12(a_x - 5)(3a_x - 5)V$$
Do note that this has a small hole where $a_x = 5$, since in that case both the $U$ and $V$ coefficients are zero, so the equation factors. We'll just assume $a_x \ne 5$ for the rest of this analysis. It's simple to analyze that case since it doesn't even require converting the cubic to an elliptic curve, it just simplifies. $a_x = \frac{5}{3}$ would also be problematic, but I actually only care about integral points not rational points, so $5$ is the only problematic value.
The next step of Nagell's algorithm effectively computes the point where the tangent ($F_1$) at the origin intersects the curve. The important parts of this though are two numbers $e_2$ and $e_3$ where $e_i=F_i(s9, -s8)$. $s8$ and $s9$ are the $U$ and $V$ coefficients. We get $e_2=2880(5-4a_x)(a_x-5)^2(3a_x-5)^2$ and $e_3=0$.
This is where the algorithm actually failed when I tried to use the point at infinity: both $e_2$ and $e_3$ were zero but $G_9$ did not factor. But now, for integral $a_x\ne 5$, $e_2$ is nonzero. $e_3$ is zero however, meaning the intersection point (the intersection between the tangent at the origin and the curve, NOT the rational point which was shifted to the origin) is a point at infinity. We proceed by using the substitution $U=U'+12(a_x-5)(3a_x-5)W'$, $V=V'+40(a_x-5)(3a_x-5)W'$, and $W=U'$. Then we convert back to cartesian coordinates $u'=\frac{U'}{W'}$ and $v'=\frac{V'}{W'}$. This gives us
$$f' = f_3' + f_2' + f_1'$$ $$f_1' = -2880(a_x-5)^2(3a_x-5)^2(4a_x-1)u' - 1728(a_x-5)^2(3a_x-5)^2v'$$ $$f_2' = -48u'(10(a_x-5)(a_x+6)(3a_x-5)u' + 3(a_x-5)(3a_x-8)(3a_x-5)v')$$ $$f_3' = u'(40(a_x-5)(3a_x-4)u'^2 - 12(13a_x^2 - 17a_x + 21)u'v' + 9v'^2)$$
(Hey look, it's a special guest appearance of the special elliptic curve number $1728$!)
The final change of variables is the most complicated yet, and occurs in a few steps. First, we let $t=\frac{v'}{u'}$ so that we can rewrite $f' = 0$ as $$u'^2 f_3'(1,t) + u'f_2'(1,t) + f_1'(1,t) = 0.$$ Then we have a few more substitutions: $u'=\frac{-\phi_2\pm\sqrt{\delta}}{2\phi_3}$, $v'=tu'$, where $\phi_i = f_i'(1,t)$ and $\delta = \phi_2^2-4\phi_1\phi_3$. Then we substitute $t$ again: define $t_0=\frac{-s_8}{s_9}$ and write $t=t_0+\frac{1}{\tau}$. If we apply all these definitions and substitutions to $\rho=\tau^3\delta$, we get $\rho$ is a cubic in $\tau$, in particular $\rho=c\tau^3+d\tau^2+e\tau+k$. (This is the one inconsistency I still found with the algorithm: the book I linked in the question states that $\tau^4\delta$ is a cubic in $\tau$, but I found that only $\tau^3$ was needed to cancel the denominators and yield a cubic.)
The elliptic curve we get is then based on the coefficients from $\rho$: $$y^2=x^3+dx^2+cex+c^2k.$$ $x$ and $y$ are linked to our existing variables as $\tau=\frac{x}{c}$, $\rho=\frac{y^2}{c^2}$, $t=t_0+\frac{c}{x}$, and $\delta=\frac{c^2 y^2}{x^4}$.
Continuing with our particular curve, we get $$\phi_1=-576(a_x-5)^2(3a_x-5)^2(20a_x+3t-5)$$ $$\phi_2=-48(a_x-5)(3a_x-5)(9a_x t+10a_x-24t+60)$$ $$\phi_3=9t^2-12(3a_x^2-17a_x+21)t+40(a_x-5)(3a_x-4)$$ $$\delta=2304(a_x-5)^2(3a_x-5)^2((20a_x+3t-5)(-36a_x^2 t+120a_x^2+204a_x t-760a_x+9t^2-252t+800)+(9a_x t+10a_x-24t+60)^2).$$
Then for $\rho$ we get $$\rho=2304(a_x-5)^2(3a_x-5)^2(-100(8a_x-7)\tau^3 -60(12a_x^3-77a_x^2+89a_x-3)\tau^2 -9(3a_x^2-40a_x-5)\tau+27),$$ so we've successfully converted the original cubic to an elliptic curve $$y^2=x^3-2304\cdot 60(a_x-5)^2(3a_x-5)^2(12a_x^3-77a_x^2+89a_x-3)x^2 + 2304^2\cdot 100\cdot 9(a_x-5)^4(3a_x-5)^4(8a_x-7)(3a_x^2-40a_x-5)x + 2304^3\cdot 100^2\cdot 27(a_x-5)^6(3a_x-5)^6(8a_x-7)^2!$$ (The exclamation point denotes excitement, not factorial.)
This was a very long and tedious computation, I did it mostly in Sympy to avoid making mistakes, but I still have not completely verified it checks out. I tried to explain how I followed Nagell's algorithm in pretty high detail, but I also didn't literally write down every single step. The book (http://webs.ucm.es/BUCM/mat/doc8354.pdf, in chapter 1.4) explains each step of the algorithm, but worked through examples skip over a lot of things, so I hope that this more detailed walkthrough will be helpful to anyone else who, for example, also tries to use a point at infinity and runs into a similar problem. Even this answer is not as detailed as it could be, in particular I didn't explain how I actually used Sympy to do the computations (it's mostly factor, subs, expand, simplify, collect, and coeff, although coeff doesn't always work nicely with multivariate polynomials so take care).