# Algebraic Greatest Common Factor

This article shows how to calculate algebraic Greatest Common Factor by means of simple examples.

In Case 1 the method produces a unique GCF (if there is one).

In Case 2 the method produces several possibilities, any one of which could be the GCF depending on parameters supplied.

In Case 3 the method solves for a given variable if there are two equations containing two variables.

## Case 1: the unique GCF

Let two functions (f1) and (f2) be defined as follows:

${\displaystyle 3x^{3}+23x^{2}-19x-231}$ .... (f1)

${\displaystyle 6x^{3}+31x^{2}-162x-715}$ .... (f2)

The aim is to produce the GCF of (f1) and (f2).

(f1) and (f2) both have maximum power of x equal to 3 and they are not identical. Continue. Use (f1) and (f2) to produce two functions in which the maximum power of x equals 2.

2(f1) - (f2), ${\displaystyle 15x^{2}+124x+253}$ .... (f3)

715(f1) - 231(f2), ${\displaystyle 69x^{2}+844x+2167}$ .... (f4)

(f3) and (f4) both have maximum power of x equal to 2 and they are not identical. Continue. Use (f3) and (f4) to produce two functions in which the maximum power of x equals 1.

15(f4) - 69(f3), ${\displaystyle 3x+11}$ .... (f5)

2167(f3) - 253(f4), ${\displaystyle 3x+11}$ .... (f6)

(f5) and (f6) are identical. Therefore ${\displaystyle (3x+11)}$ is the GCF of (f1) and (f2).

## Case 2: solving the cubic

We will use the method to predict whether or not a given cubic function contains equal roots and, if so, how to calculate equal roots.

Equal roots occur where the function and the slope of the function both equal 0.

{\displaystyle {\begin{aligned}&ax^{3}+bx^{2}+cx+d\,\,\,\,....\,\,\,\,(f0)\\&3ax^{2}+2bx+c\,\,\,\,....\,\,\,\,(f1)\end{aligned}}}

The cubic is given by (f0) and its derivative by (f1). The aim is to find the GCF of (f0) and (f1).

(f0) contains maximum power of x equal to 3. (f1) contains maximum power of x equal to 2.

Combine (f0) and (f1) to produce a second function containing maximum power of x equal to 2.

${\displaystyle c(f0)-d(f1),\,\,\,\,(+ac)xx+(-3ad+bc)x+(-2bd+cc)\,\,\,\,....\,\,\,\,(f2)}$

(f1) and (f2) both have maximum power of x equal to 2. Use (f1) and (f2) to produce two functions in which the maximum power of x equals 1.

{\displaystyle {\begin{aligned}c(f2)-(-2bd+cc)(f1),\,\,\,\,&(+6abd-2acc)x+(-3acd+4bbd-bcc)\,\,\,\,....\,\,\,\,(f3)\\3a(f2)-ac(f1),\,\,\,\,&(-9ad+bc)x+(-6bd+2cc)\,\,\,\,....\,\,\,\,(f4)\end{aligned}}}

(f3) and (f4) both have maximum power of x equal to 1. Use (f3) and (f4) to produce two values in which the variable x has been eliminated.

{\displaystyle {\begin{aligned}(+6abd-2acc)(f4)-(-9ad+bc)(f3),\,\,\,\,&-27aadd+18abcd-4accc-4bbbd+bbcc\,\,\,\,....\,\,\,\,(f5)\\(-6bd+2cc)(f3)-(-3acd+4bbd-bcc)(f4),\,\,\,\,&-27aadd+18abcd-4accc-4bbbd+bbcc\,\,\,\,....\,\,\,\,(f6)\end{aligned}}}

(f5) and (f6) are identical, showing that we have not made any mistakes. Note that (f5) is the discriminant of the solution of the cubic equation.

Look at (f3) and (f4) again. From (f3) and (f4):

{\displaystyle {\begin{aligned}&x={\frac {-(-3acd+4bbd-bcc)}{(+6abd-2acc)}}={\frac {-(-6bd+2cc)}{(-9ad+bc)}}\\\\&-(-6bd+2cc)(+6abd-2acc)=-(-3acd+4bbd-bcc)(-9ad+bc)\\\\&(-6bd+2cc)(+6abd-2acc)-(-3acd+4bbd-bcc)(-9ad+bc)=0\\\\&(-6bd+2cc)(+6abd-2acc)-(-3acd+4bbd-bcc)(-9ad+bc)\\\\&=-27aacdd+18abccd-4acccc-4bbbcd+bbccc\\\\&=c(-27aadd+18abcd-4accc-4bbbd+bbcc)\\\end{aligned}}}

where ${\displaystyle (-27aadd+18abcd-4accc-4bbbd+bbcc)}$

= the discriminant of the solution of the cubic equation.

Example 1

${\displaystyle (+2)x^{3}+(-3)x^{2}+(-44)x+(+105)\ ....\ (e1)}$

Produce (f3) and (f4) for (e1).

{\displaystyle {\begin{aligned}+9327-2881x\ ....\ (f3)\\\\+2881-879x\ ....\ (f4)\end{aligned}}}

(f3) and (f4) are not identical. (f5) is non-zero and there are no equal roots.

Example 2

${\displaystyle (+4)x^{3}+(-40)x^{2}+(+133)x+(-147)\ ....\ (e2)}$

Produce (f3) and (f4) for (e2).

{\displaystyle {\begin{aligned}+7-2x\ ....\ (f3)\\\\+7-2x\ ....\ (f4)\end{aligned}}}

(f3) and (f4) are identical. (f5) is zero and (e2) contains exactly two roots equal to 7/2.

Example 3

