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, 01 Mar 2012 10:08:52 +0100solving sqrt(-1) to a real numberhttps://ask.sagemath.org/question/8762/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.Thu, 01 Mar 2012 09:26:06 +0100https://ask.sagemath.org/question/8762/solving-sqrt-1-to-a-real-number/Comment by kcrisman for <p>Here is what I am trying to do:</p>
<pre><code>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)
</code></pre>
<p>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).</p>
<p>How can I make SageMath solve those? I tried simplify() and full_simplify(), maxima_methods() and rootscontract() gives an error in combination with solve().</p>
<p>I guess it's just some syntax error, sorry for that :(</p>
<p>For now I do most in the Sage - Cell Server, which is great.</p>
https://ask.sagemath.org/question/8762/solving-sqrt-1-to-a-real-number/?comment=20192#post-id-20192Great that you like the cell server! For more power, consider trying a notebook server, and then of course downloading your own :)Thu, 01 Mar 2012 09:45:54 +0100https://ask.sagemath.org/question/8762/solving-sqrt-1-to-a-real-number/?comment=20192#post-id-20192Answer by achrzesz for <p>Here is what I am trying to do:</p>
<pre><code>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)
</code></pre>
<p>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).</p>
<p>How can I make SageMath solve those? I tried simplify() and full_simplify(), maxima_methods() and rootscontract() gives an error in combination with solve().</p>
<p>I guess it's just some syntax error, sorry for that :(</p>
<p>For now I do most in the Sage - Cell Server, which is great.</p>
https://ask.sagemath.org/question/8762/solving-sqrt-1-to-a-real-number/?answer=13320#post-id-13320sage: 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)]
Thu, 01 Mar 2012 10:04:24 +0100https://ask.sagemath.org/question/8762/solving-sqrt-1-to-a-real-number/?answer=13320#post-id-13320Comment by disi for <p>sage: A(x)=x/2+(4-x*x)^(1/2)</p>
<p>sage: solve(diff(A(x),x),x,to_poly_solve=true)</p>
<p>[x == 2/5*sqrt(5)]</p>
https://ask.sagemath.org/question/8762/solving-sqrt-1-to-a-real-number/?comment=20191#post-id-20191that works perfect, thanks :)Thu, 01 Mar 2012 10:08:52 +0100https://ask.sagemath.org/question/8762/solving-sqrt-1-to-a-real-number/?comment=20191#post-id-20191