Jump to content

Polynomial long division: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
m Reverted 1 edit by 2409:4055:97:D049:0:0:E92:78A1 (talk) to last revision by Frap (TW)
Deffun (talk | contribs)
m fixed a typo in the pseudocode description, notice neither q nor t are polynomials so simple addition is sufficient
 
(40 intermediate revisions by 28 users not shown)
Line 1: Line 1:
{{Short description|Algorithm for division of polynomials}}
{{Short description|Algorithm for division of polynomials}}
{{For|a shorthand version of this method|synthetic division}}
In [[algebra]], '''polynomial long division''' is an [[algorithm]] for dividing a [[polynomial]] by another polynomial of the same or lower [[Degree of a polynomial|degree]], a generalised version of the familiar arithmetic technique called [[long division]]. It can be done easily by hand, because it separates an otherwise complex division problem into smaller ones. Sometimes using a shorthand version called [[synthetic division]] is faster, with less writing and fewer calculations. Another abbreviated method is polynomial short division (Blomqvist's method).
In [[algebra]], '''polynomial long division''' is an [[algorithm]] for dividing a [[polynomial]] by another polynomial of the same or lower [[Degree of a polynomial|degree]], a generalized version of the familiar arithmetic technique called [[long division]]. It can be done easily by hand, because it separates an otherwise complex division problem into smaller ones. Sometimes using a shorthand version called [[synthetic division]] is faster, with less writing and fewer calculations. Another abbreviated method is polynomial short division (Blomqvist's method).


Polynomial long division is an algorithm that implements the [[Euclidean division of polynomials]], which starting from two polynomials ''A'' (the ''dividend'') and ''B'' (the ''divisor'') produces, if ''B'' is not zero, a ''quotient'' ''Q'' and a ''remainder'' ''R'' such that
Polynomial long division is an algorithm that implements the [[Euclidean division of polynomials]], which starting from two polynomials ''A'' (the ''dividend'') and ''B'' (the ''divisor'') produces, if ''B'' is not zero, a ''[[quotient]]'' ''Q'' and a ''remainder'' ''R'' such that
:''A'' = ''BQ'' + ''R'',
:''A'' = ''BQ'' + ''R'',
and either ''R'' = 0 or the degree of ''R'' is lower than the degree of ''B''. These conditions uniquely define ''Q'' and ''R'', which means that ''Q'' and ''R'' do not depend on the method used to compute them.
and either ''R'' = 0 or the degree of ''R'' is lower than the degree of ''B''. These conditions uniquely define ''Q'' and ''R'', which means that ''Q'' and ''R'' do not depend on the method used to compute them.


The result ''R'' = 0 occurs [[if and only if]] the polynomial ''A'' has ''B'' as a [[polynomial factorization|factor]]. Thus long division is a means for testing whether one polynomial has another as a factor, and, if it does, for factoring it out. For example, if a [[root of a polynomial|root]] ''r'' of ''A'' is known, it can be factored out by dividing ''A'' by (''x''–''r'').
The result ''R'' = 0 occurs [[if and only if]] the polynomial ''A'' has ''B'' as a [[polynomial factorization|factor]]. Thus long division is a means for testing whether one polynomial has another as a factor, and, if it does, for factoring it out. For example, if a [[root of a polynomial|root]] ''r'' of ''A'' is known, it can be factored out by dividing ''A'' by (''x''  ''r'').


==Example==
==Example==


=== Polynomial long division ===
=== Polynomial long division ===
Find the quotient and the remainder of the division of <math>x^3 - 2x^2 - 4,</math> the ''dividend'', by <math>x-3,</math> the ''divisor''.
Find the quotient and the remainder of the division of <math>(x^3 - 2x^2 - 4)</math>, the ''dividend'', by <math>(x-3) </math>, the ''divisor''.


The dividend is first rewritten like this:
The dividend is first rewritten like this:
Line 19: Line 20:
The quotient and remainder can then be determined as follows:
The quotient and remainder can then be determined as follows:


<ol>
{{Ordered list
<li>
|1=Divide the first term of the dividend by the highest term of the divisor (meaning the one with the highest power of ''x'', which in this case is ''x''). Place the result above the bar (''x''<sup>3</sup> ÷ ''x'' = ''x''<sup>2</sup>).
Divide the first term of the dividend by the highest term of the divisor (meaning the one with the highest power of ''x'', which in this case is ''x''). Place the result above the bar (''x''<sup>3</sup> ÷ ''x'' = ''x''<sup>2</sup>).
:<math>
:<math>
\begin{array}{l}
\begin{array}{l}
{\color{White} x-3 ) x^3 - 2}x^2\\
{\color{White} x-3\ )\ x^3 - 2}x^2\\
x-3\overline{) x^3 - 2x^2 + 0x - 4}
x-3\ \overline{)\ x^3 - 2x^2 + 0x - 4}
\end{array}
\end{array}
</math>
</math>
</li>

