Ask Your Question

Numerical form of the symbolic expression

asked 2020-11-09 20:53:31 +0200

huhahu gravatar image

updated 2020-11-10 07:58:49 +0200

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


Please format your math expressions as such...

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2020-11-10 07:59:32 +0200 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2020-11-10 08:05:22 +0200

Emmanuel Charpentier gravatar image

updated 2020-11-10 08:07:24 +0200

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 ?


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


Asked: 2020-11-09 20:53:31 +0200

Seen: 206 times

Last updated: Nov 10 '20