Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Well...

a,b,c = 2,3,5
x, k = var('x,k')
eq=a*x^2 + b*x + c - k^2==0
Sol=solve_diophantine(eq, (x, k))

We obtain a list of 16 solutions of similar form, the first one meaning :

$$ x=-\frac{1}{16} \, \sqrt{2} {\left({\left(470832 \, \sqrt{2} + 665857\right)}^{t} {\left(3841 \, \sqrt{2} + 5432\right)} + {\left(-470832 \, \sqrt{2} + 665857\right)}^{t} {\left(3841 \, \sqrt{2} - 5432\right)}\right)} - \frac{3}{4} $$

$$ k=\frac{1}{8} \, {\left(470832 \, \sqrt{2} + 665857\right)}^{t} {\left(3841 \, \sqrt{2} + 5432\right)} - \frac{1}{8} \, {\left(-470832 \, \sqrt{2} + 665857\right)}^{t} {\left(3841 \, \sqrt{2} - 5432\right)} $$

These solutions depend of a parameter $t$, a nonnegative integer. It turns out that, notwithstanding the presence of $\sqrt{2}$ , these expressions are integers. We can numerically check this for a not unreasonable range of $t$ :

sage: %time all([all(flatten([[u.subs(t==w).expand().is_integer() for u in v] for v in Sol])) for w in range(100)])
CPU times: user 6.16 s, sys: 80.2 ms, total: 6.24 s
Wall time: 6.24 s
True

Similarny, we can numerically check that these quantities are indeed solutions of eq on a not unreasonable range of $t$ :

sage: %time all([all([bool(eq.subs([x==u[0].subs(t==v), k==u[1].subs(t==v)]).expand()) for u in Sol]) for v in range(100)])
CPU times: user 9.01 s, sys: 88 ms, total: 9.1 s
Wall time: 9.1 s
True

A simple form of the explanation can be found somewhere in a Mathematica tutorial. A better-known analogy is the *casus irreducibilis" of the cubic, where a (demonstrably) real root can be expressed only as the sum of non-real complexes.

A better explanation, by someone who, contrary to me, knows what he's talking about when talking about Diophantine equations, would be extremely welcome...

One can note that Sympi's diophantine and Mathematica's Reduce give similar forms to their solutions, but Mathematica gives only 8 solutions, with different (and numerically simpler) constants, possibly by finding equalities among them and simplifying more efficiently.

Notwithstanding, HTH,

Well...

a,b,c = 2,3,5
x, k = var('x,k')
eq=a*x^2 + b*x + c - k^2==0
Sol=solve_diophantine(eq, (x, k))

We obtain a list of 16 solutions of similar form, the first one meaning :

$$ x=-\frac{1}{16} \, \sqrt{2} {\left({\left(470832 \, \sqrt{2} + 665857\right)}^{t} {\left(3841 \, \sqrt{2} + 5432\right)} + {\left(-470832 \, \sqrt{2} + 665857\right)}^{t} {\left(3841 \, \sqrt{2} - 5432\right)}\right)} - \frac{3}{4} $$

$$ k=\frac{1}{8} \, {\left(470832 \, \sqrt{2} + 665857\right)}^{t} {\left(3841 \, \sqrt{2} + 5432\right)} - \frac{1}{8} \, {\left(-470832 \, \sqrt{2} + 665857\right)}^{t} {\left(3841 \, \sqrt{2} - 5432\right)} $$

These solutions depend of a parameter $t$, a nonnegative integer. It turns out that, notwithstanding the presence of $\sqrt{2}$ , these expressions are integers. We can numerically check this for a not unreasonable range of $t$ :

sage: %time all([all(flatten([[u.subs(t==w).expand().is_integer() for u in v] for v in Sol])) for w in range(100)])
CPU times: user 6.16 s, sys: 80.2 ms, total: 6.24 s
Wall time: 6.24 s
True

Similarny, we can numerically check that these quantities are indeed solutions of eq on a not unreasonable range of $t$ :

sage: %time all([all([bool(eq.subs([x==u[0].subs(t==v), k==u[1].subs(t==v)]).expand()) for u in Sol]) for v in range(100)])
CPU times: user 9.01 s, sys: 88 ms, total: 9.1 s
Wall time: 9.1 s
True

A simple form of the explanation can be found somewhere in a Mathematica tutorial. A better-known analogy is the *casus irreducibilis" of the cubic, where a (demonstrably) real root can be expressed only as the sum of non-real complexes.