<li>
|2=Multiply the divisor by the result just obtained (the first term of the eventual quotient). Write the result under the first two terms of the dividend ({{math|1=''x''<sup>2</sup>&nbsp;·&nbsp;(''x''&nbsp;&minus;&nbsp;3) = ''x''<sup>3</sup>&nbsp;&minus;&nbsp;3''x''<sup>2</sup>}}).
Multiply the divisor by the result just obtained (the first term of the eventual quotient). Write the result under the first two terms of the dividend ({{math|1=''x''<sup>2</sup> · (''x''3) = ''x''<sup>3</sup>3''x''<sup>2</sup>}}).
:<math>
:<math>
\begin{array}{l}
\begin{array}{l}
{\color{White} x-3 ) x^3 - 2}x^2\\
{\color{White} x-3\ )\ x^3 - 2}x^2\\
x-3\overline{) x^3 - 2x^2 + 0x - 4}\\
x-3\ \overline{)\ x^3 - 2x^2 + 0x - 4}\\
{\color{White} x-3 )} x^3 - 3x^2
{\color{White} x-3\ )\ } x^3 - 3x^2
\end{array}
\end{array}
</math>
</math>
</li>

<li>
|3=Subtract the product just obtained from the appropriate terms of the original dividend (being careful that subtracting something having a minus sign is equivalent to adding something having a plus sign), and write the result underneath ({{math|({{math|1=''x''<sup>3</sup>&nbsp;&minus;&nbsp;2''x''<sup>2</sup>)&nbsp;&minus;&nbsp;(''x''<sup>3</sup>&nbsp;&minus;&nbsp;3''x''<sup>2</sup>) = &minus;2''x''<sup>2</sup>&nbsp;+&nbsp;3''x''<sup>2</sup> = &nbsp;''x''<sup>2</sup>}}}}). Then, "bring down" the next term from the dividend.
Subtract the product just obtained from the appropriate terms of the original dividend (being careful that subtracting something having a minus sign is equivalent to adding something having a plus sign), and write the result underneath {{math|({{math|1=''x''<sup>3</sup>2''x''<sup>2</sup>)(''x''<sup>3</sup>3''x''<sup>2</sup>) = −2''x''<sup>2</sup> + 3''x''<sup>2</sup> = ''x''<sup>2</sup>}}}}
Then, "bring down" the next term from the dividend.


:<math>
:<math>
\begin{array}{l}
\begin{array}{l}
{\color{White} x-3 ) x^3 - 2}x^2\\
{\color{White} x-3\ )\ x^3 - 2}x^2\\
x-3\overline{) x^3 - 2x^2 + 0x - 4}\\
x-3\ \overline{)\ x^3 - 2x^2 + 0x - 4}\\
{\color{White} x-3 )} \underline{x^3 - 3x^2}\\
{\color{White} x-3\ )\ } \underline{x^3 - 3x^2}\\
{\color{White} x-3 )0x^3} + {\color{White}}x^2 + 0x
{\color{White} x-3\ )\ 0x^3} + {\color{White}}x^2 + 0x
\end{array}
\end{array}
</math>
</math>
</li>

