# how to solve a quadratic diophanic equation on integers and obtain various results

This quadratic di equation has more results, as it came to them.

I can only think of this

FindInstance[(4 p + 3 q - 2) (p - 1) == (6 p + 2 q) q, {p,  q}, Integers]

• You can add a number at the end of FindInstance to request more solutions: FindInstance[(4 p + 3 q - 2) (p - 1) == (6 p + 2 q) q, {p, q}, PositiveIntegers, 2] Commented Jul 9, 2020 at 20:08

In version 12, assuming positive integers

sol1 = Solve[(4 p + 3 q - 2) (p - 1) == (6 p + 2 q) q, {p, q},
PositiveIntegers] // Simplify


For earlier versions with the same assumption,

sol2 = Solve[{(4 p + 3 q - 2) (p - 1) == (6 p + 2 q) q, p > 0, q > 0}, {p, q},
Integers] // Simplify


EDIT: Alternatively, set upper and lower bounds on p and q. For example,

sol3 = Solve[{(4 p + 3 q - 2) (p - 1) == (6 p + 2 q) q, -1000 < p <
1000, -1000 < q < 1000}, {p, q}, Integers]

(* {{p -> -143, q -> -123}, {p -> -143, q -> 336}, {p -> -76,
q -> -66}, {p -> -6, q -> 14}, {p -> -3, q -> -4}, {p -> -3,
q -> 7}, {p -> 0, q -> -2}, {p -> 1, q -> -3}, {p -> 1, q -> 0}, {p -> 5,
q -> -12}, {p -> 5, q -> 3}, {p -> 18, q -> 14}, {p -> 28,
q -> -66}, {p -> 105, q -> -247}, {p -> 105, q -> 88}, {p -> 621, q -> 527}} *)

• in sol1, says positive integers, why do they appear real too? Commented Jul 9, 2020 at 18:51
• Why do you think they are not integers? Look at specific values for C[1], for example, Table[sol1 /. C[1] -> c1, {c1, 1, 3}] // Simplify Commented Jul 9, 2020 at 18:58
• ,Sorry I didn't notice. Thanks Commented Jul 9, 2020 at 23:16