Theo đề, ta có hệ phương trình:
\(\left\{{}\begin{matrix}f\left(1\right)=g\left(2\right)\\f\left(-1\right)=f\left(5\right)\end{matrix}\right.\Leftrightarrow\left\{{}\begin{matrix}2-a+4=50+5a+4\\2+a+4=4-10-b\end{matrix}\right.\)
\(\Leftrightarrow\left\{{}\begin{matrix}6-a=54+5a\\a+6=14-b\end{matrix}\right.\Leftrightarrow\left\{{}\begin{matrix}-6a=48\\a+b=8\end{matrix}\right.\Leftrightarrow\left\{{}\begin{matrix}a=-8\\b=16\end{matrix}\right.\)