<li>
|4=Repeat the previous three steps, except this time use the two terms that have just been written as the dividend.
Repeat the previous three steps, except this time use the two terms that have just been written as the dividend.
:<math>
:<math>
\begin{array}{r}
\begin{array}{r}
x^2 + {\color{White}1}x {\color{White} {} + 3}\\
x^2 + {\color{White}1}x {\color{White} {} + 3}\\
x-3\overline{) x^3 - 2x^2 + 0x - 4}\\
x-3\ \overline{)\ x^3 - 2x^2 + 0x - 4}\\
\underline{x^3 - 3x^2 {\color{White} {} + 0x - 4}}\\
\underline{x^3 - 3x^2 {\color{White} {} + 0x - 4}}\\
+x^2 + 0x {\color{White} {} - 4}\\
+x^2 + 0x {\color{White} {} - 4}\\
Line 59: Line 65:
\end{array}
\end{array}
</math>
</math>
</li>

<li>
|5=Repeat step 4. This time, there is nothing to "pull down".
Repeat step 4. This time, there is nothing to "bring down".
:<math>
:<math>
\begin{array}{r}
\begin{array}{r}
x^2 + {\color{White}1}x + 3\\
x^2 + {\color{White}1}x + 3\\
x-3\overline{) x^3 - 2x^2 + 0x - 4}\\
x-3\ \overline{)\ x^3 - 2x^2 + 0x - 4}\\
\underline{x^3 - 3x^2 {\color{White} {} + 0x - 4}}\\
\underline{x^3 - 3x^2 {\color{White} {} + 0x - 4}}\\
+x^2 + 0x {\color{White} {} - 4}\\
+x^2 + 0x {\color{White} {} - 4}\\
Line 73: Line 80:
\end{array}
\end{array}
</math>
</math>
</li>
}}
</ol>


The polynomial above the bar is the quotient ''q''(''x''), and the number left over (5) is the remainder ''r''(''x'').
The polynomial above the bar is the quotient ''q''(''x''), and the number left over (5) is the remainder ''r''(''x'').
Line 79: Line 87:
:<math>{x^3 - 2x^2 - 4} = (x-3)\,\underbrace{(x^2 + x + 3)}_{q(x)} +\underbrace{5}_{r(x)}</math>
:<math>{x^3 - 2x^2 - 4} = (x-3)\,\underbrace{(x^2 + x + 3)}_{q(x)} +\underbrace{5}_{r(x)}</math>


The [[long division]] algorithm for arithmetic is very similar to the above algorithm, in which the variable ''x'' is replaced by the specific number 10.
The [[long division]] algorithm for arithmetic is very similar to the above algorithm, in which the variable ''x'' is replaced (in base 10) by the specific number 10.


=== Polynomial short division===
=== Polynomial short division===
Blomqvist's method<ref>{{Citation|title=Blomqvist’s division: the simplest method for solving divisions?|url=https://www.youtube.com/watch?v=Ad16hxs809I|language=en|access-date=2019-12-10}}</ref> is an abbreviated version of the long division above. This pen-and-paper method uses the same algorithm as polynomial long division, but [[mental calculation]] is used to determine remainders. This requires less writing, and can therefore be a faster method once mastered.
Blomqvist's method<ref>Archived at [https://ghostarchive.org/varchive/youtube/20211211/Ad16hxs809I Ghostarchive]{{cbignore}} and the [https://web.archive.org/web/20200401062354/https://www.youtube.com/watch?v=Ad16hxs809I&gl=US&hl=en Wayback Machine]{{cbignore}}: {{Citation|title=Blomqvist's division: the simplest method for solving divisions?|url=https://www.youtube.com/watch?v=Ad16hxs809I|language=en|access-date=2019-12-10}}{{cbignore}}</ref> is an abbreviated version of the long division above. This pen-and-paper method uses the same algorithm as polynomial long division, but [[mental calculation]] is used to determine remainders. This requires less writing, and can therefore be a faster method once mastered.


The division is at first written in a similar way as long multiplication with the dividend at the top, and the divisor below it. The quotient is to be written below the bar from left to right.
The division is at first written in a similar way as long multiplication with the dividend at the top, and the divisor below it. The quotient is to be written below the bar from left to right.


