Ask Your Question
1

solving sqrt(-1) to a real number

asked 2012-03-01 09:26:06 +0100

disi gravatar image

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 flag offensive close merge delete

Comments

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

kcrisman gravatar imagekcrisman ( 2012-03-01 09:45:54 +0100 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2012-03-01 10:04:24 +0100

achrzesz gravatar image

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)]

edit flag offensive delete link more

Comments

that works perfect, thanks :)

disi gravatar imagedisi ( 2012-03-01 10:08:52 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2012-03-01 09:26:06 +0100

Seen: 612 times

Last updated: Mar 01 '12