# Factorization of a real polynomial

Can I factor univariate polynomials with real coefficients as a product of quadratic trinomials and binomials corresponding to the complex conjugate and real roots using Wolfram Alpha ?

E.g.,

$$x^3-2x^2+x-2=(x^2+1)(x-2)$$

If I understood you correctly, you want a factorization over the reals. One way to do this is to use decimals for your coefficients. For example, for your question you can use

Factor[x^3 - 3.0* x^2 - 2.0]

which WA will return

(1 x - 2) (1 x^2 + 1)

For the other example you tried, $x^4 - 2 x^2 + x - 2$, the command

Factor[x^4-2.0*x^2+x-2.0]

will return

(x - 1.49257) (x + 1.78537) (x^2 - 0.292798 x + 0.750527)

This will work well if there are only rational roots, but for irrational roots you might need to do extra work to get enough precision.

• We are getting very close. This returns numerical coefficients, but still not always works for closed-form expression coefficients. – Yves Daoust Jun 27 '18 at 13:55
• @YvesDaoust Do you mean things like factoring $(2y^2+1)x^3 - (y-5)x + y^3$? Or the factors should closed expressions like $(x - \sqrt 5)(x + \sqrt 5)$, when applicable? – Yong Hao Ng Jun 27 '18 at 14:29
• The second interpretation. – Yves Daoust Jun 27 '18 at 14:39
• @YvesDaoust The problem is not all roots have closed expressions by radicals, if the polynomial is of degree $\geq 5$. For smaller degrees, one other option is to try something like >Reduce[x^3-7 == 0, Reals] which would give you the linear roots. In closed form when it can find one. So an initial factor >Factor[-7 - 14 x^2 + x^3 + 2 x^5 ] Gives you the irreducible parts over $\mathbb Q$ and you can try Reduce[] on each component. Not sure how to do everything as one command though. – Yong Hao Ng Jun 28 '18 at 8:59

Yes, you can do it, using keyword "factor".

For example, Wolfram Alpha Pro returns for $factor x^4-2x^2+x-2:$

• – Yves Daoust Jun 25 '18 at 6:16
• @YvesDaoust Perhaps there is a feature of licensing policy. – Yuri Negometyanov Jun 25 '18 at 7:27
• @YvesDaoust Was choozen the same (and later) answer. Why I'm downvoted? – Yuri Negometyanov Jun 27 '18 at 17:08
• I don't know who did, but you didn't understand the question it seems. – Yves Daoust Jun 28 '18 at 8:07

Putting the LHS into Wolfram Alpha gets you the form you want, about half way down the page under "Alternate forms". If that isn't what you want then I don't understand the question.

• Mh, this does not always work: wolframalpha.com/input/?i=x%5E4-2x%5E2%2Bx-2 – Yves Daoust Jun 6 '18 at 9:05
• @YvesDaoust That one doesn't factor very nicely: factor x^4-2x^2+x-2 – Jaap Scherphuis Jun 6 '18 at 9:11
• @JaapScherphuis: this is precisely what I don't want. – Yves Daoust Jun 6 '18 at 9:14
• So what answer do you want for $x^4-2x^2+x-2$? – Christopher Jun 6 '18 at 9:17
• @JaapScherphuis: WA can deliver both approximate and closed-forms of the roots, both can do. "you can then just multiply out last two factors" is precisely what I want WA to perform, without having to do it manually. – Yves Daoust Jun 6 '18 at 10:06