Assume expression to be noninteger

asked 2020-06-09 06:40:33 -0500

Hello! How to assume expression to be an integer? I try to do some symbolic integration while Sage asks to provide additional info about expression. MWE:

var('x a b')
assume(b > 0)
f = (exp((x-a)/b) + 1)**(-1)
(f*f).integrate(x, 0, oo)

gives:

ValueError: Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation may help (example of legal syntax is 'assume((2a)/b>0)', see assume? for more details) Is (2a)/b an integer?

How to assume that (2*a)/b is an arbitrary positive real number? Straightforward assume((2*a)/b, 'noninteger') gives:

TypeError: self (=2*a/b) must be a relational expression

Thanks!

edit retag flag offensive close merge delete

Comments

It seems that only variables, not expressions, can be declared noninteger. Anyway, you can get the result if you replace the last line by:

g = (f*f).integrate(x)
limit(g,x=+oo)-g(x=0)
Juanjo gravatar imageJuanjo ( 2020-06-09 16:51:00 -0500 )edit