# about solve() 2 equations

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 ?.

edited[june 27] because can't put new code in comment (I've been told is too long)

```
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')
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=-3*C==k*p
equD=k^3==4*C
show([equD,equC])
Result=solve([equD,equC],k,C)
for j in range(len(Result)) :
show(Result[j])
```

Short answer: The program which does the solving (Maxima) explicitly does not take such assumptions into account when doing so, while it does for other algorithms like integration.

https://www.maths-forum.com/cafe-math...