Shared2017-08-15-214016.sagewsOpen in CoCalc
Space quartics
from sage.plot.plot3d.shapes import Sphere
a = 1; b = 4; c = 1;
A = (2/b^2 + 1/c^2 - 1/a^2)/(1/a^2+1/c^2)
t = var('t')
f_w = t^4 + 2*A*t^2+1
f_x = a*(1+A)*t*(t^2+1)/f_w
f_y = b*(t^4-1)/f_w
f_z = c*(1-A)*t*(t^2-1)/f_w
p1 = parametric_plot3d([f_x, f_y, f_z], (t, -100, 100), color='red', plot_points=2000, thickness=3)
x, y, z = var('x, y, z')
p2 = implicit_plot3d(x^2/a^2 + y^2/b^2 - z^2/c^2 - 1, (x,-a*1.1, a*1.1), (y,-b*1.1, b*1.1), (z,-c*1.1, c*1.1), color="blue", opacity=0.1, plot_points=100)
S = Sphere(.05, color='black').translate(0,-b,0)
show(A*1.0)
show(p2 + p1 + S, aspect_ratio=[1/a,1/b,3/c])
0.0625000000000000\displaystyle 0.0625000000000000
3D rendering not yet implemented
$a = 4; b = 1; c = 1;
A = (2/b^2 + 1/c^2 - 1/a^2)/(1/a^2+1/c^2)
show(A*1.0)
t = var('t')
f_x = a*(1+A)*(t^2+1)
f_y = 2*b*(t^3+A*t)
f_z = c*(1-A)*(t^2-1)
p1 = parametric_plot([f_y/f_x, f_z/f_x], (t, -100, 100), color='red', plot_points=1000, thickness=1, aspect_ratio=40)
p1
2.76470588235294\displaystyle 2.76470588235294
t=var('t')
x,y,z = var('x,y,z')
a,b,c,d,e,f,g,h,i,j = var('a,b,c,d,e,f,g,h,i,j')
x=15*(t^2+1)
y=-9*(t^2-1)
z=2*t^3+8*t
cubic = a*x^3 + b*y^3 + c*z^3 + d*x^2*y + e*x^2*z + f*x*y^2 + g*y^2*z + h*x*z^2 + i*y*z^2 + j*x*y*z
coeff = cubic.coefficients(t)
[coeff[n][0] for n in range(10)]
solve([coeff[n][0]==0 for n in range(10)], a,b,c,d,e,f,g,h,i,j)
[3375*a + 729*b + 2025*d + 1215*f, 1800*e + 648*g + 1080*j, 10125*a - 2187*b + 2025*d - 1215*f + 960*h + 576*i, 512*c + 4050*e - 1134*g + 270*j, 10125*a + 2187*b - 2025*d - 1215*f + 1440*h - 288*i, 384*c + 2700*e + 324*g - 1080*j, 3375*a - 729*b - 2025*d + 1215*f + 540*h - 252*i, 96*c + 450*e + 162*g - 270*j, 60*h - 36*i, 8*c] [[a == r1, b == -5/3*r1, c == 0, d == 1/3*r1, e == 0, f == -7/3*r1, g == 0, h == -9*r1, i == -15*r1, j == 0]]
R.<x,y,z> = QQ[]
from sage.schemes.toric.weierstrass import Discriminant
from sage.schemes.toric.weierstrass import j_invariant
cubic = 3*x^3-5*y^3+x^2*y-7*x*y^2-27*x*z^2-45*y*z^2
WeierstrassForm(cubic)
Discriminant(cubic)
j_invariant(cubic)
(-6912, -221184) 0 +Infinity
x,y,z = var('x,y,z')
f(x,y,z)=3*x^3-5*y^3+x^2*y-7*x*y^2-27*x*z^2-45*y*z^2
g(x,y,z)=f(z,x-z,y).expand()
g(x,y,z).show()
5x345xy2+8x2z+18y2z\displaystyle -5 \, x^{3} - 45 \, x y^{2} + 8 \, x^{2} z + 18 \, y^{2} z
x,y = var('x,y')
g(x,y)=-24*x^3 - 18*x^2*y + 9*x*y^2 + 3*y^3
solve(g(x,1),x)
[x == (1/2), x == -1, x == (-1/4)]
(-27648, -1769472) 0 +Infinity
R.<x,y,z> = QQ[]
from sage.schemes.toric.weierstrass import Discriminant
cubic = y^2*z - x*(x-z)*(x+z)
WeierstrassForm(cubic)
Discriminant(cubic)
j_invariant(cubic)
(-1, 0) -4 1728

