# Solve a system of equations mixing real and integer variables

I'm trying to solve a system of equations and inequalities with 5 variables but one of them is real, and the other 4 are integer. How could I tell this to Mathematica? I tried using FindInstance[eq && eq && ineq && ineq && eq, {a, b, c, d, e}, Integers] but I don't know how to specify, let's say, e is a real variable.

My particular case is this set of equations:

$$\frac{a(a+1) + b^2(c-1)}{d(d+1) + e^2(c-1)} = 1$$, $$|b|\leq a$$, $$|e| \leq d$$, $$a>0$$, $$d>0$$, $$c > 0$$,

where all variables are integers except from $$c$$ which is real.

Could you give me some hints?

Thak you!

• It is unclear what are you ask about. Do you want to solve this problem in general or in your particularly case? Apr 10, 2020 at 13:57
• I'd like to solve it in my particular case (which I'll write now in my question), but I'm curious about whether there exists or not a way with whch solving it is easy Apr 10, 2020 at 14:53
• See my answer with hints. Apr 10, 2020 at 15:28

Hints

Solve[a (a + 1) + b^2 (c - 1) == d (d + 1) + e^2 (c - 1), c]

Out[1]= {{c -> (-a - a^2 + b^2 + d + d^2 - e^2)/(b^2 - e^2)}}

FindInstance[
Abs[b] <= a && Abs[e] <= d && d > 0 &&
a > 0 && (-a - a^2 + b^2 + d + d^2 - e^2)/(b^2 - e^2) > 0, {a, b, d,
e}, Integers]

Out[4]= {{a -> 8, b -> -2, d -> 8, e -> -4}}


Calculate c

 (-a - a^2 + b^2 + d + d^2 - e^2)/(b^2 - e^2) /. First[%]

Out[5]= 1

• Thank you!!! I'll work on that. Thank you very much Apr 10, 2020 at 16:08
• @Patrick You are welcome! Apr 10, 2020 at 16:22