A better explanation, by someone who, contrary to me, knows what he's talking about when talking about Diophantine equations, would be extremely welcome...

EDIT : These quantities can be proven integers as follows :

sage: var("j", domain="integer")
j
sage: w0, w1, w2 = (SR.wild(u) for u in range(3))
sage: var("c", n=3)
(c0, c1, c2)

Express the binomial theorem :

sage: foo=(sum(binomial(c2,j)*c0^j*c1^(c2-j), j, 0, c2)==sum(binomial(c2,j)*c0^j*c1^(c2-j), j, 0, c2, hold=True))

Make a substitution rule by replacing variables by wildcards :

sage: BE = foo.subs({c0:w0, c1:w1, c2:w2}) ; BE
($1 + $0)^$2 == sum($1^($2 - j)*$0^j*binomial($2, j), j, 0, $2)

Apply it, then consider the (expanded) expressions as polynomial in $\sqrt{2}$, and look at the coefficients :

var("r2")
r2
sage: [[u.subs(BE).subs(sqrt(2)==r2).expand().coefficient(r2,1) for u in v] for v in Sol]
[[0, 0],
 [0, 0],
 [0, 0],
 [0, 0],
 [0, 0],
 [0, 0],
 [0, 0],
 [0, 0],
 [0, 0],
 [0, 0],
 [0, 0],
 [0, 0],
 [0, 0],
 [0, 0],
 [0, 0],
 [0, 0]]

(End of EDIT)

One can note that Sympi's diophantine and Mathematica's Reduce give similar forms to their solutions, but Mathematica gives only 8 solutions, with different (and numerically simpler) constants, possibly by finding equalities among them and simplifying more efficiently.

Notwithstanding, HTH,

Well...

a,b,c = 2,3,5
x, k = var('x,k')
eq=a*x^2 + b*x + c - k^2==0
Sol=solve_diophantine(eq, (x, k))

We obtain a list of 16 solutions of similar form, the first one meaning :

$$ x=-\frac{1}{16} \, \sqrt{2} {\left({\left(470832 \, \sqrt{2} + 665857\right)}^{t} {\left(3841 \, \sqrt{2} + 5432\right)} + {\left(-470832 \, \sqrt{2} + 665857\right)}^{t} {\left(3841 \, \sqrt{2} - 5432\right)}\right)} - \frac{3}{4} $$

$$ k=\frac{1}{8} \, {\left(470832 \, \sqrt{2} + 665857\right)}^{t} {\left(3841 \, \sqrt{2} + 5432\right)} - \frac{1}{8} \, {\left(-470832 \, \sqrt{2} + 665857\right)}^{t} {\left(3841 \, \sqrt{2} - 5432\right)} $$

These solutions depend of a parameter $t$, a nonnegative integer. It turns out that, notwithstanding the presence of $\sqrt{2}$ , these expressions are integers. We can numerically check this for a not unreasonable range of $t$ :

sage: %time all([all(flatten([[u.subs(t==w).expand().is_integer() for u in v] for v in Sol])) for w in range(100)])
CPU times: user 6.16 s, sys: 80.2 ms, total: 6.24 s
Wall time: 6.24 s
True

Similarny, we can numerically check that these quantities are indeed solutions of eq on a not unreasonable range of $t$ :

sage: %time all([all([bool(eq.subs([x==u[0].subs(t==v), k==u[1].subs(t==v)]).expand()) for u in Sol]) for v in range(100)])
CPU times: user 9.01 s, sys: 88 ms, total: 9.1 s
Wall time: 9.1 s
True

A simple form of the explanation can be found somewhere in a Mathematica tutorial. A better-known analogy is the *casus irreducibilis" of the cubic, where a (demonstrably) real root can be expressed only as the sum of non-real complexes.

A better explanation, by someone who, contrary to me, knows what he's talking about when talking about Diophantine equations, would be extremely welcome...

EDIT : These quantities can

To be proven integers as follows :

sage: var("j", domain="integer")
j
sage: w0, w1, w2 = (SR.wild(u) for u in range(3))
sage: var("c", n=3)
(c0, c1, c2)

Express the binomial theorem :

sage: foo=(sum(binomial(c2,j)*c0^j*c1^(c2-j), j, 0, c2)==sum(binomial(c2,j)*c0^j*c1^(c2-j), j, 0, c2, hold=True))

Make a substitution rule by replacing variables by wildcards :

