Pythagorean triples where the sum of the two cubes is also a square

Are there any Primitive Pythagorean triple solutions $(a,b,c)$ where the sum of the two cubes is also a square? In other words are there coprime $a,b>0 \in \mathbb{N} \;, (a,b)=1$ where $a^2+b^2=c^2$ and $a^3+b^3=d^2$ for some $c,d \in \mathbb{N}$


Disclaimer: These are some unfinished thoughts I will leave here to work on later, or for others to continue.


Given that $a$ and $b$ are coprime, it follows that $\gcd(a+b,a^2-ab+b^2)$ divides $3$ because $$\gcd(a+b,a^2-ab+b^2)=\gcd(a+b,3b^2)=\gcd(a+b,3).$$ Suppose towards a contradiction that the gcd equals $3$: Then the factorization $$d^2=a^3+b^3=(a+b)(a^2-ab+b^2),$$ shows that there exist $e,f\in\Bbb{Z}$ such that $$a+b=3e^2\qquad\text{ and }\qquad a^2-ab+b^2=3f^2,$$ from which it quickly follows that $$9e^4=(a+b)^2=a^2+2ab+b^2=3c^2-6f^2,$$ and reducing mod $8$ yields a contradiction, so the gcd is $1$. Hence there exist $e,f\in\Bbb{Z}$ such that $$a+b=e^2\qquad\text{ and }\qquad a^2-ab+b^2=f^2,$$ and in the same way as before we find that $$e^4=(a+b)^2=a^2+2ab+b^2=3c^2-2f^2.$$ Luckily $\Bbb{Z}[\sqrt{6}]$ is a UFD, and we have $$N((3c-2f)+(c-f)\sqrt{6}):= \left((3c-2f)+(c-f)\sqrt{6}\right)\left((3c-2f)-(c-f)\sqrt{6}\right) =3c^2-2f^2=e^4.$$ The gcd of two conjugate factors divides $2(3c-2f)$ and $2(c-f)$, and because $c$ and $f$ are coprime it follows that the gcd divides $2$. Because their product $e^4=(a+b)^2$ is odd, the two conjugate factors are in fact coprime. This means there exists some $x+y\sqrt{6}\in\Bbb{Z}[\sqrt{6}]$ such that $$(3c-2f)+(c-f)\sqrt{6}=(x+y\sqrt{6})^4.\tag{1}$$ This immediately tells us that $$a+b=e^2=\sqrt{N((3c-2f)+(c-f)\sqrt{6})}=(x+y\sqrt{6})^2(x-y\sqrt{6})^2=(x^2-6y^2)^2.\tag{2}$$ Furthermore, expanding equation $(1)$ yields the two equations $$3c-2f=x^4+36x^2y^2+36y^4\qquad\text{ and }\qquad c-f=4x^3y+24xy^3.$$ Because $c-f>0$, without loss of generality $x,y>0$. The above tells us that \begin{eqnarray*} c&=&x^4-\ 8x^3y+36x^2y^2-48xy^3+36y^4,\\ f&=&x^4- 12x^3y+36x^2y^2-72xy^3+36y^4, \end{eqnarray*} and hence that $$ab=c^2-f^2=(c-f)(c+f)=8xy(x^2+6y^2)(x^4-10x^3y+36x^2y^2-60xy^3+36y^4).\tag{3}$$ This means $a$ and $b$ are the roots of the quadratic polynomial $$Z^2-(x^2-6y^2)^2Z+8xy(x^2+6y^2)(x^4-10x^3y+36x^2y^2-60xy^3+36y^4).$$ This polynomial has integer roots if and only if its discriminant $\Delta$ is a square, where $$\Delta=(x^2-6y^2)^4-32xy(x^2+6y^2)(x^4-10x^3y+36x^2y^2-60xy^3+36y^4),$$ which leaves me with the question of when this homogeneous octic polynomial takes on square values.


A partial, in progress answer: $a,b$ satisfies $$ a=m^2-n^2=rs,\quad b = 2mn=\frac{(3r+s)(s-r)}{4} $$ for integers $m,n,r,s$ such that $$ \gcd(m,n)=\gcd(r,s)=1 $$ and $r,s$ are odd, $s\not\equiv 0\pmod 3$ and exactly one of $m,n$ is odd. It can be shown that $\gcd(a,b)=1$ using either $m,n$ or $r,s$. Perhaps this system is already not solvable.

The only other restriction remaining is $$ a+b=u^2 $$ for some integer $u$.

A sanity check: $$ a^2+b^2 = (m^2+n^2)^2 $$ and $$ a^2-ab+b^2 = \left(\frac{3r^2+s^2}{4}\right)^2 = v^2 \in \mathbb Z $$ Hence if $a+b=u^2$ then $$ a^3+b^3 = (a+b)(a^2-ab+b^2) = (uv)^2 $$


Let $a,b,c$ be a primitive Pythagorean triplet. Then we know that for some integers $m>n$ and $\gcd(m,n)=1$, $$ a=m^2-n^2,\quad b=2mn,\quad c = m^2+n^2 $$ In particular, $m,n$ also have different parity.

Proposition 1. Let $a,b,c$ be a primitive Pythagorean triplet such that $$ a=m^2-n^2,\quad b=2mn,\quad c = m^2+n^2 $$ and $m>n,\;\;\gcd(m,n)=1$. If $$ a^3+b^3=d^2, $$ for some integer $d$ then \begin{align} a+b &= u^2\\ a^2-ab+b^2 &= v^2 \end{align} for some integers $u,v$.

