PDF download Download Article PDF download Download Article

Solving a linear Diophantine equation means that you need to find solutions for the variables x and y that are integers only. Finding integral solutions is more difficult than a standard solution and requires an ordered pattern of steps. You must first find the greatest common factor of the coefficients in the problem, and then use that result to find a solution. If you can find one integral solution to a linear equation, you can apply a simple pattern to find infinitely many more.

Part 1
Part 1 of 4:

Setting up the Equation

PDF download Download Article
  1. A linear equation is one that has no exponents greater than 1 on any variables. To solve a linear equation in this style, you need to begin by writing it in what is called “standard form.” The standard form of a linear equation looks like , where and are integers. [1]
    • If the equation is not already in standard form, you need to use the basic rules of algebra to rearrange or combine the terms to create the standard form. For example, if you begin with , you can combine similar terms to reduce the equation to .
  2. When the equation is in standard form, check all three terms and . If there is a common factor in all three terms, then reduce the equation by dividing all terms by that factor. If you reduce evenly across all three terms, then any solution you find for the reduced equation will also be a solution for the original equation. [2]
    • For example, if all three terms are even, you can at least divide by 2, as follows:
      • (all terms are divisible by 2)
      • (all terms now are divisible by 3)
      • (this equation is as reduced as possible)
    Advertisement
  3. In some cases, you may be able to tell immediately if there is no solution to your problem. If you see a common factor on the left side of the equation that is not shared on the right side, then there can be no solution to the problem. [3]
    • For example, if both and are even, then the sum of the left side of the equation would have to be even. But if is odd, then there will be no integer solution to the problem.
      • will have no integer solution.
      • can have no integer solution, because the left side of the equation is divisible by 5, but the right side is not.
  4. Advertisement
Part 2
Part 2 of 4:

Using the Euclidean Algorithm

PDF download Download Article
  1. The Euclidean algorithm is a system of repeated divisions, using the remainder each time as the divisor of a new division. The last divisor that divides evenly is the greatest common factor (GCF) of the two numbers. [4]
    • For example, the following steps illustrate the Euclidean algorithm being used to find the GCF of 272 and 36:
      • ....divide the larger number (272) by the smaller (36) and note the remainder (20)
      • ....divide the previous divisor (36) by the previous remainder (20). Note the new remainder (16).
      • ....Repeat. Divide the previous divisor (20) by the previous remainder (16). Note the new remainder (4).
      • ....Repeat. Divide the previous divisor (16) by the previous remainder (4). Since the remainder is now 0, conclude that 4 is the GCF of the original two numbers 272 and 36.
  2. With your linear equation in standard form, identify the coefficients A and B. Apply the Euclidean algorithm to find their GCF. Suppose you need to find integral solutions for the linear equation . [5]
    • The steps of the Euclidean algorithm for the coefficients 87 and 64 are as follows:
  3. Because the Euclidean algorithm for this pair continues all the way down to dividing by 1, the GCF between 87 and 64 is 1. This is another way of saying that 87 and 64 are relatively prime. [6]
  4. When you complete the Euclidean algorithm to find the GCF of and , you need to compare that result with the number of the original equation. If the greatest common factor of and is a number that can divide into , then your linear equation will have an integral solution. If not, then there will be no solution. [7]
    • For example, the sample problem will have an integral solution, since the GCF of 1 can be evenly divided into 3.
    • Suppose, for example, that the GCF had worked out to be 5. The divisor 5 cannot go evenly into 3. In that case, the equation would have no integral solutions.
    • As you will see below, if an equation has one integral solution, then it also has infinitely many integral solutions.
  5. Advertisement
Part 3
Part 3 of 4:

Renaming the GCF to find the Solution