sage: BE = foo.subs({c0:w0, c1:w1, c2:w2}) ; BE
($1 + $0)^$2 == sum($1^($2 - j)*$0^j*binomial($2, j), j, 0, $2)

Apply it, then consider the (expanded) expressions as polynomial in $\sqrt{2}$, and look at the coefficients :

var("r2")
r2
sage: [[u.subs(BE).subs(sqrt(2)==r2).expand().coefficient(r2,1) for u in v] for v in Sol]
[[0, 0],
 [0, 0],
 [0, 0],
 [0, 0],
 [0, 0],
 [0, 0],
 [0, 0],
 [0, 0],
 [0, 0],
 [0, 0],
 [0, 0],
 [0, 0],
 [0, 0],
 [0, 0],
 [0, 0],
 [0, 0]]
rewritten...

(End of EDIT)

One can note that Sympi's diophantine and Mathematica's Reduce give similar forms to their solutions, but Mathematica gives only 8 solutions, with different (and numerically simpler) constants, possibly by finding equalities among them and simplifying more efficiently.

Notwithstanding, HTH,

Well...

a,b,c = 2,3,5
x, k = var('x,k')
eq=a*x^2 + b*x + c - k^2==0
Sol=solve_diophantine(eq, (x, k))

We obtain a list of 16 solutions of similar form, the first one meaning :

$$ x=-\frac{1}{16} \, \sqrt{2} {\left({\left(470832 \, \sqrt{2} + 665857\right)}^{t} {\left(3841 \, \sqrt{2} + 5432\right)} + {\left(-470832 \, \sqrt{2} + 665857\right)}^{t} {\left(3841 \, \sqrt{2} - 5432\right)}\right)} - \frac{3}{4} $$

$$ k=\frac{1}{8} \, {\left(470832 \, \sqrt{2} + 665857\right)}^{t} {\left(3841 \, \sqrt{2} + 5432\right)} - \frac{1}{8} \, {\left(-470832 \, \sqrt{2} + 665857\right)}^{t} {\left(3841 \, \sqrt{2} - 5432\right)} $$

These solutions depend of a parameter $t$, a nonnegative integer. It turns out that, notwithstanding the presence of $\sqrt{2}$ , these expressions are integers. We can numerically check this for a not unreasonable range of $t$ :

sage: %time all([all(flatten([[u.subs(t==w).expand().is_integer() for u in v] for v in Sol])) for w in range(100)])
CPU times: user 6.16 s, sys: 80.2 ms, total: 6.24 s
Wall time: 6.24 s
True

Similarny, we can numerically check that these quantities are indeed solutions of eq on a not unreasonable range of $t$ :

sage: %time all([all([bool(eq.subs([x==u[0].subs(t==v), k==u[1].subs(t==v)]).expand()) for u in Sol]) for v in range(100)])
CPU times: user 9.01 s, sys: 88 ms, total: 9.1 s
Wall time: 9.1 s
True

A simple form of the explanation can be found somewhere in a Mathematica tutorial. A better-known analogy is the *casus irreducibilis" of the cubic, where a (demonstrably) real root can be expressed only as the sum of non-real complexes.

A better explanation, by someone who, contrary to me, knows what he's talking about when talking about Diophantine equations, would be extremely welcome...

EDIT :

To be rewritten...

sage: a,b,c = 2,3,5
sage: x, k = var('x,k')
sage: eq = a*x^2 + b*x + c - k^2 
sage: Sol = solve_diophantine(eq, (x, k))

We need to convert the powers of sums involving $\sqrt{2}$ in something more palatable. The binomial theorem (an 11th grade remembrance) will help us :

sage: C=var("c", n=3)
sage: W=tuple((SR.wild(u) for u in range(5)))
sage: BE=(sum(binomial(c2,j)*c0^j*c1^(c2-j),j,0,c2)==sum(binomial(c2,j)*c0^j*c1^(c2-j),j,0,c2,hold=True)).subs(dict(zip(C,W))); BE
($1 + $0)^$2 == sum($1^($2 - j)*$0^j*binomial($2, j), j, 0, $2)

Armed with this substitution tool, our solutions become :

sage: [tuple((u.subs(BE).expand().maxima_methods().sumcontract() for u in v)) for v in Sol]

$$\left[\left(\frac{91279}{4} \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}} - \frac{3}{4}, -32272 \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}}\right)\right]$$

$$\left[\left(\frac{79}{4} \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}} - \frac{3}{4}, -28 \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}}\right)\right]$$

