MethodMath

How to find the number of solutions to a linear Diophantine equation?

I am studying number theory and I need to understand Diophantine equations — equations where only integer solutions are allowed.

Consider: 3x+5y=173x + 5y = 17

  1. How do I determine if integer solutions exist?
  2. If they exist, how do I find all solutions?
  3. How do I restrict to non-negative solutions?
  4. What is the general method for solving ax+by=cax + by = c where a,b,cZa, b, c \in \mathbb{Z}?

I know the condition involves gcd(a,b)c\gcd(a,b) \mid c, but I need the full solution method with an example.

1 answers87 views
Loading comments...

1 Answer

Dr. Ethan Caldwell
Dr. Ethan CaldwellApr 9, 2026 Accepted
**Theorem:** The linear Diophantine equation $ax + by = c$ has integer solutions iff $\gcd(a, b) \mid c$. **General Solution Method:** 1. Compute $g = \gcd(a, b)$. If $g \ mid c$, no solutions. 2. Find one particular solution $(x_0, y_0)$ using the Extended Euclidean Algorithm. 3. All solutions are given by: $$x = x_0 + \frac{b}{g} \cdot t, \quad y = y_0 - \frac{a}{g} \cdot t, \quad t \in \mathbb{Z}$$ **Example: $3x + 5y = 17$** **Step 1:** $\gcd(3, 5) = 1$, and $1 \mid 17$, so solutions exist. **Step 2:** Find a particular solution. By inspection, $3(4) + 5(1) = 12 + 5 = 17$, so $(x_0, y_0) = (4, 1)$. **Step 3:** General solution: $$x = 4 + 5t, \quad y = 1 - 3t, \quad t \in \mathbb{Z}$$ **Non-negative solutions:** Require $x \geq 0$ and $y \geq 0$: $$4 + 5t \geq 0 \Rightarrow t \geq -0.8 \Rightarrow t \geq 0$$ $$1 - 3t \geq 0 \Rightarrow t \leq 1/3 \Rightarrow t \leq 0$$ So $t = 0$ only, giving $(x, y) = (4, 1)$ as the unique non-negative solution. **Systematic finding of particular solution via Extended Euclidean Algorithm:** $5 = 1 \cdot 3 + 2$, $3 = 1 \cdot 2 + 1$. Back-substitute: $1 = 3 - 1(2) = 3 - 1(5 - 1(3)) = 2(3) - 1(5)$. Multiply by 17: $17 = 34(3) - 17(5)$, so $3(34) + 5(-17) = 17$, giving $(x_0, y_0) = (34, -17)$, and the general solution $x = 34 + 5t, y = -17 - 3t$, which is equivalent to $(4, 1)$ with $t = -6$.
Loading comments...
Login or Register to post an answer