Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

This one-liner :

sage: [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.37261716853050*x, 1.58496178349078*x^2]

does the trick. Is it useful ?

HTH,

This one-liner :

sage: [u[0].n()*x^u[1] 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.37261716853050*x, 1.58496178349078*x^2]
3*x*e^(1/2*sqrt(3)))).coefficients()])
1.58496178349078*x^2 + 1.37261716853050*x

does the trick. Is it useful ?

HTH,