x,y=var('x,y')
solve([x==1,y==0], x,y)
[[x == 1, y == 0]]
x = var('x')
solve(x^2 + 3*x + 2==0, x)
[x == -2, x == -1]
a,b,c,d = var('a,b,c,d')
m = matrix(SR,[[a^4-1, a^3+a, 4*a^2+1, a],[b^4-1, b^3+b, 4*b^2+1, b],[c^4-1, c^3+c, 4*c^2+1, c],[d^4-1, d^3+d, 4*d^2+1, d]])
m.determinant()
m.determinant().factor()
m.determinant().factor()/((a-b)*(a-c)*(a-d)*(b-c)*(b-d)*(c-d))
4*a^4*b^3*c^2*d - 4*a^3*b^4*c^2*d - 4*a^4*b^2*c^3*d + 4*a^2*b^4*c^3*d + 4*a^3*b^2*c^4*d - 4*a^2*b^3*c^4*d - 4*a^4*b^3*c*d^2 + 4*a^3*b^4*c*d^2 + 4*a^4*b*c^3*d^2 - 4*a*b^4*c^3*d^2 - 4*a^3*b*c^4*d^2 + 4*a*b^3*c^4*d^2 + 4*a^4*b^2*c*d^3 - 4*a^2*b^4*c*d^3 - 4*a^4*b*c^2*d^3 + 4*a*b^4*c^2*d^3 + 4*a^2*b*c^4*d^3 - 4*a*b^2*c^4*d^3 - 4*a^3*b^2*c*d^4 + 4*a^2*b^3*c*d^4 + 4*a^3*b*c^2*d^4 - 4*a*b^3*c^2*d^4 - 4*a^2*b*c^3*d^4 + 4*a*b^2*c^3*d^4 - a^4*b^3*c + a^3*b^4*c + a^4*b*c^3 - a*b^4*c^3 - a^3*b*c^4 + a*b^3*c^4 + a^4*b^3*d - a^3*b^4*d - a^4*c^3*d + b^4*c^3*d + a^3*c^4*d - b^3*c^4*d - a^4*b*d^3 + a*b^4*d^3 + a^4*c*d^3 - b^4*c*d^3 - a*c^4*d^3 + b*c^4*d^3 + a^3*b*d^4 - a*b^3*d^4 - a^3*c*d^4 + b^3*c*d^4 + a*c^3*d^4 - b*c^3*d^4 + 4*a^3*b^2*c - 4*a^2*b^3*c - 4*a^3*b*c^2 + 4*a*b^3*c^2 + 4*a^2*b*c^3 - 4*a*b^2*c^3 - 4*a^3*b^2*d + 4*a^2*b^3*d + 4*a^3*c^2*d - 4*b^3*c^2*d - 4*a^2*c^3*d + 4*b^2*c^3*d + 4*a^3*b*d^2 - 4*a*b^3*d^2 - 4*a^3*c*d^2 + 4*b^3*c*d^2 + 4*a*c^3*d^2 - 4*b*c^3*d^2 - 4*a^2*b*d^3 + 4*a*b^2*d^3 + 4*a^2*c*d^3 - 4*b^2*c*d^3 - 4*a*c^2*d^3 + 4*b*c^2*d^3 (4*a*b*c*d - a*b - a*c - b*c - a*d - b*d - c*d + 4)*(a - b)*(a - c)*(a - d)*(b - c)*(b - d)*(c - d) 4*a*b*c*d - a*b - a*c - b*c - a*d - b*d - c*d + 4
# General rational space quartic with coordinates of degrees 4,3,2,1
t,t1,t2,t3,t4=var('t,t1,t2,t3,t4')
a3, a2, a1, a0, b2, b1, b0, c1, c0, d0 = var('a3, a2, a1, a0, b2, b1, b0, c1, c0, d0')
p1 = t^4 + a3*t^3 + a2*t^2 + a1*t + a0
p2 = t^3 + b2*t^2 + b1*t + b0
p3 = t^2 + c1*t + c0
p4 = t + d0
q(s) = [p1.substitute(t==s), p2.substitute(t==s), p3.substitute(t==s), p4.substitute(t==s)]
m = matrix(SR,[q(t1), q(t2), q(t3), q(t4)])
show(latex(m))
p=(m.determinant().factor())/((t1-t2)*(t1-t3)*(t1-t4)*(t2-t3)*(t2-t4)*(t3-t4))
p.show()
\left(a3t13+t14+a2t12+a1t1+a0b2t12+t13+b1t1+b0c1t1+t12+c0d0+t1a3t23+t24+a2t22+a1t2+a0b2t22+t23+b1t2+b0c1t2+t22+c0d0+t2a3t33+t34+a2t32+a1t3+a0b2t32+t33+b1t3+b0c1t3+t32+c0d0+t3a3t43+t44+a2t42+a1t4+a0b2t42+t43+b1t4+b0c1t4+t42+c0d0+t4\begin{array}{rrrr} a_{3} t_{1}^{3} + t_{1}^{4} + a_{2} t_{1}^{2} + a_{1} t_{1} + a_{0} & b_{2} t_{1}^{2} + t_{1}^{3} + b_{1} t_{1} + b_{0} & c_{1} t_{1} + t_{1}^{2} + c_{0} & d_{0} + t_{1} \\ a_{3} t_{2}^{3} + t_{2}^{4} + a_{2} t_{2}^{2} + a_{1} t_{2} + a_{0} & b_{2} t_{2}^{2} + t_{2}^{3} + b_{1} t_{2} + b_{0} & c_{1} t_{2} + t_{2}^{2} + c_{0} & d_{0} + t_{2} \\ a_{3} t_{3}^{3} + t_{3}^{4} + a_{2} t_{3}^{2} + a_{1} t_{3} + a_{0} & b_{2} t_{3}^{2} + t_{3}^{3} + b_{1} t_{3} + b_{0} & c_{1} t_{3} + t_{3}^{2} + c_{0} & d_{0} + t_{3} \\ a_{3} t_{4}^{3} + t_{4}^{4} + a_{2} t_{4}^{2} + a_{1} t_{4} + a_{0} & b_{2} t_{4}^{2} + t_{4}^{3} + b_{1} t_{4} + b_{0} & c_{1} t_{4} + t_{4}^{2} + c_{0} & d_{0} + t_{4} \end{array}\right)
a3b2c1d0+b2c1d0t1+b2c1d0t2+c1d0t1t2+b2c1d0t3+c1d0t1t3+c1d0t2t3+d0t1t2t3+b2c1d0t4+c1d0t1t4+c1d0t2t4+d0t1t2t4+c1d0t3t4+d0t1t3t4+d0t2t3t4+t1t2t3t4a3b2c0a3b1d0a2c1d0b2c0t1b1d0t1b2c0t2b1d0t2c0t1t2b2c0t3b1d0t3c0t1t3c0t2t3b2c0t4b1d0t4c0t1t4c0t2t4c0t3t4+a3b0+a2c0+a1d0+b0t1+b0t2+b0t3+b0t4a0\displaystyle a_{3} b_{2} c_{1} d_{0} + b_{2} c_{1} d_{0} t_{1} + b_{2} c_{1} d_{0} t_{2} + c_{1} d_{0} t_{1} t_{2} + b_{2} c_{1} d_{0} t_{3} + c_{1} d_{0} t_{1} t_{3} + c_{1} d_{0} t_{2} t_{3} + d_{0} t_{1} t_{2} t_{3} + b_{2} c_{1} d_{0} t_{4} + c_{1} d_{0} t_{1} t_{4} + c_{1} d_{0} t_{2} t_{4} + d_{0} t_{1} t_{2} t_{4} + c_{1} d_{0} t_{3} t_{4} + d_{0} t_{1} t_{3} t_{4} + d_{0} t_{2} t_{3} t_{4} + t_{1} t_{2} t_{3} t_{4} - a_{3} b_{2} c_{0} - a_{3} b_{1} d_{0} - a_{2} c_{1} d_{0} - b_{2} c_{0} t_{1} - b_{1} d_{0} t_{1} - b_{2} c_{0} t_{2} - b_{1} d_{0} t_{2} - c_{0} t_{1} t_{2} - b_{2} c_{0} t_{3} - b_{1} d_{0} t_{3} - c_{0} t_{1} t_{3} - c_{0} t_{2} t_{3} - b_{2} c_{0} t_{4} - b_{1} d_{0} t_{4} - c_{0} t_{1} t_{4} - c_{0} t_{2} t_{4} - c_{0} t_{3} t_{4} + a_{3} b_{0} + a_{2} c_{0} + a_{1} d_{0} + b_{0} t_{1} + b_{0} t_{2} + b_{0} t_{3} + b_{0} t_{4} - a_{0}
# rational space quartic with coordinates of degrees 4,3,2,1
t,t1,t2,t3,t4=var('t,t1,t2,t3,t4')
p, q, r, s = var('p,q,r,s')
p1 = t^4 - p
p2 = t^3 + q
p3 = t^2 - r
p4 = t + s
# gamma(x) describes the space quartic as x varies
gamma(x) = [p1.substitute(t==x), p2.substitute(t==x), p3.substitute(t==x), p4.substitute(t==x)]
# 4 distinct points t1, t2, t3, t4 are coplanar iff the following matrix is singular
m = matrix(SR,[gamma(t1), gamma(t2), gamma(t3), gamma(t4)])
F=(m.determinant().factor())/((t1-t2)*(t1-t3)*(t1-t4)*(t2-t3)*(t2-t4)*(t3-t4))
print("The symmetric expression F is")
F.show()
print("Solve F=0 for t4 and set it equal to f")
f=solve(F,t4)[0].rhs(); f.show(); latex(f);
print("Quotient of the partial derivatives of f with respect to t2 and t3:")
g = (f.diff(t2)/f.diff(t3)).simplify_full(); g.show()
print("The above expression should be independent of t1, so take the partial derivative wrt t1, take the numerator of that and factorize:")
h = g.diff(t1); h.numerator().show()
h.numerator().factor().show()
print("Since t1, t2, t3 are arbitrary in some small ball, the first and last factors are non-zero generically, and we obtain that the catalecticant vanishes.")
# (h.numerator().factor())/((t2-t3)*(r^3-2*q*r*s+p*s^2+q^2-p*r))
(((h.numerator().factor())/(t2-t3))/(r^3 - 2*q*r*s + p*s^2 + q^2 - p*r)).simplify_full().show()
den = factor(h.denominator())
den2 = s^2*t1^2*t2^2 + r*s*t1^2*t2 + r*s*t1*t2^2 - r*t1^2*t2^2 + r^2*t1^2 - q*s*t1^2 + r^2*t1*t2 - q*t1^2*t2 + r^2*t2^2 - q*s*t2^2 - q*t1*t2^2 + q*r*t1 - p*s*t1 + q*r*t2 - p*s*t2 - p*t1*t2 + q^2 - p*r
den2.show()
den2.factor().show()
latex(den2)
g.denominator().simplify_full().show()
The symmetric expression F is
st1t2t3+st1t2t4+st1t3t4+st2t3t4+t1t2t3t4+rt1t2+rt1t3+rt2t3+rt1t4+rt2t4+rt3t4+qt1+qt2+qt3+qt4+p\displaystyle s t_{1} t_{2} t_{3} + s t_{1} t_{2} t_{4} + s t_{1} t_{3} t_{4} + s t_{2} t_{3} t_{4} + t_{1} t_{2} t_{3} t_{4} + r t_{1} t_{2} + r t_{1} t_{3} + r t_{2} t_{3} + r t_{1} t_{4} + r t_{2} t_{4} + r t_{3} t_{4} + q t_{1} + q t_{2} + q t_{3} + q t_{4} + p
Solve F=0 for t4 and set it equal to f
qt1+(rt1+q)t2+(rt1+(st1+r)t2+q)t3+prt1+(st1+r)t2+(st1+(s+t1)t2+r)t3+q\displaystyle -\frac{q t_{1} + {\left(r t_{1} + q\right)} t_{2} + {\left(r t_{1} + {\left(s t_{1} + r\right)} t_{2} + q\right)} t_{3} + p}{r t_{1} + {\left(s t_{1} + r\right)} t_{2} + {\left(s t_{1} + {\left(s + t_{1}\right)} t_{2} + r\right)} t_{3} + q}
-\frac{q t_{1} + {\left(r t_{1} + q\right)} t_{2} + {\left(r t_{1} + {\left(s t_{1} + r\right)} t_{2} + q\right)} t_{3} + p}{r t_{1} + {\left(s t_{1} + r\right)} t_{2} + {\left(s t_{1} + {\left(s + t_{1}\right)} t_{2} + r\right)} t_{3} + q} Quotient of the partial derivatives of f with respect to t2 and t3:
(r2qs)t12+((s2r)t12+r2qs+(rsq)t1)t32+q2pr+(qrps)t1+((rsq)t12+qrps+(r2p)t1)t3(r2qs)t12+((s2r)t12+r2qs+(rsq)t1)t22+q2pr+(qrps)t1+((rsq)t12+qrps+(r2p)t1)t2\displaystyle \frac{{\left(r^{2} - q s\right)} t_{1}^{2} + {\left({\left(s^{2} - r\right)} t_{1}^{2} + r^{2} - q s + {\left(r s - q\right)} t_{1}\right)} t_{3}^{2} + q^{2} - p r + {\left(q r - p s\right)} t_{1} + {\left({\left(r s - q\right)} t_{1}^{2} + q r - p s + {\left(r^{2} - p\right)} t_{1}\right)} t_{3}}{{\left(r^{2} - q s\right)} t_{1}^{2} + {\left({\left(s^{2} - r\right)} t_{1}^{2} + r^{2} - q s + {\left(r s - q\right)} t_{1}\right)} t_{2}^{2} + q^{2} - p r + {\left(q r - p s\right)} t_{1} + {\left({\left(r s - q\right)} t_{1}^{2} + q r - p s + {\left(r^{2} - p\right)} t_{1}\right)} t_{2}}
The above expression should be independent of t1, so take the partial derivative wrt t1, take the numerator of that and factorize:
r3st12t222qrs2t12t22+ps3t12t22+2r3st1t22t34qrs2t1t22t3+2ps3t1t22t3+r3t12t22t32qrst12t22t3+ps2t12t22t3r3st12t32+2qrs2t12t32ps3t12t322r3st1t2t32+4qrs2t1t2t322ps3t1t2t32r3t12t2t32+2qrst12t2t32ps2t12t2t32+r4t12t22qr2st12t2+prs2t12t2+2r4t1t224qr2st1t22+2prs2t1t22+q2st12t22prst12t22r4t12t3+2qr2st12t3prs2t12t3+r4t22t32qr2st22t3+prs2t22t3+2q2st1t22t32prst1t22t3+q2t12t22t3prt12t22t32r4t1t32+4qr2st1t322prs2t1t32q2st12t32+prst12t32r4t2t32+2qr2st2t32prs2t2t322q2st1t2t32+2prst1t2t32q2t12t2t32+prt12t2t32+2qr3t1t24q2rst1t2+2pqs2t1t2+q2rt12t2pr2t12t2+qr3t222q2rst22+pqs2t22+2q2rt1t222pr2t1t222qr3t1t3+4q2rst1t32pqs2t1t3q2rt12t3+pr2t12t3+q2rt22t3pr2t22t3qr3t32+2q2rst32pqs2t322q2rt1t32+2pr2t1t32q2rt2t32+pr2t2t32+pr3t22pqrst2+p2s2t2+2q3t1t22pqrt1t2+q3t22pqrt22pr3t3+2pqrst3p2s2t32q3t1t3+2pqrt1t3q3t32+pqrt32+pq2t2p2rt2pq2t3+p2rt3\displaystyle r^{3} s t_{1}^{2} t_{2}^{2} - 2 \, q r s^{2} t_{1}^{2} t_{2}^{2} + p s^{3} t_{1}^{2} t_{2}^{2} + 2 \, r^{3} s t_{1} t_{2}^{2} t_{3} - 4 \, q r s^{2} t_{1} t_{2}^{2} t_{3} + 2 \, p s^{3} t_{1} t_{2}^{2} t_{3} + r^{3} t_{1}^{2} t_{2}^{2} t_{3} - 2 \, q r s t_{1}^{2} t_{2}^{2} t_{3} + p s^{2} t_{1}^{2} t_{2}^{2} t_{3} - r^{3} s t_{1}^{2} t_{3}^{2} + 2 \, q r s^{2} t_{1}^{2} t_{3}^{2} - p s^{3} t_{1}^{2} t_{3}^{2} - 2 \, r^{3} s t_{1} t_{2} t_{3}^{2} + 4 \, q r s^{2} t_{1} t_{2} t_{3}^{2} - 2 \, p s^{3} t_{1} t_{2} t_{3}^{2} - r^{3} t_{1}^{2} t_{2} t_{3}^{2} + 2 \, q r s t_{1}^{2} t_{2} t_{3}^{2} - p s^{2} t_{1}^{2} t_{2} t_{3}^{2} + r^{4} t_{1}^{2} t_{2} - 2 \, q r^{2} s t_{1}^{2} t_{2} + p r s^{2} t_{1}^{2} t_{2} + 2 \, r^{4} t_{1} t_{2}^{2} - 4 \, q r^{2} s t_{1} t_{2}^{2} + 2 \, p r s^{2} t_{1} t_{2}^{2} + q^{2} s t_{1}^{2} t_{2}^{2} - p r s t_{1}^{2} t_{2}^{2} - r^{4} t_{1}^{2} t_{3} + 2 \, q r^{2} s t_{1}^{2} t_{3} - p r s^{2} t_{1}^{2} t_{3} + r^{4} t_{2}^{2} t_{3} - 2 \, q r^{2} s t_{2}^{2} t_{3} + p r s^{2} t_{2}^{2} t_{3} + 2 \, q^{2} s t_{1} t_{2}^{2} t_{3} - 2 \, p r s t_{1} t_{2}^{2} t_{3} + q^{2} t_{1}^{2} t_{2}^{2} t_{3} - p r t_{1}^{2} t_{2}^{2} t_{3} - 2 \, r^{4} t_{1} t_{3}^{2} + 4 \, q r^{2} s t_{1} t_{3}^{2} - 2 \, p r s^{2} t_{1} t_{3}^{2} - q^{2} s t_{1}^{2} t_{3}^{2} + p r s t_{1}^{2} t_{3}^{2} - r^{4} t_{2} t_{3}^{2} + 2 \, q r^{2} s t_{2} t_{3}^{2} - p r s^{2} t_{2} t_{3}^{2} - 2 \, q^{2} s t_{1} t_{2} t_{3}^{2} + 2 \, p r s t_{1} t_{2} t_{3}^{2} - q^{2} t_{1}^{2} t_{2} t_{3}^{2} + p r t_{1}^{2} t_{2} t_{3}^{2} + 2 \, q r^{3} t_{1} t_{2} - 4 \, q^{2} r s t_{1} t_{2} + 2 \, p q s^{2} t_{1} t_{2} + q^{2} r t_{1}^{2} t_{2} - p r^{2} t_{1}^{2} t_{2} + q r^{3} t_{2}^{2} - 2 \, q^{2} r s t_{2}^{2} + p q s^{2} t_{2}^{2} + 2 \, q^{2} r t_{1} t_{2}^{2} - 2 \, p r^{2} t_{1} t_{2}^{2} - 2 \, q r^{3} t_{1} t_{3} + 4 \, q^{2} r s t_{1} t_{3} - 2 \, p q s^{2} t_{1} t_{3} - q^{2} r t_{1}^{2} t_{3} + p r^{2} t_{1}^{2} t_{3} + q^{2} r t_{2}^{2} t_{3} - p r^{2} t_{2}^{2} t_{3} - q r^{3} t_{3}^{2} + 2 \, q^{2} r s t_{3}^{2} - p q s^{2} t_{3}^{2} - 2 \, q^{2} r t_{1} t_{3}^{2} + 2 \, p r^{2} t_{1} t_{3}^{2} - q^{2} r t_{2} t_{3}^{2} + p r^{2} t_{2} t_{3}^{2} + p r^{3} t_{2} - 2 \, p q r s t_{2} + p^{2} s^{2} t_{2} + 2 \, q^{3} t_{1} t_{2} - 2 \, p q r t_{1} t_{2} + q^{3} t_{2}^{2} - p q r t_{2}^{2} - p r^{3} t_{3} + 2 \, p q r s t_{3} - p^{2} s^{2} t_{3} - 2 \, q^{3} t_{1} t_{3} + 2 \, p q r t_{1} t_{3} - q^{3} t_{3}^{2} + p q r t_{3}^{2} + p q^{2} t_{2} - p^{2} r t_{2} - p q^{2} t_{3} + p^{2} r t_{3}
(st12t2+st12t3+2st1t2t3+t12t2t3+rt12+2rt1t2+2rt1t3+rt2t3+2qt1+qt2+qt3+p)(r32qrs+ps2+q2pr)(t2t3)\displaystyle {\left(s t_{1}^{2} t_{2} + s t_{1}^{2} t_{3} + 2 \, s t_{1} t_{2} t_{3} + t_{1}^{2} t_{2} t_{3} + r t_{1}^{2} + 2 \, r t_{1} t_{2} + 2 \, r t_{1} t_{3} + r t_{2} t_{3} + 2 \, q t_{1} + q t_{2} + q t_{3} + p\right)} {\left(r^{3} - 2 \, q r s + p s^{2} + q^{2} - p r\right)} {\left(t_{2} - t_{3}\right)}
Since t1, t2, t3 are arbitrary in some small ball, the first and last factors are non-zero generically, and we obtain that the catalecticant vanishes.
rt12+2qt1+(st12+2rt1+q)t2+(st12+2rt1+(2st1+t12+r)t2+q)t3+p\displaystyle r t_{1}^{2} + 2 \, q t_{1} + {\left(s t_{1}^{2} + 2 \, r t_{1} + q\right)} t_{2} + {\left(s t_{1}^{2} + 2 \, r t_{1} + {\left(2 \, s t_{1} + t_{1}^{2} + r\right)} t_{2} + q\right)} t_{3} + p
s2t12t22+rst12t2+rst1t22rt12t22+r2t12qst12+r2t1t2qt12t2+r2t22qst22qt1t22+qrt1pst1+qrt2pst2pt1t2+q2pr\displaystyle s^{2} t_{1}^{2} t_{2}^{2} + r s t_{1}^{2} t_{2} + r s t_{1} t_{2}^{2} - r t_{1}^{2} t_{2}^{2} + r^{2} t_{1}^{2} - q s t_{1}^{2} + r^{2} t_{1} t_{2} - q t_{1}^{2} t_{2} + r^{2} t_{2}^{2} - q s t_{2}^{2} - q t_{1} t_{2}^{2} + q r t_{1} - p s t_{1} + q r t_{2} - p s t_{2} - p t_{1} t_{2} + q^{2} - p r
s2t12t22+rst12t2+rst1t22rt12t22+r2t12qst12+r2t1t2qt12t2+r2t22qst22qt1t22+qrt1pst1+qrt2pst2pt1t2+q2pr\displaystyle s^{2} t_{1}^{2} t_{2}^{2} + r s t_{1}^{2} t_{2} + r s t_{1} t_{2}^{2} - r t_{1}^{2} t_{2}^{2} + r^{2} t_{1}^{2} - q s t_{1}^{2} + r^{2} t_{1} t_{2} - q t_{1}^{2} t_{2} + r^{2} t_{2}^{2} - q s t_{2}^{2} - q t_{1} t_{2}^{2} + q r t_{1} - p s t_{1} + q r t_{2} - p s t_{2} - p t_{1} t_{2} + q^{2} - p r
s^{2} t_{1}^{2} t_{2}^{2} + r s t_{1}^{2} t_{2} + r s t_{1} t_{2}^{2} - r t_{1}^{2} t_{2}^{2} + r^{2} t_{1}^{2} - q s t_{1}^{2} + r^{2} t_{1} t_{2} - q t_{1}^{2} t_{2} + r^{2} t_{2}^{2} - q s t_{2}^{2} - q t_{1} t_{2}^{2} + q r t_{1} - p s t_{1} + q r t_{2} - p s t_{2} - p t_{1} t_{2} + q^{2} - p r
(r2qs)t12+((s2r)t12+r2qs+(rsq)t1)t22+q2pr+(qrps)t1+((rsq)t12+qrps+(r2p)t1)t2\displaystyle {\left(r^{2} - q s\right)} t_{1}^{2} + {\left({\left(s^{2} - r\right)} t_{1}^{2} + r^{2} - q s + {\left(r s - q\right)} t_{1}\right)} t_{2}^{2} + q^{2} - p r + {\left(q r - p s\right)} t_{1} + {\left({\left(r s - q\right)} t_{1}^{2} + q r - p s + {\left(r^{2} - p\right)} t_{1}\right)} t_{2}
# a, b, c, d = var('a,b,c,d')
R.<a,b,c,d> = PolynomialRing(QQ, 4, 'abcd')
# p, q, r, s = var('p,q,r,s')
p = a*b*c*d
q = -(a*b*c + a*b*d + a*c*d + b*c*d)
r = (a*b+a*c+a*d+b*c+b*d+c*d)
s = -(a+b+c+d)
g = (a-c)*(c-b)+(1/2)*(d-b)*(a-d); g
I = Ideal(g); I
C = (r^3-2*q*r*s+p*s^2+q^2-p*r); C
#C.factor().show()
C in I
C.reduce(I).factor()
(C/g).simplify()

