On this page
An equation like 3x + 5y = 47 is a linear Diophantine equation. It is named after the Greek mathematician Diophantus, who studied equations where only integer solutions are allowed. Deciding whether any given Diophantine equation can be solved was so profound that it later defined Julia Robinson and her road to Hilbert's tenth problem.
In a 2026 study published by MDPI, 39.8% of students identified linear Diophantine equations as the most difficult topic in number theory. The trouble usually lies in not having a structured way to find the answers. You do not need to guess endlessly; there is a reliable algorithm that will always work, much like Gabriel Cramer and the determinant rule of 1750 provided a firm algorithm for systems of linear equations.
When does a linear Diophantine equation have solutions?
Before you start looking for numbers, you need to know if an answer even exists. The rule is simple: an equation of the form ax + by = c has integer solutions if and only if the greatest common divisor (gcd) of a and b divides c exactly.
In our equation, 3x + 5y = 47, the coefficients are 3 and 5. The largest number that divides both 3 and 5 is 1. Since 1 divides 47 perfectly, we are guaranteed to find integer solutions. If the equation were 3x + 6y = 47, the gcd of 3 and 6 is 3. Because 47 is not divisible by 3, that equation would have no integer solutions at all.
If you have concept gaps around divisibility, the Fermi Concept Library has every concept in mathematics, each with its own lesson and its place in the map.
How to solve 3x plus 5y equals 47 in positive integers?
Once you know solutions exist, finding them takes two steps: locate one starting solution, and then use a pattern to list the rest.
Step 1: Find one working pair For smaller numbers, you can find a starting point by picking values for one variable and checking the other. Let us test values for y:
If y = 1, then 5y = 5. We need 3x = 47 − 5 = 42. Since 42 divided by 3 is 14, we have our first solution: x = 14, y = 1.
Step 2: Use the coefficients to find the rest Because x and y are locked together in the equation, increasing one means decreasing the other. Specifically, to keep the sum balanced, every time you add the y-coefficient (5) to x, you must subtract the x-coefficient (3) from y.
From our starting point of (14, 1):
Add 5 to x (14 + 5 = 19) and subtract 3 from y (1 − 3 = -2). The pair (19, -2) works, but we only want positive integers.
So, let us go the other way. Subtract 5 from x, and add 3 to y.
14 − 5 = 9, and 1 + 3 = 4. The pair (9, 4) is our second positive solution.
Subtract 5 again (9 − 5 = 4), and add 3 again (4 + 3 = 7). The pair (4, 7) is our third solution.
If we subtract 5 once more, x becomes -1, which is no longer positive.
The positive integer solutions are (14, 1), (9, 4) and (4, 7).
What do these solutions look like on a graph?
If you draw the line for 3x + 5y = 47 on a coordinate plane, it forms a continuous, unbroken straight line. However, because we are solving a Diophantine equation, we are not interested in every point on that line. We only care about the lattice points—the specific spots where the line crosses the grid at exact integer coordinates.
Our three positive solutions, (4, 7), (9, 4) and (14, 1), sit exactly on these grid intersections. Notice the spacing between them: to get from (4, 7) to (9, 4), you move right by 5 units along the x-axis and down by 3 units along the y-axis. This staircase pattern exactly matches the coefficients of our equation. The step size for x is always driven by the coefficient of y, and the step size for y is driven by the coefficient of x.
Understanding this geometric picture makes it easier to check your work. If your solutions are not evenly spaced, or if the step sizes do not match the reversed coefficients, you know immediately that a calculation error has slipped in somewhere.
How do you find all integer solutions?
If you need to list every possible integer solution (including negative numbers), you can write the pattern as a pair of formulas. If (x₀, y₀) is your starting solution, the general solution is:
x = x₀ + (b / gcd) × t
y = y₀ − (a / gcd) × t
For 3x + 5y = 47, we found x₀ = 14 and y₀ = 1. With a = 3, b = 5, and gcd = 1, the formulas become:
x = 14 + 5t
y = 1 − 3t
By substituting any integer for t (positive, negative or zero), you can generate an infinite list of valid points along the line. If you are ever stuck on a Diophantine problem and the formulas blur together, Fermi's AI tutor can write on a board to hold a line of reasoning across a session and help you find a clear next step instead of staring at a blank page.



