# Show that $O(\text{max}\{f(n),g(n)\})=O(f(n)+g(n))$

Show that $$O(\text{max}\{f(n),g(n)\})=O(f(n)+g(n))$$

Can I keep the same constant $$c$$ in each of the cases?

Consider two cases: $$1)f(n)>g(n);O(\text{max}\{f(n),g(n)\})⇒O(f(n))\Rightarrow d(n) ≤c⋅f(n);c>0$$ $$2)f(n)≤g(n);O(\text{max}\{f(n),g(n)\})⇒O(g(n))\Rightarrow e(n)≤c⋅g(n);c>0$$ Combining the 2 cases yields: $$d(n)+e(n)≤c⋅f(n)+c⋅g(n)$$ $$d(n)+e(n)≤c⋅(f(n)+g(n))$$ Which is definition of $$O(f(n)+g(n))$$