<math>\begin{matrix} \qquad \qquad x^3-2x^2+{0x}-4 \\ \underline{ \div \quad \qquad \qquad \qquad \qquad x-3 }\end{matrix}</math>
:<math>\begin{matrix} \qquad \qquad x^3-2x^2+{0x}-4 \\ \underline{ \div \quad \qquad \qquad \qquad \qquad x-3 }\end{matrix}</math>


Divide the first term of the dividend by the highest term of the divisor (''x''<sup>3</sup> ÷ ''x'' = ''x''<sup>2</sup>). Place the result below the bar. ''x''<sup>3</sup> has been divided leaving no remainder, and can therefore be marked as used by crossing it out. The result ''x''<sup>2</sup> is then multiplied by the second term in the divisor −3 = −3''x''<sup>2</sup>. Determine the partial remainder by subtracting −2''x''<sup>2</sup> − (−3''x''<sup>2</sup>) = ''x''<sup>2</sup>. Mark −2''x''<sup>2</sup> as used and place the new remainder ''x''<sup>2</sup> above it.


:<math>\begin{matrix} \qquad x^2 \\ \qquad \quad \bcancel{x^3}+\bcancel{-2x^2}+{0x}-4 \\ \underline{ \div \qquad \qquad \qquad \qquad \qquad x-3 }\\x^2 \qquad \qquad \end{matrix}
</math>


Divide the first term of the dividend by the highest term of the divisor (''x''<sup>3</sup> ÷ ''x'' = ''x''<sup>2</sup>). Place the result below the bar. ''x''<sup>3</sup> has been divided leaving no remainder, and can therefore be marked as used with a backslash. The result ''x''<sup>2</sup> is then multiplied by the second term in the divisor -3 = -3''x''<sup>2</sup>. Determine the partial remainder by subtracting -2''x''<sup>2</sup>-(-3''x''<sup>2</sup>) = ''x''<sup>2</sup>. Mark -2''x''<sup>2</sup> as used and place the new remainder ''x''<sup>2</sup> above it.
Divide the highest term of the remainder by the highest term of the divisor (''x''<sup>2</sup> ÷ ''x'' = ''x''). Place the result (+x) below the bar. ''x''<sup>2</sup> has been divided leaving no remainder, and can therefore be marked as used. The result ''x'' is then multiplied by the second term in the divisor −3 = −3''x''. Determine the partial remainder by subtracting 0''x''(−3''x'') = 3''x''. Mark 0''x'' as used and place the new remainder 3''x'' above it.


<math>\begin{matrix} \qquad x^2 \\ \qquad \quad \bcancel x^3+\bcancel{-2}x^2+{0x}-4 \\ \underline{ \div \qquad \qquad \qquad \qquad \qquad x-3 }\\x^2 \qquad \qquad \end{matrix}
:<math>\begin{matrix} \qquad \qquad \quad\bcancel{x^2} \quad3x\\ \qquad \quad \bcancel{x^3}+\bcancel{-2x^2}+\bcancel{0x}-4 \\ \underline{ \div \qquad \qquad \qquad \qquad \qquad x-3 }\\x^2 +x \qquad \end{matrix}
</math>
</math>


Divide the highest term of the remainder by the highest term of the divisor (''x<sup>2</sup>'' ÷ ''x'' = ''x''). Place the result (+x) below the bar. ''x<sup>2</sup>'' has been divided leaving no remainder, and can therefore be marked as used. The result ''x'' is then multiplied by the second term in the divisor -3 = -3''x''. Determine the partial remainder by subtracting 0x-(-3''x'') = 3''x''. Mark 0x as used and place the new remainder ''3x'' above it.
Divide the highest term of the remainder by the highest term of the divisor (3x ÷ ''x'' = 3). Place the result (+3) below the bar. 3x has been divided leaving no remainder, and can therefore be marked as used. The result 3 is then multiplied by the second term in the divisor −3 = −9. Determine the partial remainder by subtracting −4 − (−9) = 5. Mark −4 as used and place the new remainder 5 above it.


