Suppose I want x
and y
to be rationals
Solve[ x^2 + y^2 == 1, {x, y}, Rationals]
I am told:
Solve::svars: Equations may not give solutions for all "solve" variables.
and given a "solution"
{{y -> ConditionalExpression[-Sqrt[ 1 - x^2], (x | y) ∈ Rationals && -1 <= x <= 1]}, {y -> ConditionalExpression[ Sqrt[ 1 - x^2], (x | y) ∈ Rationals && -1 <= x <= 1]}}
Try Reduce
Reduce[ x^2 + y^2 == 1, {x, y}, Rationals]
Mathematica
returns
(x | y) ∈ Rationals && -1 <= x <= 1 && (y == -Sqrt[1 - x^2] || y == Sqrt[1 - x^2])
Not much more help. Next try to see what Mathematica
can do make a list of solutions:
FindInstance[ x^2 + y^2 == 1, {x, y}, Rationals, 10]
I am told that:
FindInstance::fwsol: Warning: FindInstance found only 2 instance(s), but it was not able to prove 10 instances do not exist.
and given the two solutions found
{{x -> -1, y -> 0}, {x -> 1, y -> 0}}
Mathematica did not help too much here - but does show me that at least some solutions exist and that there may be more.
- Is this all I am going to get out of
Mathematica
in this case? - Is this an answer that a mathematican wants to know and
Mathematica
has done its work? - If I better understood
Mathematica
, could I use its other functions on the solution fromSolve
orReduce
to help me learn more about the solutions? (or do I just have to get my hands dirty and do the work myself - in this example it is pretty easy to find the general solution by hand) - And maybe more generally, which
Mathematica
functions are able to do something more with this type of output fromSolve
orReduce
? (e.g. can I plot it?)
Union@(Abs @ {x/y, z/w} /. FindInstance[(x/y)^2 + (z/w)^2 == 1 && 1 < x < 100 && x != y != z != w != 0, {x, y, z, w}, Integers, 10])
$\endgroup$