# Domain error at the integrand using QuadGK

Hello, everyone! I am trying to perform the numerical integration of the function \tanh^2(z) using QuadGK.jl with the following code

using Plots

k(z) = tanh(z)^2
plot(k)

DomainError with -0.9999999999999964:

tanh(x) tends to \pm 1 as x\rightarrow \pm \infty. So the integral you want to evaluate diverges.