$$\left[\left(-\frac{13}{4} \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}} - \frac{3}{4}, 5 \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}}\right)\right]$$

$$\left[\left(-\frac{15661}{4} \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}} - \frac{3}{4}, 5537 \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}}\right)\right]$$

$$\left[\left(\frac{659}{4} \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}} - \frac{3}{4}, -233 \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}}\right)\right]$$

$$\left[\left(-\frac{3841}{4} \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}} - \frac{3}{4}, 1358 \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}}\right)\right]$$

$$\left[\left(\frac{19}{4} \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}} - \frac{3}{4}, -7 \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}}\right)\right]$$

$$\left[\left(-\frac{1}{4} \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}} - \frac{3}{4}, 2 \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}}\right)\right]$$

$$\left[\left(\frac{760499}{4} \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}} - \frac{3}{4}, -268877 \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}}\right)\right]$$

$$\left[\left(-\frac{1}{4} \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}} - \frac{3}{4}, -2 \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}}\right)\right]$$

$$\left[\left(-\frac{532013}{4} \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}} - \frac{3}{4}, 188095 \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}}\right)\right]$$

$$\left[\left(\frac{22387}{4} \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}} - \frac{3}{4}, -7915 \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}}\right)\right]$$

$$\left[\left(\frac{2687}{4} \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}} - \frac{3}{4}, -950 \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}}\right)\right]$$

$$\left[\left(-\frac{461}{4} \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}} - \frac{3}{4}, 163 \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}}\right)\right]$$

$$\left[\left(-\frac{113}{4} \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}} - \frac{3}{4}, 40 \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}}\right)\right]$$

$$\left[\left(-\frac{130481}{4} \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}} - \frac{3}{4}, 46132 \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}}\right)\right]$$

(End of EDIT)

One can note that Sympi's diophantine and Mathematica's Reduce give similar forms to their solutions, but Mathematica gives only 8 solutions, with different (and numerically simpler) constants, possibly by finding equalities among them and simplifying more efficiently.

Notwithstanding, HTH,

Well...

a,b,c = 2,3,5
x, k = var('x,k')
eq=a*x^2 + b*x + c - k^2==0
Sol=solve_diophantine(eq, (x, k))

We obtain a list of 16 solutions of similar form, the first one meaning :

$$ x=-\frac{1}{16} \, \sqrt{2} {\left({\left(470832 \, \sqrt{2} + 665857\right)}^{t} {\left(3841 \, \sqrt{2} + 5432\right)} + {\left(-470832 \, \sqrt{2} + 665857\right)}^{t} {\left(3841 \, \sqrt{2} - 5432\right)}\right)} - \frac{3}{4} $$

$$ k=\frac{1}{8} \, {\left(470832 \, \sqrt{2} + 665857\right)}^{t} {\left(3841 \, \sqrt{2} + 5432\right)} - \frac{1}{8} \, {\left(-470832 \, \sqrt{2} + 665857\right)}^{t} {\left(3841 \, \sqrt{2} - 5432\right)} $$

These solutions depend of a parameter $t$, a nonnegative integer. It turns out that, notwithstanding the presence of $\sqrt{2}$ , these expressions are integers. We can numerically check this for a not unreasonable range of $t$ :

sage: %time all([all(flatten([[u.subs(t==w).expand().is_integer() for u in v] for v in Sol])) for w in range(100)])
CPU times: user 6.16 s, sys: 80.2 ms, total: 6.24 s
Wall time: 6.24 s
True

Similarny, we can numerically check that these quantities are indeed solutions of eq on a not unreasonable range of $t$ :

sage: %time all([all([bool(eq.subs([x==u[0].subs(t==v), k==u[1].subs(t==v)]).expand()) for u in Sol]) for v in range(100)])
CPU times: user 9.01 s, sys: 88 ms, total: 9.1 s
Wall time: 9.1 s
True

A simple form of the explanation can be found somewhere in a Mathematica tutorial. A better-known analogy is the *casus irreducibilis" of the cubic, where a (demonstrably) real root can be expressed only as the sum of non-real complexes.

A better explanation, by someone who, contrary to me, knows what he's talking about when talking about Diophantine equations, would be extremely welcome...

EDIT :

sage: a,b,c = 2,3,5
sage: x, k = var('x,k')
sage: eq = a*x^2 + b*x + c - k^2 
sage: Sol = solve_diophantine(eq, (x, k))

