Algebrite icon indicating copy to clipboard operation
Algebrite copied to clipboard

integral(1/x) should be log(abs(x))

Open murkle opened this issue 8 years ago • 4 comments

Algebrite.run("integral(x^(-1))")
"log(x)"
Algebrite.run("integral(1/x)")
"log(x)"

murkle avatar May 24 '16 18:05 murkle

that's assuming a function reals to reals. At this point the question is weather it's wiser to ignore the complex and force reals to reals?

davidedc avatar May 25 '16 00:05 davidedc

i.e. in Algebrite this is valid defint(1/x,x,-1,i) = -1/2 i pi . In the "reals to reals only" definition that would be zero instead. I'm not familiar enough to that part of the code to know whether there is a way to force a "reals to reals only" constraint...

davidedc avatar May 25 '16 08:05 davidedc

Also related d(log(abs(x)), shouldn't be 1/x? Algebrite returns sign(x)/abs(x)

ribrdb avatar Feb 22 '17 22:02 ribrdb

@ribrdb Yes, I think the problem is two-fold. 1) Algebrite tries to work in the complex domain, and there it somehow gets the wrong derivative in the first place: the derivative of abs(x) in the complex domain is not well defined and Algebrite just sets it to sign(x) (which is only true in the reals). 2) Then, once Algebrite gets the wrong result "sign(x)/abs(x)", it can't simplify that to 1/x because in the complex domain the two quantities are different.

The solution to most of this is to use a flag to restrict variables to the real domain... I have added such flag, but it hasn't penetrated many parts of the code yet...

davidedc avatar May 10 '17 10:05 davidedc