On Fri, 11 Mar 2022 at 23:13, Chris Smith <[email protected]> wrote:
>
> Given two expressions, `p` and `q`
>
> p = x*y + x + y*z
> q = p + z
>
> it is easy to show that `q = (x + z)*(y + 1)`. But I'm wanting to avoid 
> factoring but would like to know whether a solution for `x` from `p = 0` or 
> `q = 0` is a factor or not. For `q`, the root `x = -z` represent a simple 
> factor whereas the root of x = `-yz/(y + 1)` is different.
>
> I'm lacking the vocabulary to differentiate `-z` from `-yz/(y + 1)`. Is it 
> that the latter has a denominator while the former does not? (And since the 
> original expression had no denominator then the `-z` represents a "whole" 
> factor while the other root does not?)

The vocabulary I would use is to say that x + z is a polynomial factor
within the polynomial ring Z[x,y,z] (or Q[x,y,z]) whereas x-yz/(y+1)
is a polynomial factor in the polynomial ring Q(y, z)[x] which is the
ring of polynomials in x whose coefficients are rational functions of
y and z.

> As an alternative to factoring,

Why do you need an alternative to factoring?

It is possible to check if one polynomial is a factor of another
without computing a full factorisation. You can just polynomial
division:

In [18]: p = x*y + x + y*z

In [19]: q = p + z

In [20]: sx = solve(q, x)[0]

In [21]: sx
Out[21]: -z

In [22]: div(q, x - sx)
Out[22]: (y + 1, 0)

In [24]: rem(q, x - sx)
Out[24]: 0

Note the remainder 0.

--
Oscar

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAHVvXxS65czDR7FqPxhZAy9DP6vb7w-Uu4Ot2bGpBq3vYYSn%3DA%40mail.gmail.com.

Reply via email to