#### Answer

The solution is
$$\lim_{x\to1}\frac{x\ln x-x+1}{x\ln^2 x}=\frac{1}{2}.$$

#### Work Step by Step

To solve this limit follow the steps below. LR will stand for Apply L'Hopital's rule.
$$\lim_{x\to1}\frac{x\ln x-x+1}{x\ln^2 x}=\left[\frac{1\cdot\ln1-1+1}{1\cdot\ln^2 1}\right]=\left[\frac{0}{0}\right][\text{LR}]=\lim_{x\to1}\frac{(x\ln x-x+1)'}{(x\ln^2 x)'}=\lim_{x\to1}\frac{(x)'\ln x+x(\ln x)'-(x)'+(1)'}{(x)'\ln^2 x+x(\ln^2 x)'}=\lim_{x\to1}\frac{\ln x+x\cdot\frac{1}{x}-1}{\ln^2 x+x\cdot2\ln x(\ln x)'}=\lim_{x\to1}\frac{\ln x+1-1}{\ln^2 x+2x\ln x\cdot\frac{1}{x}}=\lim_{x\to 1}\frac{\ln x}{\ln^2 x+2\ln x}=\lim_{x\to1}\frac{\ln x}{\ln x(\ln x+2)}=\lim_{x\to 1}\frac{1}{\ln x+2}=\frac{1}{\ln 1+2}=\frac{1}{2}.$$