# Sum of Big O - which one is it?

If $f_1(x) = O(g_1(x))$ and $f_2(x) = O(g_2(x))$ then $f_1(x) + f_2(x) = O(|g_1(x)| + |g_2(x)|)$.
If $f_1(x) = O(g_1(x))$ and $f_2(x) = O(g_2(x))$ then $f_1(x) + f_2(x) = O(\max(g_1(x), g_2(x)))$.
They are equivalent (assuming that $g_1,g_2$ are assumed non-negative in your textbook). Note that $$\max(a,b)\leq a+b \leq 2\max(a,b)$$ for any $a,b\geq 0$, and that the constant $2$ can be "hidden" in the $O(\cdot)$ notation.