Ask Your Question
1

why doesn't rootscontract work with conjugate?

asked 2012-01-11 12:22:52 -0500

Shashank gravatar image

updated 2015-01-13 15:22:33 -0500

FrédéricC gravatar image
x=var('x')
assume(x,'real')
(sqrt(-x+1)*sqrt(x+1)).conjugate()._maxima_().rootscontract()._sage_()

It works without conjugate, but with conjugate it does not contract roots. Is there a workaround? I know I can do it by hand but, what I have above is a part of a much larger expression.

edit retag flag offensive close merge delete

Comments

Notice that you are really asking a Maxima question here, because `rootscontract` is acting on an object which you've put into Maxima. It's probably a question with an interesting answer. I'd take a look at what the `_maxima_()` looks like in each case, then try it out in `maxima_console()` and see what happens.

kcrisman gravatar imagekcrisman ( 2012-01-11 15:12:56 -0500 )edit

1 answer

Sort by » oldest newest most voted
0

answered 2012-01-12 02:04:46 -0500

niles gravatar image

The docstring for rootscontract indicates that there are optional arguments affecting the behavior of the function (radexpand and rootsconmode). These seem not to be available in the Sage wrapper, but may be related to telling Maxima that certain functions are multiplicative and therefore can be "contracted". None of them relate to the conjugate function anyway though.

Maybe Maxima is unwilling to recognize conjugation as multiplicative (e.g. for speed/memory reasons). Since you do know that conjugation is multiplicative, can you apply it after you contract the roots? For example:

x=var('x')
assume(x,'real')
a = (sqrt(-x+1)*sqrt(x+1))
(sqrt(-x+1)*sqrt(x+1))._maxima_().rootscontract()._sage_().conjugate()

conjugate(sqrt(-x^2 + 1))
edit flag offensive delete link more

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-01-11 12:22:52 -0500

Seen: 121 times

Last updated: Jan 12 '12