Ask Your Question

declare a variable as *not* an integer for solve

asked 2016-09-21 04:11:14 -0500

Antoine-sac gravatar image

I am trying to solve symbolically a simple equation for x:

solve(x^K + d == R, x)

I am declaring these variables and assumptions:

var('K, d, R')
assume(K, 'real')

︡> [K > 0, K is real, R > 0, R < 1]

Yet when I run the solve, I obtain the following error:

Error in lines 1-1

Traceback (most recent call last):

File "/projects/sage/sage-7.3/local/lib/python2.7/site-packages/smc_sagews/", line 957, in execute exec compile(block+'\n', '', 'single') in namespace, locals


File "/projects/sage/sage-7.3/local/lib/python2.7/site-packages/sage/interfaces/", line 671, in __init__ raise TypeError(x)

TypeError: Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation may help (example of legal syntax is 'assume(K>0)', see assume? for more details)

Is K an integer?

Apparently, maxima is asking whether K is an integer? But I explicitly declared it 'real'! How can I spell out to maxima that it should not assume that K is an integer?


edit retag flag offensive close merge delete


kcrisman gravatar imagekcrisman ( 2016-09-21 07:23:32 -0500 )edit

1 answer

Sort by » oldest newest most voted

answered 2016-09-21 09:42:36 -0500

kcrisman gravatar image

For completeness, it turns out that indeed assuming K is 'noninteger'apparently works. See for documenting this better.

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

1 follower


Asked: 2016-09-21 04:11:14 -0500

Seen: 124 times

Last updated: Sep 21 '16