\[ \int \frac {x}{\tanh ^{-1}(\tanh (a+b x))^2} \, dx \]
Optimal antiderivative \[ -\frac {x}{b \arctanh \left (\tanh \left (b x +a \right )\right )}+\frac {\ln \left (\arctanh \left (\tanh \left (b x +a \right )\right )\right )}{b^{2}} \]
command
integrate(x/atanh(tanh(b*x+a))**2,x)
Sympy 1.10.1 under Python 3.10.4 output
\[ \begin {cases} - \frac {x}{b \operatorname {atanh}{\left (\tanh {\left (a + b x \right )} \right )}} + \frac {\log {\left (\operatorname {atanh}{\left (\tanh {\left (a + b x \right )} \right )} \right )}}{b^{2}} & \text {for}\: b \neq 0 \\\frac {x^{2}}{2 \operatorname {atanh}^{2}{\left (\tanh {\left (a \right )} \right )}} & \text {otherwise} \end {cases} \]
Sympy 1.8 under Python 3.8.8 output
\[ \text {Exception raised: TypeError} \]________________________________________________________________________________________