Sage question: Define the polynomial ring $\Bbb Q[c][x]$.Find the $c$ values where $x^2 + x + c + 1$ has a double root. Sage code I have used.
K.<c>=QQ['c']
R.<x>=K[]
f=x^2+x+c+1
f
How do I find the code for the $c$ values where $x^2 + x + c + 1$ has a double root. Also, can you give some examples so that I can construct some programming code in sage?
The (general) discriminant of a polynomial is the resultant of the polynomial with its derivative. It tells you if there are common factors between them, that is the case if and only if it is zero. Common factors here indicate (irreducible) factors of the polynomial with a non-trivial multiplicity.
In https://sagecell.sagemath.org/ this works
with the output
Note that the
roots()output is a list of pairs of root and multiplicity. This approach only works if there are solutionscthat are in the basis field, here $\Bbb Q$. In other cases, you can proceed to find irreducible factors of the discriminant and from there get some semi-numeric representations of the roots as algebraic numbers (enclosing intervals, Thom sign sequences), or determine numerical approximations of the roots.