Ask Your Question
0

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

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

matthjes gravatar image

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

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
0

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

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

Comments

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

achrzesz gravatar imageachrzesz ( 2012-03-12 05:43:33 -0500 )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

Stats

Asked: 2012-03-12 03:24:47 -0500

Seen: 220 times

Last updated: Mar 12 '12