1 | initial version |
The question is answered in https://ask.sagemath.org/question/68081/a-last-factorization/
x,y,α,β=var('x,y,α,β')
P.<U,V> = PolynomialRing(SR, 'U,V')
hes0=(V^2*y^2*α^2 - 2*U*V*x*y*α*β + U^2*x^2*β^2 - V^2*y^2*α - U^2*x^2*β)
Q = QuadraticForm.from_polynomial(hes0)
mG=Q.Gram_matrix()
p_x,p_y=var('p_x,p_y')
v=vector([p_x,p_y])
expand(v*(mG*v))
p_y^2*y^2*α^2 - 2*p_x*p_y*x*y*α*β + p_x^2*x^2*β^2 - p_y^2*y^2*α - p_x^2*x^2*β