a) ĐKXĐ: \(x\ne\pm1;x\ne0\)
\(M=\left(\frac{x+1}{x-1}-\frac{x-1}{x+1}+\frac{x^2-4x-1}{x^2-1}\right).\frac{x+2020}{x}\)
\(=\left(\frac{\left(x+1\right)^2-\left(x-1\right)^2+x^2-4x-1}{\left(x+1\right)\left(x-1\right)}\right).\frac{x+2020}{x}\)
\(=\frac{x^2+2x+1-x^2+2x-1+x^2-4x-1}{\left(x+1\right)\left(x-1\right)}.\frac{x+2020}{x}\)
\(=\frac{x^2-1}{\left(x+1\right)\left(x-1\right)}.\frac{x+2020}{x}\)
\(=\frac{x+2020}{x}\)
b) Tại x = -1, ta có:
\(M=\frac{-1+2020}{-1}=\frac{2019}{-1}=-2019\)
Tại x = \(\frac{1}{2}\), ta có:
\(M=\frac{\frac{1}{2}+2020}{\frac{1}{2}}=\frac{\frac{4041}{2}}{\frac{1}{2}}=\frac{4041}{2}.2=4041\)