Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Finally I find a way to solve these two equations. ;-) surely not optimal, But at least it does!

forget()
t = var('t') # define a variable t
p = var('p') # constant cubic coeff 
q = var('q') # last constant cubic coeff
Delta = var('Delta') # cubic Discriminant  
theta = var('theta') # variable angle theta 
k = var('k') # real factor
C = var('C') #real  multiplicatif factor
f = function('f')(t) # define f to be a function of t
Delta=-27*q^2 -4*p^3
assume(Delta>0) # 3 real roots
assume(p, 'real')
assume(q, 'real')
assume(C, 'real')
assume(k, 'real')
equC=-3*C==k*p
equD=k^3==4*C
ResultC=solve(equD,C)
for j in range(len(ResultC)) :
    show(ResultC[j])
Rk=solve(equC.substitute(ResultC[j].lhs()==ResultC[j].rhs()),k)
del(Rk[len(Rk)-1])
show(Rk)
RC0=solve(equD.substitute(Rk[0].lhs()==Rk[0].rhs()),C)
#show(RC0)
RC=[RC0[0],solve(equD.substitute(Rk[1].lhs()==Rk[1].rhs()),C)[0]]
show(RC)