We decompose the integer and the polynomial into multipliers.
We recall the school method of dividing into a column.
Any integer can be decomposed into prime factors.
To do this, it is necessary to consistently divide itOn numbers starting at 2. And it can happen that some numbers will enter the expansion more than once. That is, dividing the number by 2, do not rush to move to the top three, again try to divide it into two.
And then the signs of divisibility will help us: divide even numbers by 2, divide by 3 if the sum of the digits included in it is divided by three, by 5 divide the numbers ending in 0 and 5.
Sharing is best in the column. Beginning with the left digit of the number (or two left digits), divide the number by the corresponding factor, write the result in the quotient. Then multiply the intermediate quotient by the divisor and subtract from the selected part of the dividend. If the number is divided by its assumed prime multiplier, then the remainder should result in zero.
The polynomial can also be factorized.
Here different approaches are possible: You can try to group the terms, you can use the known formulas of reduced multiplication (difference of squares, square of sum / difference, cube of sum / difference, difference of cubes).
You can also use the selection method: If the number you selected came up as a solution, then you can divide the original polynomial into the expression (x- (this is the number found)). For example, a column. The polynomials will be divided completely, and its degree will decrease by one. It must be remembered that a polynomial of degree P has no more than P distinct roots, but the roots may coincide, so try substituting the above number into a simplified polynomial - it is quite possible that the division by a column can be repeated again.
The resulting total is written as a product of expressions of the form (x- (root 1)) * (x- (root 2)) ... etc.