Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Display x-intercept of a plot, involving x raised to the 3rd power.

The following is my syntax to generate the plot:

e1= x^3 + 4*x - 7
f(x)= e1.subs(x=x)
p1= plot(e1, (x,-15,15), ymin=-15, ymax=15)
p0= p1
show(p0)

Now to try and generate where on the x-axis the the plot crossed, 1.255 according to the author, I tried to get sage to solve for x, but it generated irrelevant answers:

ans = (solve(x^3 + 4*x - 7 == 0, x))
print (ans)
show(ans)

I tried substituting the value that didn't include imaginary into the original equation: x^3 + 4*x - 7, I got 1.333 x 10^-15, which is totally different from the author's.

The original question was: given f(x) = x^3 + 4*x - 2, one needs to evaluate f^-1(-5).