PDF download Download Article
  1. To find the solution of the linear equation, you will use your work on the Euclidean algorithm as the basis for a repeated process of renaming and simplifying values. [8]
    • Begin by numbering the steps of the Euclidean algorithm reduction, as reference points. Thus, you have the following steps:
  2. Rewrite that equation so the remainder stands alone, as equal to the rest of the information in the equation. [9]
    • For this problem, Step 6 is the last one that showed a remainder. That remainder was 1. Rewrite the equation in Step 6 as follows:
  3. This procedure is a step-by-step process of moving “up” the steps. Each time, you will be revising the right side of the equation in terms of the numbers in the higher step. [10]
    • You can revise Step 5 to isolate its remainder as:
      • or
  4. You should notice that your revision of Step 6 contains the number 2, and your revision of Step 5 is equal to 2. Substitute the equality in Step 5 into the place of the 2 in your Step 6 revision: [11]
    • ….. (This is the Step 6 revision.)
    • ….. (Substitute in place of the value 2.)
    • ….. (Distribution of the negative sign)
    • …..(Simplify)
  5. Moving through the Euclidean algorithm steps in reverse, repeat the process. Each time, you will revise the previous step, and substitute its value into your latest result. [12]
    • The last step was Step 5. Now revise Step 4 to isolate its remainder as:
    • Substitute that value in place of the 3 in your latest simplification step and then simplify:
  6. This process will repeat, step by step, until you reach the original step of the Euclidean algorithm. The purpose of this procedure is to wind up with an equation that will be written in terms of 87 and 64, which are the original coefficients of the problem you are trying to solve. Continuing in this manner, the remaining steps are as follows: [13]
    • …..(Substitution from Step 3)
    • …..(Substitution from Step 2)
    • …..(Substitution from Step 1)
  7. When you return to the first step of the Euclidean algorithm, you should notice that the resulting equation contains the two coefficients of the original problem. Rearrange the numbers so they align with the original equation. [14]
    • In this case, the original problem you are trying to solve is . Thus, you can rearrange your last step to put the terms in that standard order. Pay particular attention to the 64 term. In the original problem, that term is subtracted, but the Euclidean algorithm treats it as a positive term. To account for the subtraction, you need to change the multiplier 34 to a negative. The final equation looks like this:
  8. Notice that the greatest common divisor for this problem was 1, so the solution that you reached is equal to 1. However, that is not the solution to the problem, since the original problem sets 87x-64y equal to 3. You need to multiply the terms of your last equation by 3 to get a solution: [15]
  9. The values that must be multiplied by the coefficients are the x and y solutions to the equation.
    • In this case, you can identify the solution as the coordinate pair .
  10. Advertisement
Part 4
Part 4 of 4:

Finding Infinitely Many More Solutions

PDF download Download Article
  1. If a linear equation has one integral solution, then it must have infinitely many integral solutions. Here is a brief algebraic statement of the proof: [16]
    • ….. (Adding a B to x while subtracting A from y results in the same solution.)
  2. The pattern of infinite solutions begins with the single solution that you identified. [17]
    • In this case, your solution is the coordinate pair .
  3. To find a new solution for x, add the value of the coefficient of y. [18]
    • In this problem, beginning with the solution x=-75, add the y coefficient of -64, as follows:
    • Thus, a new solution for the original equation will have the x value of -139.
  4. To make the equation remain balanced, when you add to the x term, you must then subtract from the y term.
    • For this problem, beginning with the solution y=-102, subtract the x coefficient of 87, as follows:
    • Thus, a new solution for the original equation will have the y coordinate of -189.
    • The new ordered pair should be .
  5. To verify that your new ordered pair is a solution to the equation, insert the values into the equation and see if it works. [19]
    • Because the statement is true, the solution works.
  6. The values for x will fit a pattern of the original solution, plus any multiple of the B coefficient. You can write this algebraically as follows: [20]
    • x(k)=x+k(B), where x(k) represents the series of all x solutions, and x is the original x value that you solved.
      • For this problem, you can say:
    • y(k)=y-k(A), where y(k) represents the series of all y solutions, and y is the original y value that you solved.
      • For this problem, you can say:
  7. Advertisement

Community Q&A

Search
Add New Question
  • Question
    How do you solve the linear congruence of 28x=38(mod42)?
    Community Answer
    Introduce a second variable to convert the modular equation to an equivalent diophantine equarion. So 28x = 38 + 42y for some integers x and y. Simplify to 14 (2x - 3y) = 38. But 2x - 3y is an integer. The left side is always a multiple of 14, but 38 is not. So that equation has no solutions mod 42.
  • Question
    Are all equations with integral coefficients diophantine equations?
    Community Answer
    No. Both ordinary and diophantine equations can have any type of integer or non-integer coefficients. Diophantine-ness refers to the domain of the variable(s) - it's those that have to be integers.
  • Question
    How do I find solutions to word problems involving linear Diophantine equations?
    Community Answer
    Figure out what the question is asking. Cross out any irrelevant information, then put all the values into your equation.
Ask a Question
      Advertisement

      Tips

      Submit a Tip
      All tip submissions are carefully reviewed before being published
      Thanks for submitting a tip for review!

      About This Article

      Thanks to all authors for creating a page that has been read 248,086 times.

      Reader Success Stories

      • Precious O.

        Oct 16, 2023

        "I've just got what I was looking for, thanks to wikiHow, I appreciate a thousand times!"
      Share your story

      Did this article help you?

      Advertisement