-1

I would like to solve a first degree equation with multiple variables (not a system of equations) like :

10x + 5y + 7z = 630

Is there any way to solve it without using bruteforce?

Solutions must be integers.

anatolyg
  • 26,506
  • 9
  • 60
  • 134
kore
  • 9

2 Answers2

1

Regroup the first two terms as 10x+5y = 5(2x+y) = 5t.

Then t/7 + z/5 = 18.

As 5 and 7 are relative primes, t = 7k and z = 5(18-k), where k is abritrary.

Finally, y = t - 2x = 7k - 2x, where x is arbitrary.

As we can check,

10 x + 5 (7k - 2x) + 7 5 (18-k) = 630.

  • I am not sure this procedure is applicable to any equation of the sort described by OP. I think it assumes that the coefficient of x is divisible by the coefficient of y, which is quite a limitation. I guess it can be improved. – anatolyg Jul 19 '17 at 12:32
  • @anatolyg: haha, you spotted the shortcut ! –  Jul 19 '17 at 12:36
-1

No you can't, you have an infinity of solutions in this case.

To solve such problem you shoud have a system with at least the same number of equations as the number of variables.

Another trick, in some cases you could solve it as an underdetermined system.

Sridi.ENSI
  • 17
  • 5
  • "Solve" doesn't mean "find the unique solution" here or most anywhere in mathematics. Actually, only OP knows what he means by "solve". It could mean "find any solution", "find all solutions", "find the 'smallest' solution", etc. – anatolyg Jul 19 '17 at 11:47
  • Yes, not necessarily a unique solution. – kore Jul 19 '17 at 11:59
  • I know "solve" doesn't mean find the unique solution. Solve means find a solution which satisfy the equations, so it could be reals, intervals (could be all reals) or even the void. I already said "you have an infinity of solutions", but what in understood from his question that he is looking for a unique solution. – Sridi.ENSI Jul 19 '17 at 12:03