# Return to Answer

 2 added 4639 characters in body edited Dec 30 '14 at 17:31 Daniel Lichtblau 48.3k22 gold badges8080 silver badges167167 bronze badges [Note: Below is corrected from original response.]Reduce[(2 m + 42*m+4)^2 - 4 (m \[Minus] -2)^2 >= 0, m] (* Out[19]= m <= -6 ||Out[39]= m >= -(2/3)0 *) Solve[(2*m+4)^2 - 4*(m-2)^2 == k^2 && (m <= -6 || m >= -2/3)m>=0, {m, k}, Integers]  The (parametrized) result is tricky to work with but it does seem to be usable.--- edit --- We are looking for integer coefficients in the factorization. This gives some ammunition, for example, to attack the linear factor case. Suppose there is such a factorization, that is, at least one linear factor. Then it will have the form (x-k)*cubic (where the cubic might be further factorizable). So let's see what that would imply. Equating coefficients of linear times cubic with the given polynomial form yields the following.ss = SolveAlways[(x - k)*(x^3 + a*x^2 + b*x + c) == x^4 \[Minus] (2 m + 4) x^2 + (m \[Minus] 2)^2, x] (* Out[34]= {{a -> k, b -> -8 - 4 Sqrt[2] k - k^2, c -> -8 k - 4 Sqrt[2] k^2 - k^3, m -> 2 + 2 Sqrt[2] k + k^2}, {a -> k, b -> -8 + 4 Sqrt[2] k - k^2, c -> -8 k + 4 Sqrt[2] k^2 - k^3, m -> 2 - 2 Sqrt[2] k + k^2}} *)  Now let's see what the quartic polynomial becomes.Collect[Expand[(x - k)*(x^3 + a*x^2 + b*x + c) /. ss], x] (* {8 k^2 + 4 Sqrt[2] k^3 + k^4 + (-8 - 4 Sqrt[2] k - 2 k^2) x^2 + x^4, 8 k^2 - 4 Sqrt[2] k^3 + k^4 + (-8 + 4 Sqrt[2] k - 2 k^2) x^2 + x^4} *)  Since m is restricted to be an integer, we cannot obtain integer coefficients unless k has a factor involving sqrt(2). So we cannot have a linear factor with an integer root (negative of the constant term). (2m + 4) Now let's return to the quadratic timesx quadratic scenario. This can be handled simply by substituting y for x^2, that is, making the polynomial explicitly quadratic. Find the roots, then substitute back to rewrite in terms of x^2. The roots of the newly formed quadratic are given by the quadratic formula:((2*m + 4) +- Sqrt[(2*m + 4)^2-4*(m−2)^2]) / 2  Per specifications of the question, we require that these be integral and nonnegative. Note that my original formulation of the quadratic discriminant was missing a factor of 4 from the second term. Putting it in makes for an easier computation. I edited above to observe that the nonnegativity restriction simply implies that m>=0. So let's follow up from there. I remark that the k below is not related to the (nonexisting) one from the linear times cubic attempt.qsols = Solve[(2*m + 4)^2 - 4*(m - 2)^2 == k^2 && m >= 0, {m, k}, Integers] (* Out[40]= {{m -> ConditionalExpression[32 C[1]^2, C[1] \[Element] Integers], k -> ConditionalExpression[32 C[1], C[1] \[Element] Integers]}, {m -> ConditionalExpression[2 + 16 C[1] + 32 C[1]^2, C[1] \[Element] Integers], k -> ConditionalExpression[8 + 32 C[1], C[1] \[Element] Integers]}, {m -> ConditionalExpression[8 + 32 C[1] + 32 C[1]^2, C[1] \[Element] Integers], k -> ConditionalExpression[16 + 32 C[1], C[1] \[Element] Integers]}, {m -> ConditionalExpression[18 + 48 C[1] + 32 C[1]^2, C[1] \[Element] Integers], k -> ConditionalExpression[24 + 32 C[1], C[1] \[Element] Integers]}} *)  This just means that any integer value for the parametrized constant will give a viable solution. For example one can generate some as follows. Note that there is overlap from separate solution branches, hence the use of Union. polys = Union[Flatten[ Table[Expand[ x^4 \[Minus] (2 m + 4) x^2 + (m \[Minus] 2)^2 /. qsols /. C[1] -> j], {j, -4, 4}]]] (* Out[49]= {518400 - 1448 x^2 + x^4, 417316 - 1300 x^2 + x^4, 331776 - 1160 x^2 + x^4, 260100 - 1028 x^2 + x^4, 200704 - 904 x^2 + x^4, 152100 - 788 x^2 + x^4, 112896 - 680 x^2 + x^4, 81796 - 580 x^2 + x^4, 57600 - 488 x^2 + x^4, 39204 - 404 x^2 + x^4, 25600 - 328 x^2 + x^4, 15876 - 260 x^2 + x^4, 9216 - 200 x^2 + x^4, 4900 - 148 x^2 + x^4, 2304 - 104 x^2 + x^4, 900 - 68 x^2 + x^4, 256 - 40 x^2 + x^4, 36 - 20 x^2 + x^4, -8 x^2 + x^4, 4 - 4 x^2 + x^4} *) Factor[polys]  Notice that these do factor as desired.(* Out[50]= {(-800 + x^2) (-648 + x^2), (-722 + x^2) (-578 + x^2), (-648 + x^2) (-512 + x^2), (-578 + x^2) (-450 + x^2), (-512 + x^2) (-392 + x^2), (-450 + x^2) (-338 + x^2), (-392 + x^2) (-288 + x^2), (-338 + x^2) (-242 + x^2), (-288 + x^2) (-200 + x^2), (-242 + x^2) (-162 + x^2), (-200 + x^2) (-128 + x^2), (-162 + x^2) (-98 + x^2), (-128 + x^2) (-72 + x^2), (-98 + x^2) (-50 + x^2), (-72 + x^2) (-32 + x^2), (-50 + x^2) (-18 + x^2), (-32 + x^2) (-8 + x^2), (-18 + x^2) (-2 + x^2), x^2 (-8 + x^2), (-2 + x^2)^2} *) --- end edit --- Reduce[(2 m + 4)^2 - (m \[Minus] 2)^2 >= 0, m] (* Out[19]= m <= -6 || m >= -(2/3) *) Solve[(2*m+4)^2 - (m-2)^2 == k^2 && (m <= -6 || m >= -2/3), {m, k}, Integers]  The (parametrized) result is tricky to work with but it does seem to be usable. [Note: Below is corrected from original response.]Reduce[(2*m+4)^2 - 4 (m-2)^2 >= 0, m] (* Out[39]= m >= 0 *) Solve[(2*m+4)^2 - 4*(m-2)^2 == k^2 && m>=0, {m, k}, Integers]  The (parametrized) result is tricky to work with but it does seem to be usable.--- edit --- We are looking for integer coefficients in the factorization. This gives some ammunition, for example, to attack the linear factor case. Suppose there is such a factorization, that is, at least one linear factor. Then it will have the form (x-k)*cubic (where the cubic might be further factorizable). So let's see what that would imply. Equating coefficients of linear times cubic with the given polynomial form yields the following.ss = SolveAlways[(x - k)*(x^3 + a*x^2 + b*x + c) == x^4 \[Minus] (2 m + 4) x^2 + (m \[Minus] 2)^2, x] (* Out[34]= {{a -> k, b -> -8 - 4 Sqrt[2] k - k^2, c -> -8 k - 4 Sqrt[2] k^2 - k^3, m -> 2 + 2 Sqrt[2] k + k^2}, {a -> k, b -> -8 + 4 Sqrt[2] k - k^2, c -> -8 k + 4 Sqrt[2] k^2 - k^3, m -> 2 - 2 Sqrt[2] k + k^2}} *)  Now let's see what the quartic polynomial becomes.Collect[Expand[(x - k)*(x^3 + a*x^2 + b*x + c) /. ss], x] (* {8 k^2 + 4 Sqrt[2] k^3 + k^4 + (-8 - 4 Sqrt[2] k - 2 k^2) x^2 + x^4, 8 k^2 - 4 Sqrt[2] k^3 + k^4 + (-8 + 4 Sqrt[2] k - 2 k^2) x^2 + x^4} *)  Since m is restricted to be an integer, we cannot obtain integer coefficients unless k has a factor involving sqrt(2). So we cannot have a linear factor with an integer root (negative of the constant term). (2m + 4) Now let's return to the quadratic timesx quadratic scenario. This can be handled simply by substituting y for x^2, that is, making the polynomial explicitly quadratic. Find the roots, then substitute back to rewrite in terms of x^2. The roots of the newly formed quadratic are given by the quadratic formula:((2*m + 4) +- Sqrt[(2*m + 4)^2-4*(m−2)^2]) / 2  Per specifications of the question, we require that these be integral and nonnegative. Note that my original formulation of the quadratic discriminant was missing a factor of 4 from the second term. Putting it in makes for an easier computation. I edited above to observe that the nonnegativity restriction simply implies that m>=0. So let's follow up from there. I remark that the k below is not related to the (nonexisting) one from the linear times cubic attempt.qsols = Solve[(2*m + 4)^2 - 4*(m - 2)^2 == k^2 && m >= 0, {m, k}, Integers] (* Out[40]= {{m -> ConditionalExpression[32 C[1]^2, C[1] \[Element] Integers], k -> ConditionalExpression[32 C[1], C[1] \[Element] Integers]}, {m -> ConditionalExpression[2 + 16 C[1] + 32 C[1]^2, C[1] \[Element] Integers], k -> ConditionalExpression[8 + 32 C[1], C[1] \[Element] Integers]}, {m -> ConditionalExpression[8 + 32 C[1] + 32 C[1]^2, C[1] \[Element] Integers], k -> ConditionalExpression[16 + 32 C[1], C[1] \[Element] Integers]}, {m -> ConditionalExpression[18 + 48 C[1] + 32 C[1]^2, C[1] \[Element] Integers], k -> ConditionalExpression[24 + 32 C[1], C[1] \[Element] Integers]}} *)  This just means that any integer value for the parametrized constant will give a viable solution. For example one can generate some as follows. Note that there is overlap from separate solution branches, hence the use of Union. polys = Union[Flatten[ Table[Expand[ x^4 \[Minus] (2 m + 4) x^2 + (m \[Minus] 2)^2 /. qsols /. C[1] -> j], {j, -4, 4}]]] (* Out[49]= {518400 - 1448 x^2 + x^4, 417316 - 1300 x^2 + x^4, 331776 - 1160 x^2 + x^4, 260100 - 1028 x^2 + x^4, 200704 - 904 x^2 + x^4, 152100 - 788 x^2 + x^4, 112896 - 680 x^2 + x^4, 81796 - 580 x^2 + x^4, 57600 - 488 x^2 + x^4, 39204 - 404 x^2 + x^4, 25600 - 328 x^2 + x^4, 15876 - 260 x^2 + x^4, 9216 - 200 x^2 + x^4, 4900 - 148 x^2 + x^4, 2304 - 104 x^2 + x^4, 900 - 68 x^2 + x^4, 256 - 40 x^2 + x^4, 36 - 20 x^2 + x^4, -8 x^2 + x^4, 4 - 4 x^2 + x^4} *) Factor[polys]  Notice that these do factor as desired.(* Out[50]= {(-800 + x^2) (-648 + x^2), (-722 + x^2) (-578 + x^2), (-648 + x^2) (-512 + x^2), (-578 + x^2) (-450 + x^2), (-512 + x^2) (-392 + x^2), (-450 + x^2) (-338 + x^2), (-392 + x^2) (-288 + x^2), (-338 + x^2) (-242 + x^2), (-288 + x^2) (-200 + x^2), (-242 + x^2) (-162 + x^2), (-200 + x^2) (-128 + x^2), (-162 + x^2) (-98 + x^2), (-128 + x^2) (-72 + x^2), (-98 + x^2) (-50 + x^2), (-72 + x^2) (-32 + x^2), (-50 + x^2) (-18 + x^2), (-32 + x^2) (-8 + x^2), (-18 + x^2) (-2 + x^2), x^2 (-8 + x^2), (-2 + x^2)^2} *) --- end edit --- 1 answered Dec 30 '14 at 16:21 Daniel Lichtblau 48.3k22 gold badges8080 silver badges167167 bronze badges I'm not entirely sure what you are looking for. Do the factors need to have integer coefficients? If not, then you get a factorization into quadratics just by noting you have a polynomial in x^2 and hence can use the quadratic formula. The nonnegativity of both roots will follow, in this specific example, provided the discriminant is nonnegative. Reduce[(2 m + 4)^2 - (m \[Minus] 2)^2 >= 0, m] (* Out[19]= m <= -6 || m >= -(2/3) *)  From here you might want to investigate the linear factors, I'm not sure. If you are looking for integer coefficients in the factors, could work with this. Solve[(2*m+4)^2 - (m-2)^2 == k^2 && (m <= -6 || m >= -2/3), {m, k}, Integers]  The (parametrized) result is tricky to work with but it does seem to be usable.