4:
1: x1+x2=-5/3; x1x2=-2
\(A=\dfrac{x_2^2-x_2+x_1^2-x_1}{\left(x_1-1\right)\left(x_2-1\right)}\)
\(=\dfrac{\left(x_1+x_2\right)^2-2x_1x_2-\left(x_1+x_2\right)}{x_1x_2-\left(x_1+x_2\right)+1}\)
\(=\dfrac{\dfrac{25}{9}-2\cdot\left(-2\right)+\dfrac{5}{3}}{-2+\dfrac{5}{3}+1}=\dfrac{38}{3}\)
2: \(B=\dfrac{x_1x_2+2x_2+x_1x_2+2x_1}{x_1x_2}\)
\(=\dfrac{2x_1x_2+2\left(x_1+x_2\right)}{x_1x_2}\)
\(=\dfrac{2\cdot\left(-2\right)+2\cdot\left(-\dfrac{5}{3}\right)}{-2}=\dfrac{11}{3}\)