The result we get is correct and one shouldn't expect it in a different form since there are infinitely many solutions and there is no way to enumerate them all. That's why Mathematica
returns the result in a symbolic way. This issue appears a bit more obviously when one looks for all solutions in special subclasses, e.g. solutions of this form :
a == 3k, b == 4k, c == 5k
for k < 20 && k ∈ Integers
, e.g. k == -10^100000
. We have to use Reduce
instead of Solve
in this case :
Reduce[(3 k)^2 + (4 k)^2 == (5 k)^2 && k < 20, k, Integers]
k ∈ Integers && k <= 19
There are infinitely many solutions, however if we add a lower bound for k
we'll get
a finite numbers of explicit solutions :
Reduce[(3 k)^2 + (4 k)^2 == (5 k)^2 && 15 < k < 20, k, Integers]
k == 16 || k == 17 || k == 18 || k == 19
Let's visualize an interesting part of the solution space to the general problem :
pts = Solve[{ a^2 + b^2 == c^2,
-300 < a < 100, -300 < b < 100, -300 < c < 100}, {a, b, c}, Integers];
Length[pts]
2345
Show[ ContourPlot3D[ x^2 + y^2 == z^2, {x, -300, 100}, {y, -300, 100}, {z, -300, 100},
ContourStyle -> Directive[Orange, Opacity[0.3], Specularity[White, 20]],
MeshFunctions -> {#3 &}, Mesh -> 7, PlotPoints -> 100],
ListPointPlot3D[ {a, b, c} /. pts, PlotStyle -> Directive[Darker@Red, PointSize[0.004]]]]
These cones (the upper and a part of the lower) denote all real solutions whereas the red points denote all integer sloutions of the sytem : { a^2 + b^2 == c^2,
-300 < a < 100, -300 < b < 100, -300 < c < 100}
One might be also interested in integer solutions modulo 100
to find all solutions of this type : a^2 + b^2 == c^2 + 100 k
for k ∈ Integers
(i.e. solutions satisfy 0 <= a < 100, 0 <= b < 100, 0 <= c < 100
), there are many more such solutions ( i.e. 17400
) :
Solve[ a^2 + b^2 == c^2, {a, b, c}, Modulus -> 100] // Short[#, 2] &
{{a -> 0, b -> 0, c -> 0}, {a -> 0, b -> 0, c -> 10}, {a -> 0, b -> 0, c -> 20},
{a -> 0, b -> 0, c -> 30}, <<17393>>, {a -> 99, b -> 90, c -> 49},
{a -> 99, b -> 90, c -> 51}, {a -> 99, b -> 90, c -> 99}}