# How to find an integer solution?

Given:

3*(c^3 - c^2*b - c*a^2 + a^2*b) ==
a^3 + b^3 + c^3 + 3*(a + b + c)*(a b + a c + b c) - 3 a b c


Need to solve for all three variables as integers. Problem is to find one solution where all variables are positive.

• please review my edit. Some of your formatting of the formula made it unclear and I'm not sure that I got it completely right. Jan 27, 2019 at 9:56
• @carl lange Gostei muito do seu canal no YouTube Jan 27, 2019 at 11:19
• @LCarvalho Obrigado pelas suas palavras gentis!! Jan 27, 2019 at 15:14

Use FindInstance.

f = 3*(c^3 - c^2 b - c a^2 + a^2 b) ==
a^3 + b^3 + c^3 + 3*(a + b + c)*(a b + a c + b c) - (3 a b c)

FindInstance[f, {a, b, c}, Integers, 3]


{{a -> -130, b -> -130, c -> 65}, {a -> -1, b -> 0, c -> 1}, {a -> 1, b -> 0, c -> -1}}

We can test the solutions out:

f /. {a -> -130, b -> -130, c -> 65}


True

• Nice work! Do you think it would be possible to have all variables positive? I meant to add this to the question/will edit.
– Dale
Jan 27, 2019 at 14:08
• – Dale
Jan 27, 2019 at 14:14
• @Dale Yes, simply add the extra constraints to the first argument in FindInstance: FindInstance[{f, a > 0, b > 0, c > 0}, {a, b, c}, Integers, 1] However, in this case it does not appear that a solution exists. Jan 27, 2019 at 15:13