Ask Your Question
0

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

asked 2012-03-12 09:24:47 +0200

matthjes gravatar image

updated 2015-01-14 14:17:13 +0200

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 11:40:44 +0200

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 11:43:33 +0200 )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 09:24:47 +0200

Seen: 655 times

Last updated: Mar 12 '12