I have seen a few examples of using the master theorem on this to obtain O(n*log^2(n)) as an answer. I am trying to solve this by unrolling and solving the summation, but I can't seem to get the same answer. My steps are below.
Given $T(1) = 1$, $T(2) = 1$ (Time taken is constant in these two cases)
I noticed that by unrolling a few times: $$T(n) = 2\left[2T\left(\frac{n}{4}\right)+\frac{n}{2}\log{\frac{n}{2}}\right] + n\log n$$ $$T(n) = 2^{2}T\left(\frac{n}{2^{2}}\right)+n \log{\frac{n}{2}} + n\log n$$ $$T(n) = 2^{2}\left[2T(\frac{n}{8})+\frac{n}{2}\log{\frac{n}{4}}\right]+n \log{\frac{n}{2}} + n\log n$$ $$T(n) = 2^{3}T\left(\frac{n}{8}\right)+2n\log{\frac{n}{4}}+n \log{\frac{n}{2}} + n\log n$$
This looks like it follows $$T(n) = \underbrace{2^{k}T\left(\frac{n}{2^k}\right) + 2^{k}n\log\left(\frac{n}{2^{k+1}}\right)}_{\log_2n \text{ times}}$$
I use the fact that $\frac{n}{2^k} = 1$, so $k = \log_2n$. Substituting this in: $2^{k}T(\frac{n}{2^k})$ = $2^{\log_2n}T(1) = n$
Doing this summation as: $$T(n)=n + n\log_2{n}+\sum_{k=0}^{\log_2{n}-1}2^{k} n \log_2\left(\frac {n} {2^{k+1}}\right)$$ $$T(n)=n + n\log_2{n}+n\sum_{k=0}^{\log_2{n}-1}2^{k} \log_2\left(\frac {n} {2^{k+1}}\right)$$ $$T(n)=n + n\log_2{n}+n\sum_{k=0}^{\log_2{n}-1}2^{k} \log_2(n-k+1)$$
This is where I get stuck, I have a feeling I messed something up somewhere and it is making this summation much harder to solve, but I am not sure where. Where did I go wrong?