4
$\begingroup$

I am trying to find three numbers a, b, c so that the equation $(x+a)^4 + (x+b)^4 = c$ have four integer solutions. I tried

f[x_] := (x + a)^4 + (x + b)^4 - c
Eliminate[{f[x] == 0 // PowerExpand, x + (a + b)/2 == t}, x] // FullSimplify

(a - b)^4 + 24 (a - b)^2 t^2 + 16 t^4 == 8 c

And then, I solve

Solve[(a - b)^4 + 24 (a - b)^2 t^2 + 16 t^4 - 8 c == 0, t] // FullSimplify

{{t -> -(1/2) Sqrt[-3 (a - b)^2 - 2 Sqrt[2] Sqrt[(a - b)^4 + c]]}, {t -> 1/2 Sqrt[-3 (a - b)^2 - 2 Sqrt[2] Sqrt[(a - b)^4 + c]]}, {t -> -(1/ 2) Sqrt[-3 (a - b)^2 + 2 Sqrt[2] Sqrt[(a - b)^4 + c]]}, {t -> 1/2 Sqrt[-3 (a - b)^2 + 2 Sqrt[2] Sqrt[(a - b)^4 + c]]}}

Now I put

r1 = -(1/2) Sqrt[-3 (a - b)^2 - 2 Sqrt[2] Sqrt[(a - b)^4 + c]] - (a + b)/2;
r2 = 1/2 Sqrt[-3 (a - b)^2 - 2 Sqrt[2] Sqrt[(a - b)^4 + c]] - (a + b)/
   2;
r3 = -(1/2) Sqrt[-3 (a - b)^2 + 
    2 Sqrt[2] Sqrt[(a - b)^4 + c]] - (a + b)/2;
r4 = 1/2 Sqrt[-3 (a - b)^2 + 2 Sqrt[2] Sqrt[(a - b)^4 + c]] - (a + b)/
   2;
$\endgroup$
4
  • $\begingroup$ This sequence is of relevance oeis.org/A003824 $\endgroup$
    – yarchik
    Jun 11, 2023 at 14:47
  • $\begingroup$ Do $a$, $b$, and $c$ have to be real? Positive? Integers? All of the above? $\endgroup$ Jun 12, 2023 at 20:02
  • $\begingroup$ Also note that the first two of your solutions for $t$ are pretty obviously going to be complex numbers if $a$, $b$, and $c$ are real. If that's the case there's no way that you're going to get four distinct integer solutions. $\endgroup$ Jun 12, 2023 at 20:06
  • 1
    $\begingroup$ Another way to see this is that if you define $f(x) = (x+a)^4 + (x+b)^4 - c$, then $f''(x) = 12(x+a)^2 + 12(x+b)^2 \geq 0$. This means that the graph is concave up everywhere, and so $f(x)$ cannot have more than two real roots. $\endgroup$ Jun 12, 2023 at 20:20

3 Answers 3

2
$\begingroup$

Your equation has a maximum of two real solutions, so having four integer solutions is out of the question:

Solve[f[x]==0, x, Reals]  

{{x -> ConditionalExpression[
         Root[ (* original polynomial *), 1], 
         a^4 - 4 a^3 b + 6 a^2 b^2 - 4 a b^3 + b^4 - 8 c < 0]},
 {x -> ConditionalExpression[
         Root[ (* original polynomial *), 2], 
         a^4 - 4 a^3 b + 6 a^2 b^2 - 4 a b^3 + b^4 - 8 c < 0]}}

In other words, there are two real roots if $(a-b)^4 - 8 c < 0$, and no real roots otherwise.

To see why this is using high-school algebra techniques, apply the transformation $x = \sqrt{u}-\frac12(a+b)$:

FullSimplify[Expand[f[x] /. {x -> Sqrt[u] - (a + b)/2}]]

(* 1/8 (a - b)^4 - c + 3 (a - b)^2 u + 2 u^2 *)

Each of the two roots $u_\pm$ of this polynomial will correspond to two roots of the original polynomial. If we want real roots for $x$, then both the roots for $u$ must be real and positive. But the sum of the roots of this latter polynomial is $-3(a-b)^2/2 < 0$. So at least one solution for $u$ must be negative, meaning that there is at most one positive root for $u$ and therefore at most two real roots for $x$.

We can ensure that the other $u$ root is positive by noting that the product of the roots of the quadratic polynomial is $(\frac18(a - b)^4 - c)/2$. Since one root is negative, and we want the other root to be positive, this quantity must be negative.

$\endgroup$
1
$\begingroup$

Try

solx = Values@Solve[(x + a)^4 + (x + b)^4 - c == 0, x] // Flatten
cond=Reduce[Element[solx,Integers],{a,b,c},Reals]

enter image description here

Forcing the last two conditions we find

cond /. c -> -a^4 + 4 a^3 b - 6 a^2 b^2 + 4 a b^3 - b^4 /. b -> a
(*(a | a | a | a) \[Element] Integers*)    

solution a=b=integer,c=0

$\endgroup$
2
  • $\begingroup$ I would interpret the original question as seeking 4 different integer roots, not a single root repeated 4 times (which I think you have). $\endgroup$
    – mikado
    Jun 11, 2023 at 17:05
  • 1
    $\begingroup$ Agrred, but result of my evaluation gives 4 identical roots. $\endgroup$ Jun 11, 2023 at 17:53
1
$\begingroup$

We can solve $(x+a)^4 + (x+b)^4 = c$ for integer values. The result is a ConditionalExpression with one integer constant.

Clear[a,b,c,x]
sol = First[Solve[(x+a)^4 + (x+b)^4 == c, x, Integers]];
{x -> ConditionalExpression[C[1],
  Element[a, Integers] && Element[b, Integers] &&
  Element[C[1], Integers] &&
  c == a^4 + b^4 + 4*a^3*C[1] + 4*b^3*C[1] + 6*a^2*C[1]^2 +
  6*b^2*C[1]^2 + 4*a*C[1]^3 + 4*b*C[1]^3 + 2*C[1]^4]}

Let's use sol to find values for x, a, b, and c.

TableForm[With[{xx = 1}, (* x, a, and b are any integers *)
  Flatten[Table[{xx, i, j, (x/.sol/.{a->i, b->j, C[1]->xx})[[2,2]]},
    {i, -2, 2}, {j, -2, 2}], 1]],
TableHeadings->{None,{"x","a","b","c"}}]
x a b c
1 -2 -2 2
1 -2 -1 1
1 -2 0 2
...
1 2 0 82
1 2 1 97
1 2 2 162

Another way to see the results is to compute c from values of a and b and plot the result.

ListPlot3D[Flatten[
  Table[{i, j, (x/.sol/.{a->i, b->j, C[1]->1})[[2,2]]},
    {i, -10, 10}, {j, -10, 10}], 1],
  PlotRange -> All, AxesLabel -> {a,b}, BaseStyle -> {Bold, 14}]

3D plot

We can make a list of random solutions.

SeedRandom[1357];
numSamples = 5;
TableForm[
Sort@Flatten[Last[Reap[Do[
  Sow[{xx, a, b, Last[(x/.sol)/.C[1]->xx/.Equal->List][[-1, -1]]}/.
    {a->#1, b->#2, xx->#3}&@@RandomInteger[{-9, 9}, 3]],numSamples]]], 1],
TableHeadings->{None,{"x", "a", "b", "c"}}]
x a b c
-9 9 -3 20736
-7 -4 -1 18737
-2 -1 5 162
2 3 2 881
9 -5 0 6817

Check that x, a, b, and c are a valid solution.

checkTrueQ[{x_, a_, b_, c_}] := (x + a)^4 + (x + b)^4==c
checkTrueQ[{-9, 9, -3, 20736}]
(*True*)
$\endgroup$
2
  • $\begingroup$ If I'm reading your code correctly you've found a way to generate values of $a$, $b$, and $c$ so that the equations $(x+a)^4 + (x+b)^4 = c$ has one integer solution. But the OP wanted this equation to have four (presumably distinct) integer solutions. $\endgroup$ Jun 12, 2023 at 19:55
  • $\begingroup$ @MichaelSeifert Yes, that's what I've done. That's how I understand John's question. I see that your answer says there can't be four simultaneous solutions. Maybe John will explain his goal. $\endgroup$
    – creidhne
    Jun 13, 2023 at 0:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.