Lời giải:
a)
Để (d) đi qua $B(0,2)$ thì:
\(y_B=x_B+n-1\)
\(\Leftrightarrow 2=0+n-1\Leftrightarrow n=3\)
b)
PT hoành độ giao điểm:
\(x^2-(x+n-1)=0\)
\(\Leftrightarrow x^2-x+(1-n)=0(*)\)
Để (P) cắt (d) tại 2 điểm phân biệt thì PT (*) phải có 2 nghiệm phân biệt.
\(\Leftrightarrow \Delta=1-4(1-n)>0\leftrightarrow n>\frac{3}{4}\)
Áp dụng ĐL Vi-et: \(\left\{\begin{matrix} x_1+x_2=1\\ x_1x_2=1-n\end{matrix}\right.\) (\(x_1,x_2\neq 0\Leftrightarrow n\neq 1)\)
Khi đó:
\(\frac{1}{x_1}+\frac{1}{x_2}-x_1x_2+3=0\)
\(\Leftrightarrow \frac{x_1+x_2}{x_1x_2}-x_1x_2+3=0\)
\(\Leftrightarrow \frac{1}{1-n}-(1-n)+3=0\)
\(\Leftrightarrow -(1-n)^2+3(1-n)+1=0\)
\(\Rightarrow 1-n=\frac{3\pm \sqrt{13}}{2}\)
\(\Rightarrow \left[\begin{matrix} n=\frac{-1-\sqrt{13}}{2}\\ n=\frac{-1+\sqrt{13}}{2}\end{matrix}\right.\). Kết hợp với điều kiện của $n$ suy ra \(n=\frac{-1+\sqrt{13}}{2}\)