I have the function:
$$ f(n) = \begin {cases} 4 & , n = 1 \\ f(\frac{n}{3}) + n^2 -3 & , n \ge2 \end {cases} $$
The given solutions shows the unwinding of the function as follows:
Assuming $ n \ge 2$
$$f(n) = f\bigg(\frac{n}{3}\bigg) + n^2 - 3$$ $$ = \bigg[f\bigg(\frac{n}{3}\bigg) + \bigg(\frac{n}{3}\bigg)^2 -3\bigg] + n^2 -3$$ $$ = f\bigg(\frac{n}{3^2}\bigg) + n^2 \bigg(\frac{1}{9} + 1\bigg) -6$$ $$ = \bigg[f\bigg(\frac{n}{3^3}\bigg) + \bigg(\frac{n}{3}\bigg)^3 -3\bigg] + n^2\bigg(\frac{1}{9} + 1\bigg) -6$$ $$ = f\bigg(\frac{n}{3^3}\bigg) + n^2 \bigg(\frac{1}{81} + \frac{1}{9} + 1\bigg) -6$$
Where I get lost are the last two lines of the unwinding because I do not understand where the $(\frac{n}{3})^3$ becomes to $n^2(\frac{1}{81} + \frac{1}{9} + 1)$.
Question is taken from UofT CSC236 Tutorial 6