Đặt \(\frac{a}{b}=x\)
\(\left\{{}\begin{matrix}\overrightarrow{AB}=\left(2;2\right)\\\overrightarrow{MA}=\left(1-x;2\right)\\\overrightarrow{MB}=\left(3-x;4\right)\end{matrix}\right.\) \(\Rightarrow\left\{{}\begin{matrix}2\overrightarrow{AB}+\overrightarrow{MA}+\overrightarrow{MB}=\left(8-2x;10\right)\\\overrightarrow{MA}+\overrightarrow{MB}=\left(4-2x;6\right)\end{matrix}\right.\)
\(P=\sqrt{\left(8-2x\right)^2+10^2}+\sqrt{\left(4-2x\right)^2+6^2}\)
\(P=\sqrt{\left(8-2x\right)^2+10^2}+\sqrt{\left(2x-4\right)^2+6^2}\)
\(P\ge\sqrt{\left(8-2x+2x-4\right)^2+\left(10+6\right)^2}=4\sqrt{17}\)
Dấu "=" xảy ra khi \(6\left(8-2x\right)=10\left(2x-4\right)\Leftrightarrow x=\frac{11}{4}\)
\(\Rightarrow a+b=15\)