By definition $f(n)=\Theta(n^2)$ if $f(n)$ can be sandwiched between two different constant multiples of $n^2$. In your example, we have that $0.4n^2 \le 0.5n^2-3n \le 0.5n^2$ for all sufficiently large $n$. For large $n$, the $n^2$ term dominates the linear term. For eg, $0.5 (1000^2) - 3(1000)$ is roughly $0.5(1000^2)$). Also, the coefficient $0.5$ doesn't matter - see the literature for why we do asymptotic analysis. It's the asymptotic growth rate (which is quadratic) that determines how good/bad the algorithm is. Having a computer twice as fast would take care of the constant.
– Ashwin GanesanOct 07 '19 at 04:04