\begin{gathered}A(2;7)\ \ ,\ \ B(-1;-2)y=kx+bA(2;7):\ \ 7=2k+bB(-1;-2):\ \ -2=-k+bleft\{\begin{array}{l}2k+b=7\\-k+b=-2\end{array}\right\ \ \left\{\begin{array}{l}b=7-2k\\b=k-2\end{array}\right\ \ \left\{\begin{array}{l}7-2k=k-2\\b=k-2\end{array}\right\ \ \left\{\begin{array}{l}3k=9\\b=k-2\end{array}\right\end{gathered}
\begin{gathered}\left\{\begin{array}{l}k=3\\b=3-2\end{array}\right\ \ \left\{\begin{array}{l}k=3\\b=1\end{array}\right\ \ \ \ \Rightarrow \ \ \ \boxed{\ y=3x+1\ }\end{gathered}
\begin{gathered}A(2;7)\ \ ,\ \ B(-1;-2)y=kx+bA(2;7):\ \ 7=2k+bB(-1;-2):\ \ -2=-k+bleft\{\begin{array}{l}2k+b=7\\-k+b=-2\end{array}\right\ \ \left\{\begin{array}{l}b=7-2k\\b=k-2\end{array}\right\ \ \left\{\begin{array}{l}7-2k=k-2\\b=k-2\end{array}\right\ \ \left\{\begin{array}{l}3k=9\\b=k-2\end{array}\right\end{gathered}
\begin{gathered}\left\{\begin{array}{l}k=3\\b=3-2\end{array}\right\ \ \left\{\begin{array}{l}k=3\\b=1\end{array}\right\ \ \ \ \Rightarrow \ \ \ \boxed{\ y=3x+1\ }\end{gathered}