# 6.5: Factoring by Grouping

## Using Grouping to Factor a Polynomial

Sometimes a polynomial will not have a particular factor common to every term. However, we may still be able to produce a factored form for the polynomial.

The polynomial (x^3+3x^2−6x−18) has no single factor that is common to every term. However, we notice that if we group together the first two terms and the second two terms, we see that each resulting binomial has a particular factor common to both terms. Factor (x^2) out of the first two terms, and factor (-6) out of the second two terms.

(x^2(x+3) - 6(x+3))

Now look closely at the binomial. Each of the two terms contains the factor (x+3).

Factor out ((x+3)).

((x+3)(x^2-6)) is the final factorization

(x^3+3x^2−6x−18 = (x+3)(x^2-6))

## Knowing when to Try the Grouping Method

We are alerted to the idea of grouping when the polynomial we are considering has either of these qualities:

1. no factor common to all terms
2. an even number of terms

When factoring by grouping, the sign ((+) or (−)) of the factor we are taking out will usually (but not always) be the same as the sign of the first term in that group.

## Sample Set A

Example (PageIndex{1})

Factor (8a^2b^4 - 4b^4 + 14a^2 - 7)

1. We notice there is no factor common to all terms.
2. We see there are four terms, an even number.
3. We see that terms 1 and 2 have (+4b^4) in common (since the 1st term in the group is (+8a^2b^4)).
4. We notice that the 3rd and 4th terms have (+7) in common (since the 1st term in the group is (+14a^2)). (8a^2b^4-4b^4+14a^2-7 = (2a^2-1)(4b^4+7))

## Practice Set A

Use the grouping method to factor the following polynomials.

Practice Problem (PageIndex{1})

(ax+ay+bx+by)

((a+b) (x+y))

Practice Problem (PageIndex{2})

(2am+8m+5an+20n)

((2m+5n) (a+4))

Practice Problem (PageIndex{3})

(a^2x^3 + 4a^2y^3 + 3bx^3 + 12by^3)

((a^2+3b)(x^3 + 4y^3))

Practice Problem (PageIndex{4})

(15mx+10nx−6my−4ny)

((5x−2y) (3m+2n))

Practice Problem (PageIndex{5})

(40abx - 24abxy - 35c^2x + 21c^2xy)

(x(8ab−7c^2) (5−3y))

Practice Problem (PageIndex{6})

When factoring the polynomial (8a^2b^4−4b^4+14a^2−78) in Sample Set A, we grouped together terms 1 and 2 and 3 and 4. Could we have grouped together terms1 and 3 and 2 and 4? Try this.

(8a^2b^4−4b^4+14a^2−78 =)

Yes

Do we get the same result? If the results do not look precisely the same, recall the commutative property of multiplication.

## Exercises

For the following problems, use the grouping method to factor the polynomials. Some polynomials may not be factorable using the grouping method.

Exercise (PageIndex{1})

(2ab+3a+18b+27)

((2b+3)(a+9))

Exercise (PageIndex{2})

(xy−7x+4y−28)

Exercise (PageIndex{3})

(xy+x+3y+3)

((y+1)(x+3))

Exercise (PageIndex{4})

(mp+3mq+np+3nq)

Exercise (PageIndex{5})

(ar+4as+5br+20bs)

((a+5b)(r+4s))

Exercise (PageIndex{6})

(14ax−6bx+21ay−9by)

Exercise (PageIndex{7})

(12mx−6bx+21ay−9by)

(3(4mx−2bx+7ay−3by)) Not factorable by grouping

Exercise (PageIndex{8})

(36ak−8ah−27bk+6bh)

Exercise (PageIndex{9})

(a^2b^2 + 2a^2 + 3b^2 + 6)

((a^2+3)(b^2+2))

Exercise (PageIndex{10})

(3n^2 + 6n + 9m^3 + 12m)

Exercise (PageIndex{11})

(8y^4 - 5y^3 + 12z^2 - 10z)

Not factorable by grouping

Exercise (PageIndex{12})

(x^2 + 4x - 3y^2 + y)

Exercise (PageIndex{13})

(x^2 - 3x + xy - 3y)

((x+y)(x−3))

Exercise (PageIndex{14})

(2n^2+12n−5mn−30m)

Exercise (PageIndex{15})

(4pq−7p+3q^2−21)

Not factorable by grouping

Exercise (PageIndex{16})

(8x^2+16xy−5x−10y)

