# उपसूत्र १६. द्वन्द्वयोग

## (Upasūtra 16. dvaṅdvayoga) - Sum of pairs.

The Upasūtra: dvaṅdvayoga (Sum of pairs) is used for finding squares (x2) and cubes (x3) of a number. It is also referred as the 'Duplex Methods'. And, its popular techniques are sometimes also referred as Straight-Squaring and Straight-Cubing, because with some practice, a practitioner of Vedic Mathematics can reach 'straight' to the calculated figure - without any intermediate steps (which means the intermediate steps are executed mentally).

Squaring a number using Upasūtra 16. dvaṅdvayoga:
As an illustration, let us use this Upasūtra for:
622
 Steps 622 1. Pair the digits, from right to left - in ascending order; and then, from left to right in descending order. In this case, the pairs are {2},{62},{6}Pairs are obtained by including one digit at a time from right to left (ascending), and then again excluding one digit at a time from left to right (descending) 2. Find duplexes for each of the pairs. In this case, the Duplexes are 4, 24, 36(Calculating a Duplex is explained below) 3. Sum the duplexes by setting-up one zero at a time, by simple carry over method. In this case, 4 + 240 + 3600 = 3844, which is the answer!
Obviously, we need to understand Duplex before moving ahead. A Duplex is cross-product of the digits, in the following rule:
 For n-digit number, the Duplex is: 1. For even-number of digits: Sum of twice the digits, that are equidistant from the ends, multiplied. 2. For odd-number of digits: Sum of twice the digits, that are equidistant from the ends, multiplied - summed with central-digit multiplied with itself, that is squared.  Then, for a single-digit number (m), Duplex is m2 For a double-digit number (mn), Duplex is 2(m × n) For a 3-digit number (mno), Duplex is 2(m × n) + o2 For a 4-digit number (mnop), Duplex is 2(m × p) + 2(n × o) For a 5-digit number (mnopq), Duplex is 2(m × q) + 2(n × p) + o2And so on.  As examples, Duplex of 3 is 32 = 9 Duplex of 6 is 62 = 36 Duplex of 23 is 2(2 × 3) = 2 × 6 = 12 Duplex of 64 is 2(6 × 4) = 2 × 24 = 48 Duplex of 128 is 2(1 × 8) + 22 = 16 + 4 = 20 Duplex of 305 is 2(3 × 5) + 02 = 30 + 0 = 30 Duplex of 4231 is 2(4 × 1) + 2(2 × 3) = 8 + 12 = 20 Duplex of 7346 is 2(7 × 6) + 2(3 × 4) = 84 + 24 = 108  Note: That the Duplex of two numbers can be the same (like 128 and 4231 above), especially for similar numbers (like 23 and 32).
So, for a practitioner of Vedic Mathematics, for something like:
2342
 Note that the pairs are {4}, {34}, {234}, {23}, {2} Duplex of 4 is 16 Duplex of 34 is 24, set-up one zero to 240 Duplex of 234 is 16 + 9 = 25, set-up two zeroes to 2500 Duplex of 23 is 12, set-up three zeroes to 12,000 Duplex of 2 is 4, set-up four zeroes to 4,0000  Sum of Duplexes =      16     240    2500   12000 + 40000 --------   54756  Thus, 2342 = 54,756

The pairs can be identified, and their duplexes calculated mentally, with some practice. And since, at each stage, the trailing zeroes increase by one digit, the calculated number may be written from right-to-left - executing the summations on the go. Not that we advice it, but practitioners of Vedic Mathematics find the steps so simple, with some practice, that they tend to execute all the steps - within a few seconds. Taking it ahead, for something like:
14262
 Note that the pairs are {6}, {26}, {426}, {1426}, {142}, {14}, {1} Duplex of 6 is 36 Duplex of 26 is 24, set-up one zero to 240 Duplex of 426 is 48 + 4 = 52, set-up two zeroes to 5200 Duplex of 1426 is 12 + 16 = 28, set-up three zeroes to 28,000 Duplex of 142 is 4 + 16 = 20, set-up four zeroes to 20,0000 Duplex of 14 is 8, set-up five zeroes to 8,00000 Duplex of 1 is 1, set-up six zeroes to 1,000000  Sum of Duplexes =        36       240      5200     28000    200000    800000 + 1000000 ----------   2033476  Thus, 14262 = 2,033,476  Note that, the professional approach is to write the answer from right to left, without adding the Zeroes - summing the Duplexes on the go: Step 1: 36; 6 (carry 3) Step 2: 3 + 24 = 27; 7 (carry 2) Step 3: 2 + 52 = 54; 4 (carry 5) Step 4: 5 + 28 = 33; 3 (carry 3) Step 5: 3 + 20 = 23; 3 (carry 2) Step 6: 2 + 8 = 10; 0 (carry 1) Step 7: 1 + 1 = 2 Hence, 2033476
