The original formula is this. 
We're computing the complexity of an insertion sort.

How did the first formula turned into the second formula?
The original formula is this. 
We're computing the complexity of an insertion sort.

How did the first formula turned into the second formula?
Copyright © 2021 JogjaFile Inc.
$t_j = 1$ for $j = 2,\ldots,n$, so the sums with $(t_j-1)$ vanish, and $\sum_{j=2}^{n} t_j = n-1$. We then get:
$$\begin{align} T(n) &= c_1 n + c_2(n-1) + c_4(n-1) + c_5(n-1) + c_8(n-1) \\ &= c_1 n + (c_2 + c_4 + c_5 + c_8)(n-1) \\&= c_1 n + (c_2 + c_4 + c_5 + c_8)n - (c_2 + c_4 + c_5 + c_8) \\&= (c_1 + c_2 + c_4 + c_5 + c_8)n - (c_2 + c_4 + c_5 + c_8) \end{align} $$