<math>\begin{matrix} \qquad \qquad \quad\bcancel x^2 \quad3x\\ \qquad \quad \bcancel x^3+\bcancel{-2}x^2+\bcancel{0x}-4 \\ \underline{ \div \qquad \qquad \qquad \qquad \qquad x-3 }\\x^2 +x \qquad \end{matrix}
:<math>\begin{matrix} \quad \qquad \qquad \qquad\bcancel{x^2} \quad \bcancel{3x} \quad5\\
\qquad \quad \bcancel{x^3}+\bcancel{-2x^2}+\bcancel{0x}\bcancel{-4} \\
\underline{ \div \qquad \qquad \qquad \qquad \qquad x-3 }\\
x^2 +x +3\qquad \end{matrix}
</math>
</math>


The polynomial below the bar is the quotient ''q''(''x''), and the number left over (5) is the remainder ''r''(''x'').
Divide the highest term of the remainder by the highest term of the divisor (3x ÷ ''x'' = 3). Place the result (+3) below the bar. 3x has been divided leaving no remainder, and can therefore be marked as used. The result 3 is then multiplied by the second term in the divisor -3 = -9. Determine the partial remainder by subtracting -4-(-9) = 5. Mark -4 as used and place the new remainder 5 above it.


<math>\begin{matrix} \quad \qquad \qquad \qquad\bcancel x^2 \quad \bcancel{3x} \quad5\\ \qquad \quad \bcancel x^3+\bcancel{-2}x^2+\bcancel{0x}\bcancel{-4} \\ \underline{ \div \qquad \qquad \qquad \qquad \qquad x-3 }\\x^2 +x +3\qquad \end{matrix}
</math>

The polynomial below the bar is the quotient ''q''(''x''), and the number left over (5) is the remainder ''r''(''x'').<br />
==Pseudocode==
==Pseudocode==


The algorithm can be represented in [[pseudocode]] as follows, where +, −, and × represent polynomial arithmetic, and / represents simple division of two terms:
The algorithm can be represented in [[pseudocode]] as follows, where −, and × represent polynomial arithmetic, and +, and / represent simple addition and division of two terms:


'''function''' n / d '''is'''
'''function''' n / d '''is'''
Line 122: Line 132:
'''return''' (q, r)
'''return''' (q, r)


Note that this works equally well when degree(n) < degree(d); in that case the result is just the trivial (0, n).
This works equally well when degree(''n'') < degree(''d''); in that case the result is just the trivial (0, ''n'').


This algorithm describes exactly the above paper and pencil method: {{var|d}} is written on the left of the ")"; {{var|q}} is written, term after term, above the horizontal line, the last term being the value of {{var|t}}; the region under the horizontal line is used to compute and write down the successive values of {{var|r}}.
This algorithm describes exactly the above paper and pencil method: {{var|d}} is written on the left of the ")"; {{var|q}} is written, term after term, above the horizontal line, the last term being the value of {{var|t}}; the region under the horizontal line is used to compute and write down the successive values of {{var|r}}.
Line 133: Line 143:
and either ''R''=0 or degree(''R'') < degree(''B''). Moreover (''Q'', ''R'') is the unique pair of polynomials having this property.
and either ''R''=0 or degree(''R'') < degree(''B''). Moreover (''Q'', ''R'') is the unique pair of polynomials having this property.


The process of getting the uniquely defined polynomials ''Q'' and ''R'' from ''A'' and ''B'' is called ''Euclidean division'' (sometimes ''division transformation''). Polynomial long division is thus an [[algorithm]] for Euclidean division.<ref>{{cite book|author=S. Barnard|title=Higher Algebra|year=2008|publisher=READ BOOKS|isbn=1-4437-3086-6|page=24}}</ref>
The process of getting the uniquely defined polynomials ''Q'' and ''R'' from ''A'' and ''B'' is called ''Euclidean division'' (sometimes ''division transformation''). Polynomial long division is thus an [[algorithm]] for Euclidean division.<ref>{{cite book|author=S. Barnard|title=Higher Algebra|year=2008|publisher=READ BOOKS|isbn=978-1-4437-3086-0|page=24}}</ref>


==Applications==
==Applications==
Line 139: Line 149:
===Factoring polynomials===
===Factoring polynomials===


