Long multiplication is the method of multiplication that is commonly taught to elementary school students throughout the world. It can be used on two numbers of arbitrarily large size or number of decimal digits. The numbers to be multiplied are placed vertically over one another with their least significant digits aligned. The top number is named the multiplicand and the lower number is the multiplier. The result of the multiplication is the product.
For example, we can multiply . The number with more digits is usually selected as the multiplicand:
The long multiplication algorithm starts with multiplying the multiplicand by the least significant digit of the multiplier to produce a partial product, then continuing this process for all higher order digits in the multiplier. Each partial product is right-aligned with the corresponding digit in the multiplier. The partial products are then summed:
Implicit in using this method is the following principle. The multiplier can be expresses as . So we are first multiplying 384 by 6, then multiplying 384 by 50 and then adding the two results together. This produces the correct answer because multiplication is distributive over addition for the set of real numbers .
Long multiplication of two -digit numbers takes approximately multiplication operations. This is said to be a time complexity of order or .
As previously mentioned, the number with more digits is usually chosen as the multiplicand (top number); this choice will involve fewer partial products to generate and then add together. However, if the longer number contains zeroes or repeated digits, it may be advantageous to choose this number as the multiplier and use the shorter number as the multiplicand.
As an example, we can compute . In this case it is more efficient to use 220002 as the multiplier instead of 674, since three of its digits are "0" and three are "2." Multiplying by "0" only involves shifting the next partial product left by one place, and multiplying by each successive "2" after the first (the units digit in the number) only requires copying the result from the first"" multiplication:
The long multiplication method may also be used to multiply two polynomials. One additional concern with multiplying polynomials is that only terms with identical variables and exponents can be added together. So careful alignment of terms when computing partial products is essential.
For example, let us compute . When multiplying by each term in the multiplier, space should be left for powers of which are missing. This will allow for easier alignment when all partial polynomial products are added together.
An alternative to long multiplication for numbers is the lattice method.