How does one find roots of polynomials in a given domain in Sage?

580 views Asked by At

I have two polynomials p(x) and q(x) and I want to know if there are roots of the equation p'/p = q'/q in the domain (a,∞) where a = max{ roots(p), roots(q) }.

This is the same as asking for the roots of the polynomial, p'q - pq' = 0 in the same domain.

Can something in Sage help?

1

There are 1 answers

0
AudioBubble On

Barring a mathematical insight that escapes me (and one that you'd need to ask about on a math site anyway), the way to do this in Sage is direct: find the roots of p, q, of p'q-pq', and compare. Example:

x = polygen(RR,'x')
p = x^4-5*x^2+3
q = x^2-3*x-2
r = p.diff(x)*q - p*q.diff(x)
maxp = max([t for t,k in p.roots()])
maxq = max([t for t,k in q.roots()])
[t for t,k in r.roots() if t>max(maxp,maxq)]

The output is the list of all roots of p'q-pq' that are greater than max{ roots(p), roots(q) }. In the above example, it's a one-element array, [4.93675692113596].