Asymptotic runtime of recursive algorithm uisng subsitution method
Here is an argument by substitution:
$$\begin{aligned}
T(n) &amp;= 3T(n/2)+2n \\&amp;= 3(3T(n/4)+n)+2n \\&amp;= 3(3(3(T(n/8)+n/2)+n)+2n \\&amp;= \cdots \\&amp;= 3^kT(n/2^k)+\sum_{i=0}^{k-1}{2n\left(\frac{3}{2}\right)^i} \\&amp;= 3^kT(n/2^k)+2n\frac{\left(\frac{3}{2}\right)^k-1}{\left(\frac{3}{2}\right)-1} \\&amp;= 3^kT(n/2^k)+4n\left(\frac{3}{2}\right)^k-4n
\end{aligned}$$
Here, we stop to expand terms when $n/2^k=1$, or equivalently, when $k=log_2n$. Using that knowledge and the identity that you wrote in your question, we get that:
$$\begin{aligned}
T(n) &amp;= 3^{log_2n}T(1)+4n\left(\frac{3}{2}\right)^{log_2n}-4n \\&amp;= n^{log_2{3}}+4n\cdot n^{log_2\frac{3}{2}}-4n \\&amp;= \cdots \\&amp;= 5n^{log_2{3}}-4n \\&amp;\in\mathcal{O}(n^{log_2{3}})
\end{aligned}$$
So as you can see, the fact that you have a factor 3 outside and a factor 2 inside makes your runtime polynomial in $n$.