${\displaystyle (+27)x^{3}+(+297)x^{2}+(+1089)x+(+1331)\ ....\ (e3)}$

Produce (f3) and (f4) for (e3).

0 .... (f3)

0 .... (f4)

(f3) and (f4) are identical, although null. (f5) is zero and (e3) contains equal roots. To identify the roots, produce (f1) and (f2) for (e3).

{\displaystyle {\begin{aligned}+121+66x+9xx\ ....\ (f1)\\\\+121+66x+9xx\ ....\ (f2)\end{aligned}}}

(f1) and (f2) are identical with discriminant 0, as expected.

From ${\displaystyle (f1),\ \ x=-66/(2*9)=-11/3,}$ and (e3) contains three roots equal to -11/3.

## Case 3: Solving for a given variable in two equations with two unknowns.

Let two functions in ${\displaystyle p}$ and ${\displaystyle Q}$ be defined as follows:

{\displaystyle {\begin{aligned}ap^{3}+3apQ+bp^{2}+bQ+cp+d\ ....\ (f0)\\3ap^{2}+aQ+2bp+c\ ....\ (f1)\end{aligned}}}

In functions (f0) and (f1) the values ${\displaystyle a,b,c,d}$ are constants. The aim is to eliminate ${\displaystyle p}$ and produce a function in ${\displaystyle Q}$. Express both functions as functions in ${\displaystyle p}$.

{\displaystyle {\begin{aligned}(+a)ppp+(+b)pp+(+3Qa+c)p+(+Qb+d)\ ....\ (f2)\\(+3a)pp+(+2b)p+(+Qa+c)\ ....\ (f3)\end{aligned}}}

(f2) contains maximum power of ${\displaystyle p}$ equal to 3. (f3) contains maximum power of ${\displaystyle p}$ equal to 2.

Combine (f2) and (f3) to produce a second function containing maximum power of ${\displaystyle p}$ equal to 2.

{\displaystyle {\begin{aligned}(+Qa+c)(f2)-(+Qb+d)(f3),\\&\\(+Qaa+ac)&pp+\\(-2Qab-3ad+bc)&p+\\(+3QQaa+4Qac-2Qbb-2bd+cc)&\ ....\ (f4)\end{aligned}}}

(f3) and (f4) both have maximum power of ${\displaystyle p}$ equal to 2. Use (f3) and (f4) to produce two functions in which the maximum power of ${\displaystyle p}$ equals 1.

{\displaystyle {\begin{aligned}(3a)(f4)-(+Qaa+ac)(f3),\\&\\(-8Qab-9ad+bc)&p+\\(+8QQaa+10Qac-6Qbb-6bd+2cc)&\ ....\ (f5)\\\\(+Qa+c)(f4)-(+3QQaa+4Qac-2Qbb-2bd+cc)(f3),\\&\\(-8QQaaa-10Qaac+6Qabb+6abd-2acc)&p+\\(-8QQaab-3Qaad-9Qabc+4Qbbb-3acd+4bbd-bcc)&\ ....\ (f6)\end{aligned}}}

(f5) and (f6) both have maximum power of ${\displaystyle p}$ equal to 1. Use (f5) and (f6) to produce two values in which the variable ${\displaystyle p}$ has been eliminated.

from (f5), let

${\displaystyle c15=-8Qab-9ad+bc,}$

and let

${\displaystyle c05=+8QQaa+10Qac-6Qbb-6bd+2cc.}$

from (f6), let

${\displaystyle c16=-8QQaaa-10Qaac+6Qabb+6abd-2acc,}$

and let

${\displaystyle c06=-8QQaab-3Qaad-9Qabc+4Qbbb-3acd+4bbd-bcc.}$

{\displaystyle {\begin{aligned}&(c15)(f6)-(c16)(f5),\\\\&+64QQQQaaaaa+160QQQaaaac-32QQQaaabb+132QQaaacc-56QQaabbc+4QQabbbb+27Qaaadd\\&-18Qaabcd+40Qaaccc+4Qabbbd-25Qabbcc+4Qbbbbc+27aacdd-18abccd+4acccc+4bbbcd-bbccc\dots (f7)\\\\&(c06)(f5)-(c05)(f6),\\\\&+64QQQQaaaaa+160QQQaaaac-32QQQaaabb+132QQaaacc-56QQaabbc+4QQabbbb+27Qaaadd\\&-18Qaabcd+40Qaaccc+4Qabbbd-25Qabbcc+4Qbbbbc+27aacdd-18abccd+4acccc+4bbbcd-bbccc\dots (f8)\end{aligned}}}

(f7) and (f8) are identical. ${\displaystyle p}$ has been eliminated from (f7). Express (f7) as a function in Q.

{\displaystyle {\begin{aligned}(+64aaaaa)&Q^{4}+\\(+160aaaac-32aaabb)&Q^{3}+\\(+132aaacc-56aabbc+4abbbb)&Q^{2}+\\(+27aaadd-18aabcd+40aaccc+4abbbd-25abbcc+4bbbbc)&Q+\\(+27aacdd-18abccd+4acccc+4bbbcd-bbccc)&\ \dots \ (f9)\end{aligned}}}

The constant term of (f9)

{\displaystyle {\begin{aligned}&=+27aacdd-18abccd+4acccc+4bbbcd-bbccc\\&=c(+27aadd-18abcd+4accc+4bbbd-bbcc)\end{aligned}}}

where ${\displaystyle (+27aadd-18abcd+4accc+4bbbd-bbcc)}$ is the discriminant of the solution of the cubic.

This method has combined (f0) and (f1) to eliminate ${\displaystyle p}$ and produce a function in Q.