# integral() failing with "segmentation fault"

Hi sage community

My question again arises from exercises in technical chemistry done in sage. I wanted to calculate an definite integral (number of transfer units).

var('x')
ys=0.06+2*(x-0.0275)
xs=ys/1.516

#my function
i=1/(xs/(1+xs)-x/(1+x))
#print i
#show(plot(i,x,0,0.03))

#I, the indefinite integral of i
I=integral(i,x)
#print I
#show(plot(I,x,0,0.03))

#three methods too calculate the integral
print n(I(x=0.0275)-I(x=0))
print numerical_integral(i,0,0.0275)
print integral(i,x,0,0.275)


The first two methods work fine. The last method gives me the infinite of the following messages.

;;;
;;; Detected access to protected memory, also kwown as 'bus or segmentation fault'.
;;; Jumping to the outermost toplevel prompt
;;;


This is a bug, isn't it? However, i have no idea how integrate() works.

Greetings, marv

edit retag close merge delete

Sort by » oldest newest most voted

I can reproduce your behaviour, i confirm this is a bug :(

It is reported as trac ticket 15747.

more

I can confirm that this problem also occurs with the integral to 11/40.

That said,

sage: i
1/((1.31926121372032*x + 0.00329815303430079)/(1.31926121372032*x + 1.00329815303430) - x/(x + 1))


and usually Maxima does not particularly like integrating floating point things exactly, because it sort of doesn't make sense.

sage: numerical_integral(i,0,0.275)
(12.325862793647284, 4.191806193893343e-11)

more

you're right, the problem doesn't occur when defining all decimals as fractions