# solving sqrt(-1) to a real number

Here is what I am trying to do:

var('x')
A(x)=x/2+(4-x*x)^(1/2)
assume(0<x<2)
maximum = (derivative(A)==0).maxima_methods().rootscontract().simplify()
view(maximum)
view(solve(maximum,x))
A.plot(A,0,2)


and get i multiplied by the root of x^2... if I put the same equation into wolfram, it gives me a real number 2/sqrt(5) (which is correct and makes sense).

How can I make SageMath solve those? I tried simplify() and full_simplify(), maxima_methods() and rootscontract() gives an error in combination with solve().

I guess it's just some syntax error, sorry for that :(

For now I do most in the Sage - Cell Server, which is great.

edit retag close merge delete

Great that you like the cell server! For more power, consider trying a notebook server, and then of course downloading your own :)

( 2012-03-01 09:45:54 +0200 )edit

Sort by ยป oldest newest most voted

sage: A(x)=x/2+(4-x*x)^(1/2)

sage: solve(diff(A(x),x),x,to_poly_solve=true)

[x == 2/5*sqrt(5)]

more

that works perfect, thanks :)

( 2012-03-01 10:08:52 +0200 )edit