Exercise (PageIndex{17})

(12s^2−27s−8st+18t)

((4s−9)(3s−2t))

Exercise (PageIndex{18})

(15x^2−12x−10xy+8y)

Exercise (PageIndex{19})

(a^4b^4+3a^5b^5+2a^2b^2+6a^3b^3)

(a^2b^2(a^2b^2 + 2)(1 + 3ab))

Exercise (PageIndex{20})

(4a^3bc−14a^2bc^3+10abc^2−35bc^4)

Exercise (PageIndex{21})

(5x^2y^3z+3x^3yw−10y^3z^2−6wxyz)

(y(5y^2z+3xw)(x^2−2z))

Exercise (PageIndex{22})

(a^3b^2cd+abc^2dx−a^2bxy−cx^2y)

Exercise (PageIndex{23})

(5m^{10}n^{17}p^3 - m^6n^7p^4 - 40m^4n^{10}qt^2 + 8pqt^2)

((m^6n^7p^3−8qt^2)(5m^4n^{10}−p))

## Exercises for Review

Exercise (PageIndex{24})

Simplify ((x^5y^3)(x^2y))

Exercise (PageIndex{25})

Use scientific notation to find the product of ((3 imes 10^{-5})(2 imes 10^2)).

(6 imes 10^{-3})

Exercise (PageIndex{26})

Find the domain of the equation (y = dfrac{6}{x+5})

Exercise (PageIndex{27})

Construct the graph of the inequality (y ge -2)  Exercise (PageIndex{28})

Factor (8a^4b^4 + 12a^3b^5 - 8a^2b^3)

## Factor by Grouping – Methods & Examples