Proof. We start with $$ (a+b)(a^2-ab+b^2) = a^3+b^3 = d^2 $$ Since $$ 3a^2 = (2a-b)(a+b) + (a^2-ab+b^2) $$ This shows that $ \gcd(a+b,a^2-ab+b^2) $ divides $3a^2$. Checking $\pmod 3$, the equation $$ a+b = m^2+2mn-n^2 \equiv 0 \pmod 3 $$ is possible only if $m,n\equiv 0\pmod 3$. This contradicts $\gcd(m,n)=1$, therefore $3\nmid a+b$. Hence $\gcd(a+b,a^2-ab+b^2)$ divides $a^2$. Now if a prime $p$ divides $\gcd(a+b,a^2-ab+b^2)$, then $p$ divides $a^2$ and hence $p\mid a$. But that means $p$ divides $b$, contradicting $\gcd(a,b)=1$. Hence we conclude that $$ \gcd(a+b,a^2-ab+b^2)=1 $$ As a result, we can write $$ \begin{align} a+b &= u^2\\ a^2-ab+b^2 &= v^2 \end{align} $$ for some integers $u,v$. (It cannot have been $-u^2,-v^2$ instead since $a,b>0$.) $$\tag*{$\square$}$$


For the equation $$ a^2-ab+b^2=v^2, $$ since $\gcd(a,b)=1$ we must have $\gcd(a,v)=\gcd(b,v)=1$.

Proposition 2. The primitive integer solutions to $$ a^2-ab+b^2 = v^2 $$ are $$ \begin{align} a &= rs\\ b &= \frac{(3r-s)(r+s)}{4}\text{ or }\frac{(3r+s)(s-r)}{4}\\ v &= \frac{3r^2+s^2}{4} \end{align} $$ where $r,s$ are odd integers satisfying $\gcd(r,s)=1$.

Proof. We first convert the equation to $$ a^2-ab+b^2=v^2 \Longleftrightarrow (2b-a)^2 + 3a^2 = (2v)^2 $$

Following The Solution of the Diophantine Equation$X^2+3Y^2=Z^2$,

Theorem 2.2 Let $E:x^2+3y^2=z^2$ be the diophantine equation and $(x,y,z)\in\mathbb Z^3$ with $\gcd(x,y)=1$, $y$ is odd and $\gcd(xz,3)=1$. Then $$ \begin{align} |x| &= \frac{3r^2-s^2}{2}\\ |y| &= rs\\ |z| &= \frac{3r^2+s^2}{2} \end{align} $$ for some odd integers $r,s$ and $\gcd(r,s)=1$. (Not written but implied that $s\not\equiv 0\pmod 3$.

Since $a$ is already odd, to use this result we need to check that $$ \gcd(2b-a,a)=1,\quad \gcd((2b-a)(2v),3)=1 $$ The first part is immediate since $\gcd(a,b)=1$ and $a$ is odd. For the second part, if $3\mid v$ or $3\mid 2b-a$ then from $$ (2b-a)^2+3a^2=v^2 $$ we get $3\mid a$. For both cases $3$ divides $2b-a,a$ so $3$ divides $b$. This contradicts $\gcd(a,b)=1$. Therefore indeed $\gcd((2b-a)(2b),3)=1$, so we obtain the solutions $$ \begin{align} |2b-a| &= \frac{3r^2-s^2}{2}\\ |a| &= rs\\ |2v| &= \frac{3r^2+s^2}{2} \end{align} $$ for some odd $r,s$ satisfying $\gcd(r,s)=1$. Rearranging: $$ \begin{align} a &= rs\\ b &= \frac{(3r-s)(r+s)}{4}\text{ or }\frac{(3r+s)(s-r)}{4}\\ v &= \frac{3r^2+s^2}{4} \end{align} $$ which is what we want. $$\tag*{$\square$}$$


This gives us a new restriction: $$ u^2 = a+b = \frac{3r^2+6rs-s^2}{4} \text{ or } \frac{s^2+6rs-3r^2}{4} $$ We do a substitution for the odd $r=2f+1,s=2g+1$, giving $$ u^2 = 2 + 6 f + 3 f^2 + 2 g + 6 f g - g^2 $$ or $$ u^2 = 1 - 3 f^2 + 4 g + 6 f g + g^2 $$ For the first equation, LHS $\equiv 0,1\pmod 4$ but RHS $\equiv 2,3\pmod 4$, which is impossible. Therefore it must have been $$ a=m^2-n^2=rs,\quad b = 2mn=\frac{(3r+s)(s-r)}{4} $$


If we suppose that such integers exist and write, say, $a=r^2-s^2$ and $b=2rs$ for coprime (positive) integers $r$ and $s$, then $$ d^2=(r^2+2rs-s^2)(r^4-2r^3s++2r^2s^2+2rs^3+s^4) $$ and hence a solution would correspond to a (nontrivial) rational point on the (genus $2$) curve $$ y^2 = x^6 -3x^4+8x^3+3x^2-1. $$ The Jacobian of this curve has rank $1$ and a Chabauty argument in Magma using the prime $17$ shows that there are no such points. There may be an easier way to see this, but I'm afraid it's not obvious to me.