# Problems with maxima.function of one variable

Here is a mwe of my query:

sage: var('F,F1,F2,h')
sage: MF = maxima.function('b','F+F1*b^2+F2*b^3')
sage: k1 = MF(0)
sage: k2 = MF(h*k1)

Maxima ERROR:
incorrect syntax: f is not an infix operator
h F)

sage: F+F1*(h*k1)^2+F2*(h*k1)^3

h^3*F^3*F2+h^2*F^2*F1+F


Now, I had none of this problem when I was using Maxima functions of two variables:

sage: var('c')
sage: MF = maxima.function('a,b','F+F1*b^2+F2*a^2')
sage: k1 = MF(0,0)
sage: k2 = MF(h*c,h*k1)
sage: k2

c2^2*h^2*F2+h^2*F^2*F1+F


Can anybody enlighten me why a Maxima function of two variables should work perfectly well, but a Maxima function of one variable produces errors? And how can I work round this?

edit retag close merge delete

Sort by » oldest newest most voted

Having now diagnosed the problem rws reported, I think a good workaround is

sage: k2 = MF(h*k1.sage())
sage: k2
h^3*F^3*F2+h^2*F^2*F1+F


Basically, k1 is a Maxima element, not a Sage element, so you have to be careful putting it back with a Sage expression, like h.

Hopefully we can get #16592 fixed as well, of course.

more

I have reported this as http://trac.sagemath.org/ticket/16592

Thanks for the report!

more