Ask Your Question
0

Numerical form of the symbolic expression

asked 2020-11-09 13:53:31 -0600

huhahu gravatar image

updated 2020-11-10 00:58:49 -0600

Emmanuel Charpentier gravatar image

I have a symbolic expression ( a variable polynomial of n degree)

1/9*sqrt(3)*(2*sqrt(3)*x^2*e^(1/2*sqrt(3)) + 3*x*e^(1/2*sqrt(3)))

If possible, I would like these in numeric form as

1.37262 x+1.58496 x^2

Is there a function which does it?

edit retag flag offensive close merge delete

Comments

Please format your math expressions as such...

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2020-11-10 00:59:32 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
2

answered 2020-11-10 01:05:22 -0600

Emmanuel Charpentier gravatar image

updated 2020-11-10 01:07:24 -0600

This one-liner :

sage: sum([u[0].n()*x^u[1]
                 for u in (1/9*sqrt(3)*(2*sqrt(3)*x^2*e^(1/2*sqrt(3)) + 3*x*e^(1/2*sqrt(3)))).coefficients()])
1.58496178349078*x^2 + 1.37261716853050*x

does the trick. Is it useful ?

HTH,

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

1 follower

Stats

Asked: 2020-11-09 13:53:31 -0600

Seen: 65 times

Last updated: Nov 10 '20