# Revision history [back]

### Polynomials as a sum of squares

Is it possible so represent polynomials as a sum of squares in Sage? For example, if I want to prove that $x^6 - x^5 + x^4 - x^3 + x^2 - x + 2/5>0$ for all $x\in\mathbb{R}$ then Sage would return for example

$$\left (x^2\left (x - \frac{1}{2}\right)\right )^2+\left (\frac{\sqrt{3}x}{2}\left (x - \frac{2}{3}\right)\right )^2+\left (\sqrt{\frac{2}{3}}\left(x - \frac{3}{4}\right )\right )^2+\sqrt{\frac{1}{40}}^2$$

### Polynomials as a sum of squares

Is it possible so represent decompose polynomials as a sum of squares in Sage? Sage if such representation is possible? For example, if I want to prove that $x^6 - x^5 + x^4 - x^3 + x^2 - x + 2/5>0$ for all $x\in\mathbb{R}$ then Sage would return for example

$$\left (x^2\left (x - \frac{1}{2}\right)\right )^2+\left (\frac{\sqrt{3}x}{2}\left (x - \frac{2}{3}\right)\right )^2+\left (\sqrt{\frac{2}{3}}\left(x - \frac{3}{4}\right )\right )^2+\sqrt{\frac{1}{40}}^2$$

### Polynomials as a sum of squares

Is it possible so decompose polynomials find a decomposition of a polynomial as a sum of squares in Sage if such representation is possible? For example, if I want to prove that $x^6 - x^5 + x^4 - x^3 + x^2 - x + 2/5>0$ for all $x\in\mathbb{R}$ then Sage would return for example

$$\left (x^2\left (x - \frac{1}{2}\right)\right )^2+\left (\frac{\sqrt{3}x}{2}\left (x - \frac{2}{3}\right)\right )^2+\left (\sqrt{\frac{2}{3}}\left(x - \frac{3}{4}\right )\right )^2+\sqrt{\frac{1}{40}}^2$$