Sometimes one or more roots of a polynomial are known, perhaps having been found using the [[rational root theorem]]. If one root ''r'' of a polynomial ''P''(''x'') of degree ''n'' is known then polynomial long division can be used to factor ''P''(''x'') into the form {{nowrap|(''x'' − ''r'')(''Q''(''x''))}} where ''Q''(''x'') is a polynomial of degree ''n'' − 1. ''Q''(''x'') is simply the quotient obtained from the division process; since ''r'' is known to be a root of ''P''(''x''), it is known that the remainder must be zero.
Sometimes one or more roots of a polynomial are known, perhaps having been found using the [[rational root theorem]]. If one root ''r'' of a polynomial ''P''(''x'') of degree ''n'' is known then polynomial long division can be used to factor ''P''(''x'') into the form {{nowrap|(''x'' − ''r'')''Q''(''x'')}} where ''Q''(''x'') is a polynomial of degree ''n'' − 1. ''Q''(''x'') is simply the quotient obtained from the division process; since ''r'' is known to be a root of ''P''(''x''), it is known that the remainder must be zero.


Likewise, if more than one root is known, a linear factor {{nowrap|(''x'' − ''r'')}} in one of them (''r'') can be divided out to obtain ''Q''(''x''), and then a linear term in another root, ''s'', can be divided out of ''Q''(''x''), etc. Alternatively, they can all be divided out at once: for example the linear factors {{nowrap|''x'' − ''r''}} and {{nowrap|''x'' − ''s''}} can be multiplied together to obtain the quadratic factor {{nowrap|''x''<sup>2</sup> − (''r'' + ''s'')''x'' + ''rs'',}} which can then be divided into the original polynomial ''P''(''x'') to obtain a quotient of degree {{nowrap|''n'' − 2.}}
Likewise, if several roots ''r'', ''s'', . . . of ''P''(''x'') are known, a linear factor {{nowrap|(''x'' − ''r'')}} can be divided out to obtain ''Q''(''x''), and then {{nowrap|(''x'' ''s'')}} can be divided out of ''Q''(''x''), etc. Alternatively, the quadratic factor <math>(x-r)(x-s)=x^2-(r{+}s)x+rs</math> can be divided out of ''P''(''x'') to obtain a quotient of degree {{nowrap|''n'' − 2.}}


In this way, sometimes all the roots of a polynomial of degree greater than four can be obtained, even though that is not always possible. For example, if the rational root theorem can be used to obtain a single (rational) root of a [[quintic function|quintic polynomial]], it can be factored out to obtain a quartic (fourth degree) quotient; the explicit formula for the roots of a [[quartic function|quartic polynomial]] can then be used to find the other four roots of the quintic.
This method is especially useful for cubic polynomials, and sometimes all the roots of a higher-degree polynomial can be obtained. For example, if the rational root theorem produces a single (rational) root of a [[quintic function|quintic polynomial]], it can be factored out to obtain a quartic (fourth degree) quotient; the explicit formula for the roots of a [[quartic function|quartic polynomial]] can then be used to find the other four roots of the quintic. There is, however, no general way to solve a quintic by purely algebraic methods, see [[Abel–Ruffini theorem]].


===Finding tangents to polynomial functions===
===Finding tangents to polynomial functions===
Line 150: Line 160:


====Example====
====Example====
: Find the equation of the line that is tangent to the following curve at <math>x=1</math>:
Find the equation of the line that is tangent to the following curve
:: <math>y = x^3 - 12x^2 - 42.</math>
<math>y = (x^3 - 12x^2 - 42) </math>
:Begin by dividing the polynomial by <math>(x-1)^2 = x^2-2x+1</math>:
:at: <math>x = 1 </math>
Begin by dividing the polynomial by:
<math> (x-1)^2=(x^2-2x+1)</math>

