# Finding roots of polynomials

certik edited this page Feb 8, 2011 · 1 revision

## Example 1

Let's try $x^3 + 2x^2 + 8$:

In [1]: solve(x**3+2*x**2+8, x)
Out[1]:
âŽ¡        âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½                                        2/3
âŽ¢     3 â•±              âŽ½âŽ½âŽ½âŽ½        2/3     3 âŽ½âŽ½âŽ½ âŽ›             âŽ½âŽ½âŽ½âŽ½âŽž        3
âŽ¢- 18*â•²â•±  1044 + 108*â•²â•± 93   - 36*3    - 3*â•²â•± 3 *âŽ1044 + 108*â•²â•± 93 âŽ      18*â•²â•±
âŽ¢â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€, â”€â”€â”€â”€â”€
âŽ¢                            âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½
âŽ¢                         3 â•±              âŽ½âŽ½âŽ½âŽ½
âŽ£                      27*â•²â•±  1044 + 108*â•²â•± 93

âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½
âŽ½âŽ½âŽ½   âŽ½âŽ½âŽ½âŽ½        3 âŽ½âŽ½âŽ½   âŽ½âŽ½âŽ½âŽ½       3 âŽ½âŽ½âŽ½      2/3 3 â•±              âŽ½âŽ½âŽ½âŽ½
3 *â•²â•± 93  - 54*â…ˆ*â•²â•± 3 *â•²â•± 31  + 174*â•²â•± 3  + 2*3   *â•²â•±  1044 + 108*â•²â•± 93   + 6
â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€

âŽ›             âŽ½âŽ½
3*âŽ1044 + 108*â•²â•± 9

âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½                        2/3
6 âŽ½âŽ½âŽ½ 3 â•±              âŽ½âŽ½âŽ½âŽ½      âŽ›             âŽ½âŽ½âŽ½âŽ½âŽž             5/6     3 
• â…ˆ*â•²â•± 3 *â•²â•± 1044 + 108*â•²â•± 93 - 2*âŽ1044 + 108*â•²â•± 93 âŽ  - 174*â…ˆ*3 18*â•²â•±
â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€, â”€â”€â”€â”€â”€ 2/3 âŽ½âŽ½âŽž 3 âŽ  âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½ âŽ½âŽ½âŽ½ âŽ½âŽ½âŽ½âŽ½ 3 âŽ½âŽ½âŽ½ âŽ½âŽ½âŽ½âŽ½ 3 âŽ½âŽ½âŽ½ 2/3 3 â•± âŽ½âŽ½âŽ½âŽ½ 3 *â•²â•± 93 + 54*â…ˆ*â•²â•± 3 *â•²â•± 31 + 174*â•²â•± 3 + 2*3 *â•²â•± 1044 + 108*â•²â•± 93 - 6 â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ âŽ› âŽ½âŽ½ 3*âŽ1044 + 108*â•²â•± 9 âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½ 2/3 âŽ¤ 6 âŽ½âŽ½âŽ½ 3 â•± âŽ½âŽ½âŽ½âŽ½ âŽ› âŽ½âŽ½âŽ½âŽ½âŽž 5/6âŽ¥
• â…ˆ*â•²â•± 3 *â•²â•± 1044 + 108*â•²â•± 93 - 2*âŽ1044 + 108*â•²â•± 93 âŽ  + 174*â…ˆ*3 âŽ¥
â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€âŽ¥ 2/3 âŽ¥ âŽ½âŽ½âŽž âŽ¥ 3 âŽ  âŽ¦

Too messy? Let's latex it:

>>> latex(solve(x**3+2*x**2+8, x))
'$\\begin{bmatrix}\\frac{- 18 \\left(1044 + 108 \\sqrt{93}\\right)^{\\frac{1}{3}} - 36 {3}^{\\frac{2}{3}} - 3 {3}^{\\frac{1}{3}} \\left(1044 + 108 \\sqrt{93}\\right)^{\\frac{2}{3}}}{27 \\left(1044 + 108 \\sqrt{93}\\right)^{\\frac{1}{3}}}, & \\frac{- 174 \\mathbf{\\imath} {3}^{\\frac{5}{6}} - 2 \\left(1044 + 108 \\sqrt{93}\\right)^{\\frac{2}{3}} - 54 \\mathbf{\\imath} {3}^{\\frac{1}{3}} \\sqrt{31} + 2 {3}^{\\frac{2}{3}} \\left(1044 + 108 \\sqrt{93}\\right)^{\\frac{1}{3}} + 18 {3}^{\\frac{1}{3}} \\sqrt{93} + 6 \\mathbf{\\imath} {3}^{\\frac{1}{6}} \\left(1044 + 108 \\sqrt{93}\\right)^{\\frac{1}{3}} + 174 {3}^{\\frac{1}{3}}}{3 \\left(1044 + 108 \\sqrt{93}\\right)^{\\frac{2}{3}}}, & \\frac{- 2 \\left(1044 + 108 \\sqrt{93}\\right)^{\\frac{2}{3}} + 2 {3}^{\\frac{2}{3}} \\left(1044 + 108 \\sqrt{93}\\right)^{\\frac{1}{3}} + 54 \\mathbf{\\imath} {3}^{\\frac{1}{3}} \\sqrt{31} + 18 {3}^{\\frac{1}{3}} \\sqrt{93} - 6 \\mathbf{\\imath} {3}^{\\frac{1}{6}} \\left(1044 + 108 \\sqrt{93}\\right)^{\\frac{1}{3}} + 174 {3}^{\\frac{1}{3}} + 174 \\mathbf{\\imath} {3}^{\\frac{5}{6}}}{3 \\left(1044 + 108 \\sqrt{93}\\right)^{\\frac{2}{3}}}\\end{bmatrix}$'
Python uses \\ in strings. If you do "print latex(roots(x**3+2*x**2+8, x))", you can copy & paste it to the wiki, this gives: $\begin{bmatrix}\frac{- 18 \left(1044 + 108 \sqrt{93}\right)^{\frac{1}{3}} - 36 {3}^{\frac{2}{3}} - 3 {3}^{\frac{1}{3}} \left(1044 + 108 \sqrt{93}\right)^{\frac{2}{3}}}{27 \left(1044 + 108 \sqrt{93}\right)^{\frac{1}{3}}}, & \frac{- 174 \mathbf{\imath} {3}^{\frac{5}{6}} - 2 \left(1044 + 108 \sqrt{93}\right)^{\frac{2}{3}} - 54 \mathbf{\imath} {3}^{\frac{1}{3}} \sqrt{31} + 2 {3}^{\frac{2}{3}} \left(1044 + 108 \sqrt{93}\right)^{\frac{1}{3}} + 18 {3}^{\frac{1}{3}} \sqrt{93} + 6 \mathbf{\imath} {3}^{\frac{1}{6}} \left(1044 + 108 \sqrt{93}\right)^{\frac{1}{3}} + 174 {3}^{\frac{1}{3}}}{3 \left(1044 + 108 \sqrt{93}\right)^{\frac{2}{3}}}, & \frac{- 2 \left(1044 + 108 \sqrt{93}\right)^{\frac{2}{3}} + 2 {3}^{\frac{2}{3}} \left(1044 + 108 \sqrt{93}\right)^{\frac{1}{3}} + 54 \mathbf{\imath} {3}^{\frac{1}{3}} \sqrt{31} + 18 {3}^{\frac{1}{3}} \sqrt{93} - 6 \mathbf{\imath} {3}^{\frac{1}{6}} \left(1044 + 108 \sqrt{93}\right)^{\frac{1}{3}} + 174 {3}^{\frac{1}{3}} + 174 \mathbf{\imath} {3}^{\frac{5}{6}}}{3 \left(1044 + 108 \sqrt{93}\right)^{\frac{2}{3}}}\end{bmatrix}$ Is this correct? Let's check:
In [1]: p = x**3+2*x**2+8