Now that you have learned how to factor polynomials by using different methods such as Greatest Common Factor (GCF, Sum or difference in two cubes Difference in two squares method and Trinomial method.

Which method do you find simplest among these?

All these methods of factoring polynomials are as easy as ABC, only if they are applied correctly.

In this article, we will learn another simplest method known as factoring by Grouping, but before getting into this topic of factoring by grouping, let’s discuss what factoring a polynomial is.

A polynomial is an algebraic expression with one or more terms in which an addition or a subtraction sign separates a constant and a variable.

The general form of a polynomial is ax n + bx n-1 + cx n-2 + …. + kx + l, where each variable has a constant accompanying it as its coefficient. The different types of polynomials include binomials, trinomials, and quadrinomial.

Examples of polynomials are 12x + 15, 6x 2 + 3xy – 2ax – ay, 6x 2 + 3x + 20x + 10 etc.

## Factoring by Grouping

Factoring by grouping involves grouping terms then factoring out common factors. Here are examples of how to factor by grouping:

Example with trinomial:
#3x^2 - 16x - 12# , where #ax^2 = 3x^2, bx = -16x, c=-12# .

To use grouping method you need to multiply #ax^2# and #c# , which is #-36x^2# in this example. Now you need to find two terns that multiplied gives you #-36x^2# but add to -16x. Those terms are -18x and 2x. We now can replace #bx# with those two terms:
#3x^2 - 16x - 12#
#3x^2 - 18x + 2x - 12#

Group the expression by two:
#(3x^2 - 18x) + (2x - 12)#

Factor out GCF in each group:
#3x(x - 6) + 2(x - 6)#
(The binomials in parentheses should be the same, if not the same. there is an error in the factoring or the expression can not be factored.)

The next step is factoring out the GCF which basically has you rewrite what is in parentheses and place other terms left together:
#(x - 6)(3x +2)# (THE ANSWER)

Example with polynomial:
#xy - 3x - 6y + 18#

Group the expression by two:
#(xy - 3x) - (6y - 18)#
Careful with the sign outside before parenthesis.. changes sign of the 18.

Factor out GCF in each group:
#x(y - 3) - 6(y - 3)#
(The binomials in parentheses should be the same, if not the same. there is an error in the factoring or the expression can not be factored.)

The next step is factoring out the GCF which basically has you rewrite what is in parentheses and place other terms left together:
(y - 3)(x - 6) (THE ANSWER)

## Use a Factoring Calculator  If there is a problem you don't know how to solve, our calculator will help you. There are many assignments that seem confusing and strange. Your teacher might have missed an important bit of information that can help you solve it. If so, our calculator is exactly what you need. You just enter the problem term by term and get a step-by-step solution. It is logical that getting an instant result is not helpful as you don't know the steps that led to that solution. This calculator shows you how the solution was obtained. Once you understand the algorithm, you can then solve all the similar assignments you have in your homework. And here are some of the examples of solving problems by factoring:   To make my homework faster, I use this factoring calculator. It takes a few seconds to enter an expression and get an instant answer

## Contents

The Gestalt law of proximity states that "objects or shapes that are close to one another appear to form groups". Even if the shapes, sizes, and objects are radically different, they will appear as a group if they are close.

• Refers to the way smaller elements are "assembled" in a composition.
• Also called "grouping", the principle concerns the effect generated when the collective presence of the set of elements becomes more meaningful than their presence as separate elements. (It also depends on a correct order for comprehension.)
• Grouping the words also changes the visual and psychological meaning of the composition in non-verbal ways unrelated to their meaning.
• Elements which are grouped together create the illusion of shapes or planes in space, even if the elements are not touching.
• Grouping of this sort can be achieved with tone or value, color, shape, size, or other physical attributes. [citation needed]

The principle of similarity states that perception lends itself to seeing stimuli that physically resemble each other as part of the same object. This allows for people to distinguish between adjacent and overlapping objects based on their visual texture and resemblance. Other stimuli that have different features are generally not perceived as part of the object. An example of this is a large area of land used by numerous independent farmers to grow crops. The human brain uses similarity to distinguish between objects which might lie adjacent to or overlap with each other based upon their visual texture. Each farmer may use a unique planting style which distinguishes his field from another. Another example is a field of flowers which differ only by color. [ citation needed ]

The principles of similarity and proximity often work together to form a Visual Hierarchy. Either principle can dominate the other, depending on the application and combination of the two. For example, in the grid to the left, the similarity principle dominates the proximity principle the rows are probably seen before the columns.

The principle of closure refers to the mind's tendency to see complete figures or forms even if a picture is incomplete, partially hidden by other objects, or if part of the information needed to make a complete picture in the minds is missing. For example, if part of a shape's border is missing people still tend to see the shape as completely enclosed by the border and ignore the gaps. This reaction stems from the mind's natural tendency to recognize patterns that are familiar and thus fill in any information that may be missing.

Closure is also thought [ citation needed ] to have evolved from ancestral survival instincts in that if one was to partially see a predator their mind would automatically complete the picture and know that it was a time to react to potential danger even if not all the necessary information was readily available.

When there is an intersection between two or more objects, people tend to perceive each object as a single uninterrupted object. This allows differentiation of stimuli even when they come in visual overlap. Humans have a tendency to group and organize lines or curves that follow an established direction over those defined by sharp and abrupt changes in direction. [ citation needed ]

When visual elements are seen moving in the same direction at the same rate (optical flow), perception associates the movement as part of the same stimulus. For example, birds may be distinguished from their background as a single flock because they are moving in the same direction and at the same velocity, even when each bird is seen—from a distance—as little more than a dot. The moving 'dots' appear to be part of a unified whole. Similarly, two flocks of birds can cross each other in a viewer's visual field, but they will nonetheless continue to be experienced as separate flocks because each bird has a direction common to its flock. [ citation needed ]

This allows people to make out moving objects even when other details (such as the objects color or outline) are obscured. This ability likely arose from the evolutionary need to distinguish a camouflaged predator from its background.

The law of common fate is used extensively in user-interface design, for example where the movement of a scrollbar is synchronised with the movement (i.e. cropping) of a window's content viewport the movement of a physical mouse is synchronised with the movement of an on-screen arrow cursor, and so on.

The principle of good form refers to the tendency to group together forms of similar shape, pattern, color, etc. Even in cases where two or more forms clearly overlap, the human brain interprets them in a way that allows people to differentiate different patterns and/or shapes. An example would be a pile of presents where a dozen packages of different size and shape are wrapped in just three or so patterns of wrapping paper, or the Olympic Rings.

You can see underlying group data with group_keys() . It has one row for each group and one column for each grouping variable:

You can see which group each row belongs to with group_indices() :

And which rows each group contains with group_rows() :

Use group_vars() if you just want the names of the grouping variables:

### Changing and adding to grouping variables

If you apply group_by() to an already grouped dataset, will overwrite the existing grouping variables. For example, the following code groups by homeworld instead of species :

To augment the grouping, using .add = TRUE 1 . For example, the following code groups by species and homeworld:

### Removing grouping variables

To remove all grouping variables, use ungroup() :

You can also choose to selectively ungroup by listing the variables you want to remove:

Just below the class name on an API doc page is a row of buttons corresponding to the types of members owned by the current class. Each button shows a count of members by type (this count is updated as filters are applied). Clicking the button will navigate you to that member section. Hovering over the member-type button will reveal a popup menu of all members of that type for quick navigation.

### Getter and Setter Methods

Getting and setter methods that correlate to a class config option will show up in the methods section as well as in the configs section of both the API doc and the member-type menus just beneath the config they work with. The getter and setter method documentation will be found in the config row for easy reference.

### History Bar

Your page history is kept in localstorage and displayed (using the available real estate) just below the top title bar. By default, the only search results shown are the pages matching the product / version you're currently viewing. You can expand what is displayed by clicking on the button on the right-hand side of the history bar and choosing the "All" radio option. This will show all recent pages in the history bar for all products / versions.

Within the history config menu you will also see a listing of your recent page visits. The results are filtered by the "Current Product / Version" and "All" radio options. Clicking on the button will clear the history bar as well as the history kept in local storage.

If "All" is selected in the history config menu the checkbox option for "Show product details in the history bar" will be enabled. When checked, the product/version for each historic page will show alongside the page name in the history bar. Hovering the cursor over the page names in the history bar will also show the product/version as a tooltip.

### Search and Filters

Both API docs and guides can be searched for using the search field at the top of the page.

On API doc pages there is also a filter input field that filters the member rows using the filter string. In addition to filtering by string you can filter the class members by access level, inheritance, and read only. This is done using the checkboxes at the top of the page.

The checkbox at the bottom of the API class navigation tree filters the class list to include or exclude private classes.

Clicking on an empty search field will show your last 10 searches for quick navigation.

Each API doc page (with the exception of Javascript primitives pages) has a menu view of metadata relating to that class. This metadata view will have one or more of the following:

• Alternate Name - One or more additional class name synonymns (in Ext JS 6.0.0 the Ext.button.Button class has an alternate class name of Ext.Button ). Alternate class names are commonly maintained for backward compatibility.
• Hierarchy - The hierararchy view lists the inheritance chain of the current class up through its ancestor classes up to the root base class.
• Mixins - A list of classes that are mixed into the current class
• Inherited Mixins - A list of classes that are mixed into an ancestor of the current class
• Requires - All classes required to be defined for the class to be instantiated
• Uses - A list of classes potentially used by the class at some point in its lifecycle, but not necessarily requried for the class to initially be instantiated
• Subclasses - Classes that extend the current class

### Expanding and Collapsing Examples and Class Members

Runnable examples (Fiddles) are expanded on a page by default. You can collapse and expand example code blocks individually using the arrow on the top-left of the code block. You can also toggle the collapse state of all examples using the toggle button on the top-right of the page. The toggle-all state will be remembered between page loads.

Class members are collapsed on a page by default. You can expand and collapse members using the arrow icon on the left of the member row or globally using the expand / collapse all toggle button top-right.

### Desktop -vs- Mobile View

Viewing the docs on narrower screens or browsers will result in a view optimized for a smaller form factor. The primary differences between the desktop and "mobile" view are:

• Global navigation will be located in a menu on the left-hand side accessible via the hamburger menu icon. The menu houses the following (on most pages):
• The name of the current product (as a link to the product landing page)
• The Sencha icon used to navigate back to the documentation home page
• The product menu drop-down button
• Tabs of navigation trees for the API docs and guides
• The global search input field
• (API doc) A "Filters" tab with the member filter, expand / collapse all examples button, expand / collapse all member rows button, the access level filter checkboxes, and the counts of each member
• (API doc) A "Related Classes" tab containing the menu of metadata related to the current class

### Viewing the Class Source

The class source can be viewed by clicking on the class name at the top of an API doc page. The source for class members can be viewed by clicking on the "view source" link on the right-hand side of the member row.

## 6.5: Factoring by Grouping ### By grouping

Sometimes it is impossible to factor a polynomial by finding the greatest common factor. For instance, the polynomial (3xy - 24x^2 - 7y +56x) has no greatest common factor. In this case we can try searching the polynomial for factors that are common to some of the terms. Then we can attempt a method known as grouping.

Take the polynomial and separate it into two groups. We have

(3xy - 24x^2 - 7y + 56x = (3xy - 24x^2) + (-7y + 56x))

Now check each group for any common factors. In the binomial ((3xy - 24x^2)) we see that there is a common factor of (3x). We factor out this common term to obtain ( 3x(y -8x)). Checking the second binomial((-7y + 56x)) we see that (-7) is a common factor. We factor it out to obtain (-7(y - 8x)). Then our polynomial becomes

(3xy - 24x^2 - 7y + 56x = (3xy - 24x^2) + (-7y + 56x) = 3x(y - 8x) - 7(y - 8x))

In effect, we have created a new greatest common factor of this polynomial…((y - 8x)). We factor it out of both terms to obtain

(3x(y - 8x) - 7(y - 8x) = (y - 8x)(3x - 7))

Finally we see that the correct factorization of the original polynomial is

(3xy - 24x^2 - 7y + 56x = (y - 8x)(3x - 7))

Always check you work to see that the factorization is true. We have just factored by grouping!

Let’s try another example: Consider the polynomial

Before we attempt to factor by grouping, we see that there is a factor of (4) common to each term in this polynomial. We factor it out and have

(120uv + 192u + 100v + 160 = 4(30uv + 48u + 25v + 40))

Now we attempt the grouping method. Separate the polynomial into two “groups.”

(4(30uv + 48u + 25v + 40) = 4[(30uv + 48u) + (25v + 40)])

Check for a common factor in the first group ((30uv + 48u)). We see that (6u) is a common factor. Factor it out to obtain (6u(5v + 8)).

Check for a common factor in the second group ((25v + 40)). We see that (5) is a common factor. Factor it out to obtain (5(5v + 8)).

Then our polynomial factors as:

(120uv + 192u + 100v + 160 = 4(30uv + 48u + 25v + 40))

Do you catch the common factor we’ve created? It’s ( 5v + 8)!

Factor this out and we’re done.

(4[6u(5v + 8) + 5(5v + 8)] = 4(5v + 8)(6u + 5))

So then our final factorization is

(120uv + 192u + 100v + 160 = 4(5v + 8)(6u + 5))

### Example 1: Factor: 2 + 7a + 6a 2

Question: Are there two factors of 2(6) = 12 whose sum (because the last # is positive) is 7 (middle number)?

Answer: Yes, 4 and 3. So this problem will factor.

Rewrite the original problem and factor by grouping.

2 + 7a + 6a 2 Original expression
2 + 4a + 3a + 6a 2 Rewrite the 7a as 4a + 3a , putting the largest value first and using the same sign as the original middle value
2 (1 + 2a) + 3a (1 + 2a) Factor by grouping.
( 2 + 3a ) ( 1 + 2a ) The (1 + 2a) is a common factor for both terms

### Example 2: Factor 2x 2 + 7x - 15

Question: Are there two factors of 2(15) = 30 whose difference (because the last # is negative) is 7 (middle number)?

Rewrite the original problem and factor by grouping.

2x 2 + 7x - 15 Original expression
2x 2 + 10x - 3x - 15 Rewrite the 7x as 10x - 3x , putting the largest value first and using the same sign as the original middle value
2x (x + 5) - 3(x + 5) Factor by grouping.
(2x - 3) (x + 5) The (x + 5) is a common factor for both terms

Notice how there is a common factor between the two terms after grouping the first two together and the last two together.This is NOT A COINCIDENCE! If you can answer yes to the question, it will factor in this method.

### Example 3: Factor 3x 2 - 5x + 4

Question: Are there two factors of 3(4) = 12 whose sum (because the last # is positive) is 5 (middle number - ignore the sign)?

Answer: NO! The problem won't factor, write "prime" and go on.

### Example 4: Factor 600 - 800t - 800t 2

Factor out the greatest common factor of 200 first to get 200 ( 3 - 4t - 4t 2 )

Question: Are there two factors of 3(4) = 12 whose difference (because the last # is negative) is 4 (middle number - ignore the sign)?

## 6.5: Factoring by Grouping  Directions: Answer these questions pertaining to factoring by grouping. In the factoring questions, only completely factored answers are deemed as correct.

Factor completely: 3a 3 + 12a 2 + a + 4 Factor completely: 2x 3 + 6x 2 - 4x - 12 Factor completely: 3x 2 + xy 2 - 3xy - y 3  Factor completely: 3n 3 + 2n 2 - 3n - 2 When a 2 (a + b) 4 - b 2 (a + b) 4 is expressed as
(a + b) m (a - b), what is the value of m?   Factor by grouping: 2ax 2 + 3axy - 2nxy - 3ny 2