:: <math>
: <math>
\begin{array}{r}
\begin{array}{r}
x - 10\\
x - 10\\
x^2-2x+1\overline{) x^3 - 12x^2 + 0x - 42}\\
x^2-2x+1\ \overline{)\ x^3 - 12x^2 + 0x - 42}\\
\underline{x^3 - {\color{White}0}2x^2 + {\color{White}1}x} {\color{White} {} - 42}\\
\underline{x^3 - {\color{White}0}2x^2 + {\color{White}1}x} {\color{White} {} - 42}\\
-10x^2 - {\color{White}01}x - 42\\
-10x^2 - {\color{White}01}x - 42\\
Line 163: Line 176:
\end{array}
\end{array}
</math>
</math>
:The tangent line is <math>y = - 21 x - 32.</math>
The tangent line is
<math> y=(-21x-32)</math>


===Cyclic redundancy check===
===Cyclic redundancy check===
Line 177: Line 191:
*[[Greatest common divisor of two polynomials]]
*[[Greatest common divisor of two polynomials]]


==Notes==
==References==
{{reflist}}
<references/>

{{Polynomials}}


{{DEFAULTSORT:Polynomial Long Division}}
[[Category:Polynomials]]
[[Category:Polynomials]]
[[Category:Computer algebra]]
[[Category:Computer algebra]]

Latest revision as of 00:55, 26 November 2024