One can take any (n-digit) number and iterate the steps above to obtain the desired calculated value. For starters, it is advisable to identify the pairs, calculate each Duplex and write them in rows to easily sum the Duplexes.

But, why does it work? For this Upasūtra (dvaṅdvayoga), let us consider the following:
 Assuming a two-digit number, mn, then N = 10m + n As in example above, 62 = 60 + 2 Now, N2 = (10m + n)2 = 100m2 + 2(10mn) + n2 = 100(m2) + 10(2mn) + n2 This is exactly what this Upasūtra makes us do: 622 = (100 × 36) + (10 × 24) + 4 = 3844  Assuming a 3-digit number, mno, then N = 100m + 10n + o As in example above, 234 = 200 + 30 + 4 Now, N2 = (100m + 10n + o)2 = ((100m + 10n) + o)2 = (100m + 10n)2 + 2((100m + 10n) × o) + o2 = [10000m2 + 2(100m × 10n) + 100n2] + [2(100mo) + 2(10no)] + o2 = [10000(m2) + 1000(2mn) + 100(n2)] + [100(2mo) + 10(2no)] + o2 = 10000(m2) + 1000(2mn) + 100((2mo) + n2) + 10(2no) + o2 This is exactly what this Upasūtra makes us do: 2342 = (10000 × 4) + (1000 × 12) + (100 × 25) + (10 × 24) + 16 = 54756  Note that, as the number of digits increase - so does the number of steps that this Upasūtra makes us perform - in the same pattern as above.

Cubing a number using Upasūtra 16. dvaṅdvayoga:
As an illustration, let us use this Upasūtra for:
143
 Steps 143 1. Find the ratio of the two digits. In this case, the Ratio is 1:4 2. Pair 4 terms, the first being the cube of 1st digit, and the remaining terms as Geometric Progression as the Ratio. In this case, {1},{4},{16},{64}As above, 13 = 1, and 1 × 4 = 4; 4 × 4 = 16; 16 × 4 = 64 3. Pair 4 more terms, with 2nd and 3rd terms being the double of the original values. The others being set-up to zero. In this case, it is {0},{8},{32},{0} 4. Sum the terms, by simple carry over method. In this case, {1 + 0},{4 + 8},{16 + 32},{64 + 0}= 2744, which is the answer!Note:   [1,4,16,64] + [0,8,32, 0] -------------- Step 1: 64 + 0 = 64; 4 (carry 6) Step 2: 6 + 16 + 32 = 54; 4 (carry 5) Step 3: 5 + 4 + 8 = 17; 7 (carry 1) Step 4: 1 + 1 + 0 = 2 Hence, 2744
So, for a practitioner of Vedic Mathematics, for something like:
183
 Clearly, the ratio is 1:8 And, 13 = 1  So, the first pair of terms are: {1},{8},{64},{512} And, the second pair of terms are: {0},{16},{128},{0} Sum of the pairs is: 5832 Note:   [1, 8, 64,512] + [0,16,128,  0] ----------------- Step 1: 512 + 0 = 512; 2 (carry 51) Step 2: 51 + 64 + 128 = 243; 3 (carry 24) Step 3: 24 + 8 + 16 = 48; 8 (carry 4) Step 4: 4 + 1 + 0 = 5 Hence, 5832  Thus, 183 = 5,832
Also, for something like:
283
 Clearly, the ratio is 2:8 = 1:4 And, 23 = 8  So, the first pair of terms are: {8},{32},{128},{512} And, the second pair of terms are: {0},{64},{256},{0} Sum of the pairs is: 21952 Note:   [8,32,128,512] + [0,64,256,  0] ----------------- Step 1: 512 + 0 = 512; 2 (carry 51) Step 2: 51 + 128 + 256 = 435; 5 (carry 43) Step 3: 43 + 32 + 64 = 139; 9 (carry 13) Step 4: 13 + 8 + 0 = 21 Hence, 21952  Thus, 283 = 21,952
Again, for something like:
773
 Clearly, the ratio is 7:7 = 1:1 And, 73 = 343  So, the first pair of terms are: {343},{343},{343},{343} And, the second pair of terms are: {0},{686},{686},{0} Sum of the pairs is: 456533 Note:   [343,343,343,343] + [  0,686,686,  0] -------------------- Step 1: 343 + 0 = 343; 3 (carry 34) Step 2: 34 + 343 + 686 = 1063; 3 (carry 106) Step 3: 106 + 343 + 686 = 1135; 5 (carry 113) Step 4: 113 + 343 + 0 = 456 Hence, 456533  Thus, 773 = 456,533
Please remember that this Upasūtra is discussed only for 2-digit numbers, because it gets cumbersome for larger numbers and there are other alternatives. However, you can enforce this Upasūtra on non-prime numbers by factorization. For example,
1213 = (11 × 11)3 = 113 × 113
One can use this Upasūtra for 113, and the multiply the calculated figures.
Similarly, 2473 = 133 × 193
And, 35883 = 133 × 233 × 123

