How does the sustraction works for big O notation?
I have to functions, lets say $f(x)=p(x)+O(\ln(r(x)))$ and $g(x)=q(x)+O(\ln(s(x)))$ and I want to consider $f(x)-g(x)$ there is a way to simplify $O(\ln(r(x)))-O(\ln(s(x)))$? What this even means?
Thanks.
Edit: The explicit case I am looking for is
\begin{eqnarray} f(x)&=&(n-(x-1)d)\log(n-(x-1)d)+O(\log(n-(x-1)d))\\ g(x)&=&x\log(x)+O(\log(x)) \\ h(x)&=&(n-1-(x-1)(d+1))\log(n-1-(x-1)(d+1))+O(\log(n-1-(x-1)(d+1))) \end{eqnarray}
This 3 expresions cames to apply some algebra and Stirling approximation to $\log\binom{n-(q-1)d}{q}$ and that's why I need to consider $f(x)-g(x)-h(x)$
Generally, if $f(x)$ and $g(x)$ are in the same big O class, you know their sum and difference are in the same class. The sum or difference may be in a smaller class. For example, if $f(x)=x^3, g(x)=x^3-x$ we have $f(x) \in O(x^3), g(x) \in O(x^3)$, which tells us that $f(x)-g(x) \in O(x^3)$ as well. In fact, $f(x)-g(x)=x \in O(x)$ but we need to find the cancellation to know that.