Ask Your Question

Numerical approximations

asked 2015-06-03 18:33:02 -0600

updated 2015-06-03 21:08:18 -0600

kcrisman gravatar image

[x == -2^(1/4), x == 2^(1/4)]

What's the best/quickest way to get numerical approximations of these values of x? Thanks.

edit retag flag offensive close merge delete

3 answers

Sort by ยป oldest newest most voted

answered 2015-06-05 07:41:22 -0600

With my background neither is particularly straight-forward but I am happy to learn about both methods. Thanks.

edit flag offensive delete link more

answered 2015-06-05 06:39:02 -0600

tmonteil gravatar image

In your case, since g can be seen as a polynomial, you can also look at its roots in the real double field (floating-point approximations with 53 bits of precision):

sage: g.polynomial(RDF).roots()
[(-1.189207115002721, 1), (1.189207115002721, 1)]
edit flag offensive delete link more


I see two ordered pairs, I think, but if that's so I don't understand why the y-values are 1 and not 0.

Ducky47 gravatar imageDucky47 ( 2015-06-05 07:49:09 -0600 )edit

OK. "The first of the pair is the root, the second of the pair is its multiplicity."

Ducky47 gravatar imageDucky47 ( 2015-06-05 10:07:38 -0600 )edit

answered 2015-06-03 21:10:46 -0600

kcrisman gravatar image

Try taking the right hand side of each solution.

sage: A =    solve(g(x)==0,x)
sage: [a.rhs().n() for a in A]
[-1.18920711500272, 1.18920711500272]

where n() is short for numerical_approx(). There are other ways of approaching this as well, such as via the solution_dict=True keyword to solve().

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools


Asked: 2015-06-03 18:33:02 -0600

Seen: 181 times

Last updated: Jun 05 '15