We need to convert the powers of sums involving $\sqrt{2}$ in something more palatable. The binomial theorem (an 11th grade remembrance) will help us :

sage: C=var("c", n=3)
sage: W=tuple((SR.wild(u) for u in range(5)))
sage: BE=(sum(binomial(c2,j)*c0^j*c1^(c2-j),j,0,c2)==sum(binomial(c2,j)*c0^j*c1^(c2-j),j,0,c2,hold=True)).subs(dict(zip(C,W))); BE
($1 + $0)^$2 == sum($1^($2 - j)*$0^j*binomial($2, j), j, 0, $2)

Armed with this substitution tool, our solutions become :

sage: [tuple((u.subs(BE).expand().maxima_methods().sumcontract() for u in v)) for v in Sol]
Sol])

$$\left[\left(\frac{91279}{4} \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}} - \frac{3}{4}, -32272 \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}}\right)\right]$$

$$\left[\left(\frac{79}{4} \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}} - \frac{3}{4}, -28 \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}}\right)\right]$$

$$\left[\left(-\frac{13}{4} \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}} - \frac{3}{4}, 5 \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}}\right)\right]$$

$$\left[\left(-\frac{15661}{4} \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}} - \frac{3}{4}, 5537 \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}}\right)\right]$$

$$\left[\left(\frac{659}{4} \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}} - \frac{3}{4}, -233 \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}}\right)\right]$$

$$\left[\left(-\frac{3841}{4} \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}} - \frac{3}{4}, 1358 \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}}\right)\right]$$

$$\left[\left(\frac{19}{4} \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}} - \frac{3}{4}, -7 \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}}\right)\right]$$

$$\left[\left(-\frac{1}{4} \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}} - \frac{3}{4}, 2 \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}}\right)\right]$$

$$\left[\left(\frac{760499}{4} \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}} - \frac{3}{4}, -268877 \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}}\right)\right]$$

$$\left[\left(-\frac{1}{4} \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}} - \frac{3}{4}, -2 \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}}\right)\right]$$

$$\left[\left(-\frac{532013}{4} \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}} - \frac{3}{4}, 188095 \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}}\right)\right]$$

$$\left[\left(\frac{22387}{4} \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}} - \frac{3}{4}, -7915 \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}}\right)\right]$$

$$\left[\left(\frac{2687}{4} \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}} - \frac{3}{4}, -950 \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}}\right)\right]$$

$$\left[\left(-\frac{461}{4} \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}} - \frac{3}{4}, 163 \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}}\right)\right]$$

$$\left[\left(-\frac{113}{4} \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}} - \frac{3}{4}, 40 \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}}\right)\right]$$

$$\left[\left(-\frac{130481}{4} \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}} - \frac{3}{4}, 46132 \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}}\right)\right]$$

show us only integer expressions : terms in $\sqrt{2}$ cancel out (consider the parity of $\binom{t}{j}$ as a function of those of $t$ and $j$...) :

(End of EDIT)

One can note that Sympi's diophantine and Mathematica's Reduce give similar forms to their solutions, but Mathematica gives only 8 solutions, with different (and numerically simpler) constants, possibly by finding equalities among them and simplifying more efficiently.

Notwithstanding, HTH,

Well...

a,b,c = 2,3,5
x, k = var('x,k')
eq=a*x^2 + b*x + c - k^2==0
Sol=solve_diophantine(eq, (x, k))

We obtain a list of 16 solutions of similar form, the first one meaning :

$$ x=-\frac{1}{16} \, \sqrt{2} {\left({\left(470832 \, \sqrt{2} + 665857\right)}^{t} {\left(3841 \, \sqrt{2} + 5432\right)} + {\left(-470832 \, \sqrt{2} + 665857\right)}^{t} {\left(3841 \, \sqrt{2} - 5432\right)}\right)} - \frac{3}{4} $$

$$ k=\frac{1}{8} \, {\left(470832 \, \sqrt{2} + 665857\right)}^{t} {\left(3841 \, \sqrt{2} + 5432\right)} - \frac{1}{8} \, {\left(-470832 \, \sqrt{2} + 665857\right)}^{t} {\left(3841 \, \sqrt{2} - 5432\right)} $$

These solutions depend of a parameter $t$, a nonnegative integer. It turns out that, notwithstanding the presence of $\sqrt{2}$ , these expressions are integers. We can numerically check this for a not unreasonable range of $t$ :