-3/2*a*b + a*c + b*c - c^2 + 1/2*a*d + 1/2*b*d - 1/2*d^2 Ideal (-3/2*a*b + a*c + b*c - c^2 + 1/2*a*d + 1/2*b*d - 1/2*d^2) of Multivariate Polynomial Ring in a, b, c, d over Rational Field a^3*b^3 + a^3*b^2*c + a^2*b^3*c + a^3*b*c^2 + a^2*b^2*c^2 + a*b^3*c^2 + a^3*c^3 + a^2*b*c^3 + a*b^2*c^3 + b^3*c^3 + a^3*b^2*d + a^2*b^3*d + a^3*b*c*d + 2*a^2*b^2*c*d + a*b^3*c*d + a^3*c^2*d + 2*a^2*b*c^2*d + 2*a*b^2*c^2*d + b^3*c^2*d + a^2*c^3*d + a*b*c^3*d + b^2*c^3*d + a^3*b*d^2 + a^2*b^2*d^2 + a*b^3*d^2 + a^3*c*d^2 + 2*a^2*b*c*d^2 + 2*a*b^2*c*d^2 + b^3*c*d^2 + a^2*c^2*d^2 + 2*a*b*c^2*d^2 + b^2*c^2*d^2 + a*c^3*d^2 + b*c^3*d^2 + a^3*d^3 + a^2*b*d^3 + a*b^2*d^3 + b^3*d^3 + a^2*c*d^3 + a*b*c*d^3 + b^2*c*d^3 + a*c^2*d^3 + b*c^2*d^3 + c^3*d^3 False (-1/81) * (-195*a^3*c^3 - 195*b^3*c^3 - 48*a^2*c^4 - 48*b^2*c^4 + 38*a*c^5 + 38*b*c^5 + 124*c^6 - 270*a^3*c^2*d - 270*b^3*c^2*d - 438*a^2*c^3*d - 438*b^2*c^3*d - 184*a*c^4*d - 184*b*c^4*d + 530*c^5*d - 225*a^3*c*d^2 - 225*b^3*c*d^2 - 468*a^2*c^2*d^2 - 468*b^2*c^2*d^2 - 649*a*c^3*d^2 - 649*b*c^3*d^2 + 764*c^4*d^2 - 120*a^3*d^3 - 120*b^3*d^3 - 258*a^2*c*d^3 - 258*b^2*c*d^3 - 434*a*c^2*d^3 - 434*b*c^2*d^3 + 474*c^3*d^3 - 3*a^2*d^4 - 3*b^2*d^4 - 14*a*c*d^4 - 14*b*c*d^4 + 379*c^2*d^4 + 28*a*d^5 + 28*b*d^5 + 145*c*d^5 + 14*d^6)
Error in lines 11-11 Traceback (most recent call last): File "/cocalc/lib/python2.7/site-packages/smc_sagews/sage_server.py", line 1013, in execute exec compile(block+'\n', '', 'single') in namespace, locals File "", line 1, in <module> File "sage/structure/element.pyx", line 484, in sage.structure.element.Element.__getattr__ (build/cythonized/sage/structure/element.c:4377) return self.getattr_from_category(name) File "sage/structure/element.pyx", line 497, in sage.structure.element.Element.getattr_from_category (build/cythonized/sage/structure/element.c:4486) return getattr_from_other_class(self, cls, name) File "sage/cpython/getattr.pyx", line 254, in sage.cpython.getattr.getattr_from_other_class (build/cythonized/sage/cpython/getattr.c:1901) raise dummy_attribute_error AttributeError: 'sage.rings.fraction_field_element.FractionFieldElement' object has no attribute 'simplify'
# A special rational space quartic with coordinates of degrees 4,3,2,0
t,t1,t2,t3,t4=var('t,t1,t2,t3,t4')
a, b, c = var('a,b,c')
p1 = t^4 + a*t
p2 = t^3 + b*t
p3 = t^2 + c*t
p4 = 1
q(s) = [p1.substitute(t==s), p2.substitute(t==s), p3.substitute(t==s), p4.substitute(t==s)]
m = matrix(SR,[q(t1), q(t2), q(t3), q(t4)])
show(latex(m))
p=(m.determinant().factor())/((t1-t2)*(t1-t3)*(t1-t4)*(t2-t3)*(t2-t4)*(t3-t4))
p.show()
\left(t14+at1t13+bt1ct1+t121t24+at2t23+bt2ct2+t221t34+at3t33+bt3ct3+t321t44+at4t43+bt4ct4+t421\begin{array}{rrrr} t_{1}^{4} + a t_{1} & t_{1}^{3} + b t_{1} & c t_{1} + t_{1}^{2} & 1 \\ t_{2}^{4} + a t_{2} & t_{2}^{3} + b t_{2} & c t_{2} + t_{2}^{2} & 1 \\ t_{3}^{4} + a t_{3} & t_{3}^{3} + b t_{3} & c t_{3} + t_{3}^{2} & 1 \\ t_{4}^{4} + a t_{4} & t_{4}^{3} + b t_{4} & c t_{4} + t_{4}^{2} & 1 \end{array}\right)
ct1t2+ct1t3+ct2t3+t1t2t3+ct1t4+ct2t4+t1t2t4+ct3t4+t1t3t4+t2t3t4bt1bt2bt3bt4+a\displaystyle c t_{1} t_{2} + c t_{1} t_{3} + c t_{2} t_{3} + t_{1} t_{2} t_{3} + c t_{1} t_{4} + c t_{2} t_{4} + t_{1} t_{2} t_{4} + c t_{3} t_{4} + t_{1} t_{3} t_{4} + t_{2} t_{3} t_{4} - b t_{1} - b t_{2} - b t_{3} - b t_{4} + a
# A special rational space quartic with coordinates of degrees 4,3,1,0
t,t1,t2,t3,t4=var('t,t1,t2,t3,t4')
a, b = var('a,b')
p1 = t^4 + a*t^2
p2 = t^3 + b*t^2
p3 = t
p4 = 1
q(s) = [p1.substitute(t==s), p2.substitute(t==s), p3.substitute(t==s), p4.substitute(t==s)]
m = matrix(SR,[q(t1), q(t2), q(t3), q(t4)])
show(latex(m))
p=(m.determinant().factor())/((t1-t2)*(t1-t3)*(t1-t4)*(t2-t3)*(t2-t4)*(t3-t4))
p.show()
\left(t14+at12bt12+t13t11t24+at22bt22+t23t21t34+at32bt32+t33t31t44+at42bt42+t43t41\begin{array}{rrrr} t_{1}^{4} + a t_{1}^{2} & b t_{1}^{2} + t_{1}^{3} & t_{1} & 1 \\ t_{2}^{4} + a t_{2}^{2} & b t_{2}^{2} + t_{2}^{3} & t_{2} & 1 \\ t_{3}^{4} + a t_{3}^{2} & b t_{3}^{2} + t_{3}^{3} & t_{3} & 1 \\ t_{4}^{4} + a t_{4}^{2} & b t_{4}^{2} + t_{4}^{3} & t_{4} & 1 \end{array}\right)
bt1+bt2+t1t2+bt3+t1t3+t2t3+bt4+t1t4+t2t4+t3t4a\displaystyle b t_{1} + b t_{2} + t_{1} t_{2} + b t_{3} + t_{1} t_{3} + t_{2} t_{3} + b t_{4} + t_{1} t_{4} + t_{2} t_{4} + t_{3} t_{4} - a
# General rational space quartic with coordinates of degrees 4,2,1,0
t,t1,t2,t3,t4=var('t,t1,t2,t3,t4')
a3, a2, a1, a0, b2, b1, b0, c1, c0, d0 = var('a3, a2, a1, a0, b2, b1, b0, c1, c0, d0')
p1 = t^4 + a3*t^3 + a2*t^2 + a1*t + a0
p2 = t^2 + b1*t + b0
p3 = t + c0
p4 = 1
q(s) = [p1.substitute(t==s), p2.substitute(t==s), p3.substitute(t==s), p4.substitute(t==s)]
m = matrix(SR,[q(t1), q(t2), q(t3), q(t4)])
show(latex(m))
p=(m.determinant().factor())/((t1-t2)*(t1-t3)*(t1-t4)*(t2-t3)*(t2-t4)*(t3-t4))
p.show()
\left(a3t13+t14+a2t12+a1t1+a0b1t1+t12+b0c0+t11a3t23+t24+a2t22+a1t2+a0b1t2+t22+b0c0+t21a3t33+t34+a2t32+a1t3+a0b1t3+t32+b0c0+t31a3t43+t44+a2t42+a1t4+a0b1t4+t42+b0c0+t41\begin{array}{rrrr} a_{3} t_{1}^{3} + t_{1}^{4} + a_{2} t_{1}^{2} + a_{1} t_{1} + a_{0} & b_{1} t_{1} + t_{1}^{2} + b_{0} & c_{0} + t_{1} & 1 \\ a_{3} t_{2}^{3} + t_{2}^{4} + a_{2} t_{2}^{2} + a_{1} t_{2} + a_{0} & b_{1} t_{2} + t_{2}^{2} + b_{0} & c_{0} + t_{2} & 1 \\ a_{3} t_{3}^{3} + t_{3}^{4} + a_{2} t_{3}^{2} + a_{1} t_{3} + a_{0} & b_{1} t_{3} + t_{3}^{2} + b_{0} & c_{0} + t_{3} & 1 \\ a_{3} t_{4}^{3} + t_{4}^{4} + a_{2} t_{4}^{2} + a_{1} t_{4} + a_{0} & b_{1} t_{4} + t_{4}^{2} + b_{0} & c_{0} + t_{4} & 1 \end{array}\right)
a3+t1+t2+t3+t4\displaystyle a_{3} + t_{1} + t_{2} + t_{3} + t_{4}

