# On $a^4+nb^4 = c^4+nd^4$ and Chebyshev polynomials

In a 1995 paper, Choudhry gave a table of solutions to the quartic Diophantine equation,

$a^4+nb^4 = c^4+nd^4\tag{1}$

for $n\leq101$. Seiji Tomita recently extended this to $n<1000$ and solved all $n$ except $n=967$ (which was later found by Andrew Bremner).

It can be shown there is an infinite number of $n$ such that $(1)$ is solvable, such as $n=v^2-3$. In general, given the Chebyshev polynomials of the first kind $T_m(x)$

\begin{aligned} T_1(x) &= x\\ T_2(x) &= 2x^2-1\\ T_3(x) &= 4x^3-3x\\ \end{aligned}

etc, and the second kind $U_m(x)$

\begin{aligned} U_1(x) &= 2x\\ U_2(x) &= 4x^2-1\\ U_3(x) &= 8x^3-4x\\ \end{aligned}

etc, define, $$n = \frac{T_m(x)}{x}$$ $$y = \frac{U_{m-2}(x)}{x}$$

then one can observe that,

$(n + n x + y)^4 + n(1 - n x - x y)^4 = (n - n x + y)^4 + n(1 + n x + x y)^4\tag{2}$

Questions:

1. Is $(1)$ solvable in the integers for all positive integer $n$ where $a^4\neq c^4$? (This has also been asked in this MSE post.)
2. How do we show that $(2)$ is indeed true for all positive integer $m$?

Question 2: The reason must be that Chebyshev polynomials solve Fermat-Pell equations. The difference between the two sides of equation (2), $$(n+nx+y)^4 + n(1−nx−xy)^4 = (n−nx+y)^4 + n(1+nx+xy)^4,$$ factors as $8nx(n+y) \phantom. ((x^2-1)y^2 + 2n(x^2-1)y + 1 - n^2)$. The last factor is a quadratic in $n$ with leading coefficient $1$, so has solutions iff the discriminant is a square. This yields the equation $(x^2-1) u^2 + 1 = t^2$ where $u=xy$, which is a Fermat-Pell equation in $u$ and $t$ with fundamental solution $(u,t)=(1,x)$, etc.

I am pretty sure (2) is easy to prove by identities for Chebyshev polynomials and I think sage proved it.

Let $U_{n-1},U_{n-2},T_{n-1},T_{n-2}$ be variables, use the recurrence for $T_n$ to compute the identity for $m$ and reduce it modulo the identities $T_n(x)^2 - (x^2-1) U_{n-1}(x)^2 = 1$ and $U_n(x) = xU_{n-1}(x) + T_n(x)$

Here is sage code that appears to prove it (I suppose I don't even need induction).

def titoide2():
"""
"""
def titochebide1(n,y,x):
return (n+n*x+y)**4+n*(1-n*x-x*y)**4-( (n-n*x+y)**4+n*(1+n*x+x*y)**4 )
def smalchste(a,b,x):
"""
recurrence for U_n and T_n
"""
return 2*x*a-b

pr.<u2,u1,t2,t1,x>=QQ[]
# u1=U_{n-1},u2=U_{n-2}, t1=T_{n-1},t2=T_{n-2}
m=11

t3=smalchste(t1,t2,x) #T_n
t4=smalchste(t3,t1,x) #T_{n+1}
u3=smalchste(u1,u2,x) #U_n

r1=titochebide1(t3/x,u2/x,x) #hypothesis for m, currently not used

ide=[t1^2-(x^2-1)*u2^2-1,t3^2-(x^2-1)*u1^2-1,u1-(u2*x+t1),u3-(u1*x+t3) ,t4^2-(x^2-1)*u3^2-1]
##ide=[numerator(r1),t1^2-(x^2-1)*u2^2-1,t3^2-(x^2-1)*u1^2-1,u1-(u2*x+t1),u3-(u1*x+t3) ,t4^2-(x^2-1)*u3^2-1] #hypothesis doesn't appear to be needed

# T_n(x)^2 - (x^2-1) U_{n-1}(x)^2 = 1 and U_n(x) = xU_{n-1}(x) + T_n(x)  from https://en.wikipedia.org/wiki/Chebyshev_polynomials

ide=[numerator(_) for _ in ide]
prq=pr.quotient(ide)
r2=titochebide1(t4/x,u1/x,x) # for m+1
r2q=prq(numerator(r2)) # reduce it modulo identities
print 'r2q=',r2q
if r2q==0:
print ' identity holds'
else:
print ' couldn\'t prove it'