I don't understand how T(1), T(x), and T(x^2) were found in the picture so I did it using another method I saw on StackExchange.
(a + b)x - c => -c + (a + b)x + 0x^2 so the first row would be {0, 0, -1} (-c), second row {1, 1, 0} ( (a+b)x ) and third row {0, 0, 0,} (no x^2) but it's slightly different than the answer. What am I doing wrong or how do you calculate the way it's shown in the picture? Thanks.

The difference between your method and the given solution is that you have ordered your basis $\{x^2,x,1\}$, but the problem tells you to order it $\{1,x,x^2\}$.