However, let us take another example for academic purpose, for something like:
1213
 If we split the number into two, say: 1 and 21 Clearly, the ratio is 1:21 And, 13 = 1  So, the first pair of terms are: {1},{21},{441},{9261} And, the second pair of terms are: {0},{42},{882},{0} Sum of the pairs is: 1771561 Note:   [1,21, 441,9261] + [0,42, 882,   0] -------------------   [1,63,1323,9261] Note again, that since the second part has 2 digits, the working Base is 100 So, [1,63,1323,9261] = 1,000000 + 63,0000 + 1323,00 + 9261 = 1771561  Thus, 1213 = 1,771,561

Again, for something like:
2783
 If we split the number into two, say: 2 and 78 Clearly, the ratio is 1:39 And, 23 = 8  So, the first pair of terms are: {8},{312},{12168},{474552} And, the second pair of terms are: {0},{624},{24336},{0} Sum of the pairs is: 21484952 Note:   [8,312,12168,474552] + [0,624,24336,     0] -----------------------   [8,936,36504,474552] Note again, that since the second part has 2 digits, the working Base is 100 So, [8,936,36504,474552] = 8,000000 + 936,0000 + 36504,00 + 474552 = 21484952  Thus, 2783 = 21,484,952
Note that, the digits in the second part of the split determines the Base, for something like:
11483
 If we split the number into two, say: 11 and 48 Clearly, the ratio is 11:48 = 1:(48/11) And, 113 = 1331  So, the first pair of terms are: {1331},{5808},{25344},{110592} And, the second pair of terms are: {0},{11616},{76032},{0} Sum of the pairs is: 1512953792 Note:   [1331, 5808,25344,110592] + [   0,11616,50688,     0] ----------------------------   [1331,17424,76032,110592] Note again, that since the second part has 2 digits, the working Base is 100 So, [1331,17424,76032,110592] = 1331,000000 + 17424,0000 + 76032,00 + 110592 = 1512953792  Thus, 11483 = 1,512,953,792  Again, if we split the number into two, say: 1 and 148 Clearly, the ratio is 1:148 And, 13 = 1  So, the first pair of terms are: {1},{148},{21904},{3241792} And, the second pair of terms are: {0},{296},{43808},{0} Sum of the pairs is: 1512953792 Note:   [1,148,21904,3241792] + [0,296,43808,      0] ------------------------   [1,444,65712,3241792] Note again, that since the second part has 3 digits, the working Base is 1000 So, [1,444,65712,3241792] = 1,000000000 + 444,000000 + 65712,000 + 3241792 = 1512953792  Thus, 11483 = 1,512,953,792
But, why does it work? For this Upasūtra (dvaṅdvayoga), let us consider the following:
 Assuming a two-digit number, mn, then N = 10m + n As in examples, 14 = 10 + 4, 18 = 10 + 8, 28 = 20 + 8, 77 = 70 + 7 Now, N3 = (10m + n)3 = (10m + n)(10m + n)2 = (10m + n)(100m2 + 2(10mn) + n2) = [1000m3 + 2(100m2n) + 10mn2] + [100m2n + 20mn2 + n3] = 1000m3 + 3(100m2n) + 3(10mn2) + n3  This can be written as: = 1000m3 + 100m2n + 10mn2 + n3   + 100(2m2n) + 10(2mn2)  This is exactly what this Upasūtra makes us do: 143 = 1000(1) + 100(4) + 10(16) + 64      + 100(8) + 10(32)  The others, also being 2-digit numbers, are similar - as above. Note that, the ratios are important because that is how the power of n is being distributed. But more importantly, m3:m2n = m2n:n3 = m:n Similarly, numbers with more digits may be proven.
Note that this Upasūtra (dvaṅdvayoga) may be used for other powers of x (xn) by remembering:
a4 = a2+2 = a2 × a2
a5 = a2+3 = a2 × a3
And so on.

Lastly, please remember that, as in any other form of mathematics, the mastery of Vedic Mathematics require practice and the judgement of applying the optimal method for a given scenario - a guideline of which, is presented in Applications »

 « Upasūtra 15

7000 BCE Series:
 Tales of Panchatantra Oldest & Most Popular Work of Literature talesofpanchatantra.com Upavidhi Vedic Mathematics Fastest & Easiest Mathematical Methods upavidhi.com
 7000 BCE 10,000 Years of Indian Civilization 7000bce.com Vedic Mythology Hindu Traditions & Beliefs vedicmythology.com Tales of Panchatantra Oldest & Most Popular Work of Literature talesofpanchatantra.com Yoga Vyayam Art & Science of Healthy Living yogavyayam.com Upavidhi Vedic Mathematics Fastest & Easiest Mathematical Methods upavidhi.com