t,s,t1,t2,t3,t4,A=var('t,s,t1,t2,t3,t4,A')
p1 = t*(t^2+1)
p2 = t^4-1
p3 = t*(t^2-1)
p4 = t^4 + 2*A*t^2 + 1
q(s) = [p1.substitute(t==s), p2.substitute(t==s), p3.substitute(t==s), p4.substitute(t==s)]
m = matrix(SR,[q(t1), q(t2), q(t3), q(t4)])
show(latex(m))
(m.determinant().factor()).show()
(m.determinant().factor()/(-4*(t1-t2)*(t1-t3)*(t1-t4)*(t2-t3)*(t2-t4)*(t3-t4))).show()
\left((t12+1)t1t141(t121)t1t14+2At12+1(t22+1)t2t241(t221)t2t24+2At22+1(t32+1)t3t341(t321)t3t34+2At32+1(t42+1)t4t441(t421)t4t44+2At42+1\begin{array}{rrrr} {\left(t_{1}^{2} + 1\right)} t_{1} & t_{1}^{4} - 1 & {\left(t_{1}^{2} - 1\right)} t_{1} & t_{1}^{4} + 2 \, A t_{1}^{2} + 1 \\ {\left(t_{2}^{2} + 1\right)} t_{2} & t_{2}^{4} - 1 & {\left(t_{2}^{2} - 1\right)} t_{2} & t_{2}^{4} + 2 \, A t_{2}^{2} + 1 \\ {\left(t_{3}^{2} + 1\right)} t_{3} & t_{3}^{4} - 1 & {\left(t_{3}^{2} - 1\right)} t_{3} & t_{3}^{4} + 2 \, A t_{3}^{2} + 1 \\ {\left(t_{4}^{2} + 1\right)} t_{4} & t_{4}^{4} - 1 & {\left(t_{4}^{2} - 1\right)} t_{4} & t_{4}^{4} + 2 \, A t_{4}^{2} + 1 \end{array}\right)
4(At1t2t3t4t1t2t1t3t2t3t1t4t2t4t3t4+A)(t1t2)(t1t3)(t1t4)(t2t3)(t2t4)(t3t4)\displaystyle -4 \, {\left(A t_{1} t_{2} t_{3} t_{4} - t_{1} t_{2} - t_{1} t_{3} - t_{2} t_{3} - t_{1} t_{4} - t_{2} t_{4} - t_{3} t_{4} + A\right)} {\left(t_{1} - t_{2}\right)} {\left(t_{1} - t_{3}\right)} {\left(t_{1} - t_{4}\right)} {\left(t_{2} - t_{3}\right)} {\left(t_{2} - t_{4}\right)} {\left(t_{3} - t_{4}\right)}
At1t2t3t4t1t2t1t3t2t3t1t4t2t4t3t4+A\displaystyle A t_{1} t_{2} t_{3} t_{4} - t_{1} t_{2} - t_{1} t_{3} - t_{2} t_{3} - t_{1} t_{4} - t_{2} t_{4} - t_{3} t_{4} + A
R.<t> = QQ['t']
a,b,c,d,x,y,z,w=var('a,b,c,d,x,y,z,w')
x = t^4+a
y = t^3 + b
z = t^2 + c
w = t + d
p1 = expand(x*w-y*z - d*z^2 + c*z*w + (c*d+b)*w^2)
p2 = expand(x*w-y*z - d*y*w + (d^2+c)*z*w - (d^3+c*d-b)*w^2)
p1.show()
p2.show()
p3 = expand((p1*(2*d^4+c*d^2-c^2-b*d-a) + p2*(2*c*d^2+c^2+2*b*d+a))/d)
p3.show()
cd3+2cd2t+bd2+c2t+2bdtbc+ad+at\displaystyle c d^{3} + 2 \, c d^{2} t + b d^{2} + c^{2} t + 2 \, b d t - b c + a d + a t
d52d4tcd2t+c2d+c2t+bdtbc+ad+at\displaystyle -d^{5} - 2 \, d^{4} t - c d^{2} t + c^{2} d + c^{2} t + b d t - b c + a d + a t
c3d22bcd3+ad4+c42bc2db2d2+2acd2b2c+ac2\displaystyle c^{3} d^{2} - 2 \, b c d^{3} + a d^{4} + c^{4} - 2 \, b c^{2} d - b^{2} d^{2} + 2 \, a c d^{2} - b^{2} c + a c^{2}
p,q,r,s=var('p,q,r,s')
#a13,a14,a24,a33,a34,a44
m = matrix(SR,[[2*r,2*s,2,1,0,0],
               [-2*q,-r,s,0,1,0],
               [2*p,-2*q,0,2*r,2*s,1],
               [0,p,q,0,r,s],
               [2*(p*r-q^2),2*(p*s-q*r),2*q*s,r^2,2*r*s,s^2]])
minors = m.minors(5)
for i in minors:
    i.fac