Hi I have 2 questions
1) Why, when I tell SageMath that k is a real number SageMath continues to give me complex solutions for k ?
2) why solve([k^3==4*C,equC],k,C) does not work ?
(when I uncomment the last line in the code below) I suppose the code is not correct ?.
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') # integer 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(C, 'real')
assume(k>0)
assume(k,'real')
equ=t^3 + p*t + q==0
trigequ=4*(cos(theta))^3 -3*cos(theta)==cos(3*theta)
equ1=equ.substitute(t=k*cos(theta))
equf=equ1.lhs()-q==C*trigequ.lhs()
show(equf)
#solve([equf],C,k)
equC=solve(3*C==k*p,C)
show(equC)
solve([k^3==4*C],k)
#solve([k^3==4*C,equC],k,C)