[Go to the Notes on Diffy Qs home page]

Notes on Diffy Qs - Sage demos for section 2.3

Press the Evaluate button below to launch the Sage demonstration.

Solving polynomials

When solving higher order constant coefficient ODEs, we run into needing to solve polynomial equations of higher order. We can use Sage. With the "solve" command you will get exact solutions, but the command will only work up to degree 4 and in special cases for higher degrees. You can try, but it won't always work; there are no general formulas for roots of polynomials of degree 5 and higher. See below for numerically solving for roots. We use the "show" command to make Sage give a nice presentation of the roots.

The "roots" method applied to a polynomial will return roots in the given ring (in this case "CC" stands for complex numbers). In this case, it will return numerical solutions for the roots. It will return a list of pairs, the first number is the root, the second is the multiplicity. In the following example, the root \(2\) has multiplicity \(2,\) that is, it appears twice in the list of roots.


Valid HTML 5 Valid CSS!