ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 15 Nov 2018 15:17:54 +0100solve() is not giving the right solutionshttps://ask.sagemath.org/question/44292/solve-is-not-giving-the-right-solutions/Hey there,
i need your help on this one. The following sage code is giving me a headache:
- f(x) = x^3 + x^2 - 0.1
- solve(f==0, x)
- -->
- [x == -1/2*(1/180*I*sqrt(13)*sqrt(3) + 7/540)^(1/3)*(I*sqrt(3) + 1) - 1/18*(-I*sqrt(3) + 1)/(1/180*I*sqrt(13)*sqrt(3) + 7/540)^(1/3) - 1/3, x == -1/2*(1/180*I*sqrt(13)*sqrt(3) + 7/540)^(1/3)*(-I*sqrt(3) + 1) - 1/18*(I*sqrt(3) + 1)/(1/180*I*sqrt(13)*sqrt(3) + 7/540)^(1/3) - 1/3, x == (1/180*I*sqrt(13)*sqrt(3) + 7/540)^(1/3) + 1/9/(1/180*I*sqrt(13)*sqrt(3) + 7/540)^(1/3) - 1/3]
So i'm getting these 3 solutions, but they are not in R (real numbers), which they should be.
Im figuring there is some problem with really long terms or something? Is there an easy solution for this? Is the solve()-method here working as intended?
Regards,
BenbentheteacherThu, 15 Nov 2018 15:17:54 +0100https://ask.sagemath.org/question/44292/Get Sage to display the 2nd x value, when function is set to 0?https://ask.sagemath.org/question/10232/get-sage-to-display-the-2nd-x-value-when-function-is-set-to-0/I did the following and only got 3/2 as an answer, instead of getting 3/2 & 8, as an answer:
ans=solve(2*x^2-19*x+24==0,x)
x0=ans[0].rhs()
show(x0)
Doing, factor(2*x^2-19*x+24), displays, (x - 8)*(2*x - 3).
bxdinTue, 23 Jul 2013 13:43:59 +0200https://ask.sagemath.org/question/10232/