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])

$\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

$\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()

$\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($\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)
$\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
$\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
$\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:
$\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:
$\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}$
$\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.
$\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$
$\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$
$\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
$\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($\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)
$\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($\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)
$\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($\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)
$\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($\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)
$\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)}$
$\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()

$\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$
$\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$
$\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