In [2]: r = solve(p, x)

In [3]: p.subs(x, r[0])
Out[3]:

âŽ›        âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½                                        2/3âŽž
âŽœ     3 â•±              âŽ½âŽ½âŽ½âŽ½        2/3     3 âŽ½âŽ½âŽ½ âŽ›             âŽ½âŽ½âŽ½âŽ½âŽž   âŽŸ
2*âŽ- 18*â•²â•±  1044 + 108*â•²â•± 93   - 36*3    - 3*â•²â•± 3 *âŽ1044 + 108*â•²â•± 93 âŽ    âŽ
8 + â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
2/3
âŽ›             âŽ½âŽ½âŽ½âŽ½âŽž
729*âŽ1044 + 108*â•²â•± 93 âŽ

2                                                                           3
âŽ›        âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½                                        2/3âŽž
âŽœ     3 â•±              âŽ½âŽ½âŽ½âŽ½        2/3     3 âŽ½âŽ½âŽ½ âŽ›             âŽ½âŽ½âŽ½âŽ½âŽž   âŽŸ
âŽ- 18*â•²â•±  1044 + 108*â•²â•± 93   - 36*3    - 3*â•²â•± 3 *âŽ1044 + 108*â•²â•± 93 âŽ    âŽ
â”€ + â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
âŽ›             âŽ½âŽ½âŽ½âŽ½âŽž
19683*âŽ1044 + 108*â•²â•± 93 âŽ                         

Hm, is this zero? Let's use a "brute force":

In [4]: p.subs(x, r[0]).evalf()
Out[4]: 2.1316282072803e-14
Cool, looks good. Let's check the other roots:
In [5]: p.subs(x, r[1]).evalf()
Out[5]: -1.77635683940025e-15 - 3.10862446895044e-15*â…ˆ

In [6]: p.subs(x, r[2]).evalf()
Out[6]: -3.5527136788005e-15 + 2.66453525910038e-15*â…ˆ

## Example 2

In [1]: solve(x**3 + x**2 - x + 1, x)[1]
Out[1]:
âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½
3 âŽ½âŽ½âŽ½   âŽ½âŽ½âŽ½âŽ½        3 âŽ½âŽ½âŽ½   âŽ½âŽ½âŽ½âŽ½      3 âŽ½âŽ½âŽ½      2/3 3 â•±            âŽ½âŽ½âŽ½âŽ½
9*â•²â•± 3 *â•²â•± 33  + 27*â…ˆ*â•²â•± 3 *â•²â•± 11  + 57*â•²â•± 3  + 4*3   *â•²â•±  171 + 27*â•²â•± 33   -
â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€

âŽ›           âŽ½âŽ½
6*âŽ171 + 27*â•²â•± 3

âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½                      2/3
6 âŽ½âŽ½âŽ½ 3 â•±            âŽ½âŽ½âŽ½âŽ½      âŽ›           âŽ½âŽ½âŽ½âŽ½âŽž            5/6
12*â…ˆ*â•²â•± 3 *â•²â•±  171 + 27*â•²â•± 33   - 2*âŽ171 + 27*â•²â•± 33 âŽ     + 57*â…ˆ*3
â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
2/3
âŽ½âŽ½âŽž
3 âŽ                                                                  

## Example 3

In [1]: p = x**3+x**2+x-1

In [2]: a = solve(p, x)

In [3]: p.subs(x, a[0])
Out[3]:

âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½
3 âŽ½âŽ½âŽ½   âŽ½âŽ½âŽ½âŽ½        3 âŽ½âŽ½âŽ½   âŽ½âŽ½âŽ½âŽ½      3 âŽ½âŽ½âŽ½      2/3 3 â•±             âŽ½âŽ½
9*â•²â•± 3 *â•²â•± 33  - 27*â…ˆ*â•²â•± 3 *â•²â•± 11  - 51*â•²â•± 3  - 2*3   *â•²â•±  -153 + 27*â•²â•± 3
-1 + â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€

