I am trying to understand the process of finding the complexity of a nested for loop.
I understand all the steps of the solution provided, except for one which I find unintuitive:
$$\sum_{j=1}^n \Theta(j^2) = \Theta\left(\sum_{j=1}^n j^2\right) $$ which then evaluates to $ \Theta(n^3)$.
Is there a simple way to explain this step? What am I missing?
I tried expanding the LHS, which gives $ \Theta(1^2) + \Theta(2^2) + ... + \Theta(n^2) = \Theta(n^3) $.
But i'm unsure on how to do a sum of big theta functions.
Ignoring the big thetas on the LHS or grouping them all within a single big theta (like treating the big theta as a variable, instead of a function) essentially yields the RHS of the step in question, but this method seems haphazard.