Assume expression to be noninteger

asked 2020-06-09 13:40:33 +0200

wobbuuu gravatar image

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 23:51:00 +0200 )edit