âŽ›
6*âŽ-153 + 2

âŽ½âŽ½âŽ½                âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½                       2/3
âŽ½âŽ½        6 âŽ½âŽ½âŽ½ 3 â•±             âŽ½âŽ½âŽ½âŽ½      âŽ›            âŽ½âŽ½âŽ½âŽ½âŽž            5/6
3   - 6*â…ˆ*â•²â•± 3 *â•²â•±  -153 + 27*â•²â•± 33   - 2*âŽ-153 + 27*â•²â•± 33 âŽ     + 51*â…ˆ*3
â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ +
2/3
âŽ½âŽ½âŽ½âŽ½âŽž
7*â•²â•± 33 âŽ

âŽ›                                                          âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½
âŽœ  3 âŽ½âŽ½âŽ½   âŽ½âŽ½âŽ½âŽ½        3 âŽ½âŽ½âŽ½   âŽ½âŽ½âŽ½âŽ½      3 âŽ½âŽ½âŽ½      2/3 3 â•±             âŽ½âŽ½âŽ½âŽ½
âŽ9*â•²â•± 3 *â•²â•± 33  - 27*â…ˆ*â•²â•± 3 *â•²â•± 11  - 51*â•²â•± 3  - 2*3   *â•²â•±  -153 + 27*â•²â•± 33
â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€

âŽ›
36*âŽ-153 + 27*

2
âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½                       2/3            âŽž    âŽ›
6 âŽ½âŽ½âŽ½ 3 â•±             âŽ½âŽ½âŽ½âŽ½      âŽ›            âŽ½âŽ½âŽ½âŽ½âŽž            5/6âŽŸ    âŽœ
- 6*â…ˆ*â•²â•± 3 *â•²â•±  -153 + 27*â•²â•± 33   - 2*âŽ-153 + 27*â•²â•± 33 âŽ     + 51*â…ˆ*3   âŽ     âŽ9
â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ + â”€â”€
4/3
âŽ½âŽ½âŽ½âŽ½âŽž
â•²â•± 33 âŽ

âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½
3 âŽ½âŽ½âŽ½   âŽ½âŽ½âŽ½âŽ½        3 âŽ½âŽ½âŽ½   âŽ½âŽ½âŽ½âŽ½      3 âŽ½âŽ½âŽ½      2/3 3 â•±             âŽ½âŽ½âŽ½âŽ½    
• â•²â•± 3 *â•²â•± 33 - 27*â…ˆ*â•²â•± 3 *â•²â•± 11 - 51*â•²â•± 3 - 2*3 *â•²â•± -153 + 27*â•²â•± 33 -
â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ âŽ› 216*âŽ-153 + 27*â•² 3 âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½âŽ½ 2/3 âŽž 6 âŽ½âŽ½âŽ½ 3 â•± âŽ½âŽ½âŽ½âŽ½ âŽ› âŽ½âŽ½âŽ½âŽ½âŽž 5/6âŽŸ 6*â…ˆ*â•²â•± 3 *â•²â•± -153 + 27*â•²â•± 33 - 2*âŽ-153 + 27*â•²â•± 33 âŽ  + 51*â…ˆ*3 âŽ  â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ 2 âŽ½âŽ½âŽ½âŽ½âŽž â•± 33 âŽ  In [4]: p.subs(x, a[0]).evalf() Out[4]: 1.11022302462516e-14 + 1.17683640610267e-14*â…ˆ In [5]: p.subs(x, a[1]).evalf() Out[5]: 9.54791801177635e-15 In [6]: p.subs(x, a[2]).evalf() Out[6]: 1.33226762955019e-14 - 1.32116539930394e-14*â…ˆ In [7]:

Category:Documentation