In algebra, polynomial long division is an algorithm for dividing a polynomial by another polynomial of the same or lower degree, a generalized version of the familiar arithmetic technique called long division. It can be done easily by hand, because it separates an otherwise complex division problem into smaller ones. Sometimes using a shorthand version called synthetic division is faster, with less writing and fewer calculations. Another abbreviated method is polynomial short division (Blomqvist's method).

Polynomial long division is an algorithm that implements the Euclidean division of polynomials, which starting from two polynomials A (the dividend) and B (the divisor) produces, if B is not zero, a quotient Q and a remainder R such that

A = BQ + R,

and either R = 0 or the degree of R is lower than the degree of B. These conditions uniquely define Q and R, which means that Q and R do not depend on the method used to compute them.

The result R = 0 occurs if and only if the polynomial A has B as a factor. Thus long division is a means for testing whether one polynomial has another as a factor, and, if it does, for factoring it out. For example, if a root r of A is known, it can be factored out by dividing A by (x – r).

Example

[edit]

Polynomial long division

[edit]

Find the quotient and the remainder of the division of , the dividend, by , the divisor.

The dividend is first rewritten like this:

The quotient and remainder can then be determined as follows:

  1. Divide the first term of the dividend by the highest term of the divisor (meaning the one with the highest power of x, which in this case is x). Place the result above the bar (x3 ÷ x = x2).
  2. Multiply the divisor by the result just obtained (the first term of the eventual quotient). Write the result under the first two terms of the dividend (x2 · (x − 3) = x3 − 3x2).
  3. Subtract the product just obtained from the appropriate terms of the original dividend (being careful that subtracting something having a minus sign is equivalent to adding something having a plus sign), and write the result underneath (x3 − 2x2) − (x3 − 3x2) = −2x2 + 3x2 = x2 Then, "bring down" the next term from the dividend.
  4. Repeat the previous three steps, except this time use the two terms that have just been written as the dividend.
  5. Repeat step 4. This time, there is nothing to "bring down".

The polynomial above the bar is the quotient q(x), and the number left over (5) is the remainder r(x).

The long division algorithm for arithmetic is very similar to the above algorithm, in which the variable x is replaced (in base 10) by the specific number 10.

Polynomial short division

[edit]

Blomqvist's method[1] is an abbreviated version of the long division above. This pen-and-paper method uses the same algorithm as polynomial long division, but mental calculation is used to determine remainders. This requires less writing, and can therefore be a faster method once mastered.

The division is at first written in a similar way as long multiplication with the dividend at the top, and the divisor below it. The quotient is to be written below the bar from left to right.

Divide the first term of the dividend by the highest term of the divisor (x3 ÷ x = x2). Place the result below the bar. x3 has been divided leaving no remainder, and can therefore be marked as used by crossing it out. The result x2 is then multiplied by the second term in the divisor −3 = −3x2. Determine the partial remainder by subtracting −2x2 − (−3x2) = x2. Mark −2x2 as used and place the new remainder x2 above it.

Divide the highest term of the remainder by the highest term of the divisor (x2 ÷ x = x). Place the result (+x) below the bar. x2 has been divided leaving no remainder, and can therefore be marked as used. The result x is then multiplied by the second term in the divisor −3 = −3x. Determine the partial remainder by subtracting 0x − (−3x) = 3x. Mark 0x as used and place the new remainder 3x above it.

Divide the highest term of the remainder by the highest term of the divisor (3x ÷ x = 3). Place the result (+3) below the bar. 3x has been divided leaving no remainder, and can therefore be marked as used. The result 3 is then multiplied by the second term in the divisor −3 = −9. Determine the partial remainder by subtracting −4 − (−9) = 5. Mark −4 as used and place the new remainder 5 above it.

The polynomial below the bar is the quotient q(x), and the number left over (5) is the remainder r(x).

Pseudocode

[edit]

The algorithm can be represented in pseudocode as follows, where −, and × represent polynomial arithmetic, and +, and / represent simple addition and division of two terms:

function n / d is
    require d ≠ 0
    q ← 0
    r ← n             // At each step n = d × q + r

    while r ≠ 0 and degree(r) ≥ degree(d) do
        t ← lead(r) / lead(d)       // Divide the leading terms
        q ← q + t
        r ← r − t × d

    return (q, r)

This works equally well when degree(n) < degree(d); in that case the result is just the trivial (0, n).

This algorithm describes exactly the above paper and pencil method: d is written on the left of the ")"; q is written, term after term, above the horizontal line, the last term being the value of t; the region under the horizontal line is used to compute and write down the successive values of r.

Euclidean division

[edit]

For every pair of polynomials (A, B) such that B ≠ 0, polynomial division provides a quotient Q and a remainder R such that

and either R=0 or degree(R) < degree(B). Moreover (Q, R) is the unique pair of polynomials having this property.

The process of getting the uniquely defined polynomials Q and R from A and B is called Euclidean division (sometimes division transformation). Polynomial long division is thus an algorithm for Euclidean division.[2]

Applications

[edit]

Factoring polynomials

[edit]

Sometimes one or more roots of a polynomial are known, perhaps having been found using the rational root theorem. If one root r of a polynomial P(x) of degree n is known then polynomial long division can be used to factor P(x) into the form (xr)Q(x) where Q(x) is a polynomial of degree n − 1. Q(x) is simply the quotient obtained from the division process; since r is known to be a root of P(x), it is known that the remainder must be zero.

Likewise, if several roots r, s, . . . of P(x) are known, a linear factor (xr) can be divided out to obtain Q(x), and then (xs) can be divided out of Q(x), etc. Alternatively, the quadratic factor can be divided out of P(x) to obtain a quotient of degree n − 2.

This method is especially useful for cubic polynomials, and sometimes all the roots of a higher-degree polynomial can be obtained. For example, if the rational root theorem produces a single (rational) root of a quintic polynomial, it can be factored out to obtain a quartic (fourth degree) quotient; the explicit formula for the roots of a quartic polynomial can then be used to find the other four roots of the quintic. There is, however, no general way to solve a quintic by purely algebraic methods, see Abel–Ruffini theorem.

Finding tangents to polynomial functions

[edit]

Polynomial long division can be used to find the equation of the line that is tangent to the graph of the function defined by the polynomial P(x) at a particular point x = r.[3] If R(x) is the remainder of the division of P(x) by (xr)2, then the equation of the tangent line at x = r to the graph of the function y = P(x) is y = R(x), regardless of whether or not r is a root of the polynomial.

Example

[edit]

Find the equation of the line that is tangent to the following curve

at:

Begin by dividing the polynomial by:

The tangent line is

Cyclic redundancy check

[edit]

A cyclic redundancy check uses the remainder of polynomial division to detect errors in transmitted messages.

See also

[edit]

References

[edit]
  1. ^ Archived at Ghostarchive and the Wayback Machine: Blomqvist's division: the simplest method for solving divisions?, retrieved 2019-12-10
  2. ^ S. Barnard (2008). Higher Algebra. READ BOOKS. p. 24. ISBN 978-1-4437-3086-0.
  3. ^ Strickland-Constable, Charles, "A simple method for finding tangents to polynomial graphs", Mathematical Gazette 89, November 2005: 466-467.