ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 13 Dec 2021 23:20:46 +0100Find polynomial with given residues modulo two other polynomialshttps://ask.sagemath.org/question/60219/find-polynomial-with-given-residues-modulo-two-other-polynomials/Find a polynomial f(x) of degree 3, which when divided by x^2 - 4, gives a remainder 2x - 5, and divided by x^2 + x + 3 gives a remainder -5x - 9.Sun, 12 Dec 2021 11:24:49 +0100https://ask.sagemath.org/question/60219/find-polynomial-with-given-residues-modulo-two-other-polynomials/Comment by alvaro for <p>Find a polynomial f(x) of degree 3, which when divided by x^2 - 4, gives a remainder 2x - 5, and divided by x^2 + x + 3 gives a remainder -5x - 9.</p>
https://ask.sagemath.org/question/60219/find-polynomial-with-given-residues-modulo-two-other-polynomials/?comment=60245#post-id-60245May i suggest a change in the title of the question?
i think it should contain a fast description of the problem, like "find a polynomial, given some residues".Mon, 13 Dec 2021 23:20:46 +0100https://ask.sagemath.org/question/60219/find-polynomial-with-given-residues-modulo-two-other-polynomials/?comment=60245#post-id-60245Comment by vdelecroix for <p>Find a polynomial f(x) of degree 3, which when divided by x^2 - 4, gives a remainder 2x - 5, and divided by x^2 + x + 3 gives a remainder -5x - 9.</p>
https://ask.sagemath.org/question/60219/find-polynomial-with-given-residues-modulo-two-other-polynomials/?comment=60224#post-id-60224Is your question related to SageMath? Do you know about the [Chinese Remainder Theorem](https://en.wikipedia.org/wiki/Chinese_remainder_theorem)?Sun, 12 Dec 2021 18:02:07 +0100https://ask.sagemath.org/question/60219/find-polynomial-with-given-residues-modulo-two-other-polynomials/?comment=60224#post-id-60224Answer by Max Alekseyev for <p>Find a polynomial f(x) of degree 3, which when divided by x^2 - 4, gives a remainder 2x - 5, and divided by x^2 + x + 3 gives a remainder -5x - 9.</p>
https://ask.sagemath.org/question/60219/find-polynomial-with-given-residues-modulo-two-other-polynomials/?answer=60225#post-id-60225One'd need to employ CRT here - for example:
R.<x> = PolynomialRing(QQ)
print( crt([2*x-5,-5*x-9],[x^2-4,x^2+x+3]) )
gives `x^3 + x^2 - 2*x - 9`.Sun, 12 Dec 2021 18:45:08 +0100https://ask.sagemath.org/question/60219/find-polynomial-with-given-residues-modulo-two-other-polynomials/?answer=60225#post-id-60225