Define a factor of an equation
I have the following code :
p, t= var('p t')
a=(-2*p*t^2-p^2*t)+(2*t*p-p^2)+t+1
b=(p*t^2+2*p^2*t)+(2*t*p-t^2)-p+1
c=(p*t^2-p^2*t)+(t^2+2*t*p+p^2)+t-p #3 sides (a,b,c) in terms of theta and phi [equation (1.1)]
s=factor(2*c^2+2*a^2-b^2);s
which yields
(3*p*t^2 - 2*p^2 - 2*p*t + t^2 + p + 2*t + 1)^2
I want to use the factor (3*p*t^2 - 2*p^2 - 2*p*t + t^2 + p + 2*t + 1)
in my next command. How should I define that. Like I want to set m = 3*p*t^2 - 2*p^2 - 2*p*t + t^2 + p + 2*t + 1
. Tried using operand()
but did not help much