Question: How to integrate the derivative of tanh

I could not figure out why Maple does not return tanh. Instead a complex valued function for real arguments is returned. This is not recent. I tried down to Maple 2020.  Is that correct?

 

D(tanh);
plot(%)

-tanh^2+1

 

 

int(D(tanh)(x),x);# I expected tanh
plot(%);# ok, no plot for real valued x

x+tanh(x)+(1/2)*ln(tanh(x)-1)-(1/2)*ln(tanh(x)+1)

 

Warning, unable to evaluate the function to numeric values in the region; complex values were detected

 

int(D(tanh)(x),x=0..infinity);# this result seems to be known in advance and fits to the above plot

1

(1)

int(D(tanh)(x),x=a..b);
eval(%,[a=0,b=infinity]);# I expected 1 from (1)
eval(%%,[a=0,b=50.]);# retruns complex for small values

-a-tanh(a)-(1/2)*ln(tanh(a)-1)+(1/2)*ln(tanh(a)+1)+b+tanh(b)+(1/2)*ln(tanh(b)-1)-(1/2)*ln(tanh(b)+1)

 

Error, (in ln) numeric exception: division by zero

 

-Float(infinity)-((1/2)*I)*Pi

(2)

evalf(int(D(tanh)(x),x=0..50))

1.000000000

(3)

Let's try integrating the identical expression sech^2

 

tanh(x)

(4)

is((sech^2=1-tanh^2)(x));# check identity

true

(5)

int(sech(x)^2,x);# what I expected

tanh(x)

(6)

 

Download Integrating_D_tanh.mw

 

 

Please Wait...