integral sometimes gives ln with negative aqrgument

i do:

int(ln(k3+r)/r^2,r);

i get:

either 1/k3*ln(r)-ln(k3+r)*(k3+r)/k3/r

or 1/k3*ln(-r)-ln(k3+r)*(k3+r)/k3/r

the expected behaviour would be to always get the absolute value inside the ln

alec's picture

logarithms in Maple

In Maple, numbers are complex by default, and logarithms for negative numbers are defined as log(-n)=log(n)+Pi*I.

with(RealDomain);

would give logarithms of absolute values (but you'll see some other weird things instead.)

Alec

with(RealDomain) does not

with(RealDomain) does not solve the problem

alec's picture

No solution

AFAICT, there is no a good solution for working with real numbers in Maple. Just some ad hoc tricks.

Alec

 

ln and RealDomain

For something simpler:

use RealDomain in int(1/x,x) end use;

		ln(x)

Should the output be ln(abs(x)) ? or a piecewise: ln(x) for x>0 and undefined for x<=0 ?

Note, ?RealDomain states:

Results returned by procedures are postprocessed by discarding values containing any detectable non-real answers or replacing them with undefined where appropriate.
edgar's picture

there is this

Re(int(1/x,x));
ln(|x|)

---
G A Edgar

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
}