I used the following code
using QuadGK
v = quadgk(x->cos(x)^2/((x+1)*(x^2-x+1)),-pi,0)[1]
and got the error below
ERROR: DomainError with -1.0000000000000009:
integrand produced Inf in the interval (-1.0000000000000022, -0.9999999999999996)
Please help me to resolve this situation.
Thank you.