sage: %time all([all(flatten([[u.subs(t==w).expand().is_integer() for u in v] for v in Sol])) for w in range(100)])
CPU times: user 6.16 s, sys: 80.2 ms, total: 6.24 s
Wall time: 6.24 s
True

Similarny, we can numerically check that these quantities are indeed solutions of eq on a not unreasonable range of $t$ :

sage: %time all([all([bool(eq.subs([x==u[0].subs(t==v), k==u[1].subs(t==v)]).expand()) for u in Sol]) for v in range(100)])
CPU times: user 9.01 s, sys: 88 ms, total: 9.1 s
Wall time: 9.1 s
True

A simple form of the explanation can be found somewhere in a Mathematica tutorial. A better-known analogy is the *casus irreducibilis" of the cubic, where a (demonstrably) real root can be expressed only as the sum of non-real complexes.

A better explanation, by someone who, contrary to me, knows what he's talking about when talking about Diophantine equations, would be extremely welcome...

EDIT :

sage: a,b,c = 2,3,5
sage: x, k = var('x,k')
sage: eq = a*x^2 + b*x + c - k^2 
sage: Sol = solve_diophantine(eq, (x, k))

We need to convert the powers of sums involving $\sqrt{2}$ in something more palatable. The binomial theorem (an 11th grade remembrance) will help us :

sage: C=var("c", n=3)
sage: W=tuple((SR.wild(u) for u in range(5)))
sage: BE=(sum(binomial(c2,j)*c0^j*c1^(c2-j),j,0,c2)==sum(binomial(c2,j)*c0^j*c1^(c2-j),j,0,c2,hold=True)).subs(dict(zip(C,W))); BE
($1 + $0)^$2 == sum($1^($2 - j)*$0^j*binomial($2, j), j, 0, $2)

Armed with this substitution tool, our solutions become :

sage: [tuple((u.subs(BE).expand().maxima_methods().sumcontract() for u in v)) for v in Sol])

$$\left[\left(\frac{91279}{4} \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}} - \frac{3}{4}, -32272 \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}}\right)\right]$$

$$\left[\left(\frac{79}{4} \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}} - \frac{3}{4}, -28 \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}}\right)\right]$$

$$\left[\left(-\frac{13}{4} \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}} - \frac{3}{4}, 5 \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}}\right)\right]$$

$$\left[\left(-\frac{15661}{4} \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}} - \frac{3}{4}, 5537 \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}}\right)\right]$$

$$\left[\left(\frac{659}{4} \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}} - \frac{3}{4}, -233 \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}}\right)\right]$$

$$\left[\left(-\frac{3841}{4} \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}} - \frac{3}{4}, 1358 \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}}\right)\right]$$

$$\left[\left(\frac{19}{4} \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}} - \frac{3}{4}, -7 \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}}\right)\right]$$

$$\left[\left(-\frac{1}{4} \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}} - \frac{3}{4}, 2 \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}}\right)\right]$$

$$\left[\left(\frac{760499}{4} \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}} - \frac{3}{4}, -268877 \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}}\right)\right]$$

$$\left[\left(-\frac{1}{4} \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}} - \frac{3}{4}, -2 \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}}\right)\right]$$

$$\left[\left(-\frac{532013}{4} \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}} - \frac{3}{4}, 188095 \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}}\right)\right]$$

$$\left[\left(\frac{22387}{4} \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}} - \frac{3}{4}, -7915 \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}}\right)\right]$$

$$\left[\left(\frac{2687}{4} \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}} - \frac{3}{4}, -950 \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}}\right)\right]$$

$$\left[\left(-\frac{461}{4} \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}} - \frac{3}{4}, 163 \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}}\right)\right]$$

$$\left[\left(-\frac{113}{4} \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}} - \frac{3}{4}, 40 \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}}\right)\right]$$

$$\left[\left(-\frac{130481}{4} \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}} - \frac{3}{4}, 46132 \, {\sum_{j=0}^{t} 665857^{j} 470832^{-j + t} 2^{-\frac{1}{2} \, j + \frac{1}{2} \, t} \binom{t}{j}}\right)\right]$$

show us only integer expressions : terms in $\sqrt{2}$ cancel out (consider the parity of $\binom{t}{j}$ as a function of those of $t$ and $j$...) :

To be rewritten...

(End of EDIT)

One can note that Sympi's diophantine and Mathematica's Reduce give similar forms to their solutions, but Mathematica gives only 8 solutions, with different (and numerically simpler) constants, possibly by finding equalities among them and simplifying more efficiently.

Notwithstanding, HTH,