Ask Your Question

how to use certain maxima functions (e.g. ratsubst)?

asked 2012-03-12 03:24:47 -0600

matthjes gravatar image

updated 2015-01-14 07:17:13 -0600

FrédéricC gravatar image

I cannot figure out how to use maxima functions like ratsubst within sage.

For example: X = maxima('x^2') Now I'd like to substitute x with k. In Maxima, this is done via: X: x^2; ratsubst(k, x, X);

How do I call ratsubst from Sage? If I use X.ratsubst('k', 'x') then it simply prints out 'x'...

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted

answered 2012-03-12 05:40:44 -0600

achrzesz gravatar image
sage: maxima('X:x^2')            
sage: maxima('ratsubst(k,x,X)')
sage: maxima('X,x=k')            
edit flag offensive delete link more


sage: X=x^2 sage: var('k') k sage: X(x=k) k^2

achrzesz gravatar imageachrzesz ( 2012-03-12 05:43:33 -0600 )edit

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: 2012-03-12 03:24:47 -0600

Seen: 396 times

Last updated: Mar 12 '12