Suppose I have the following functions $f(x)$ and $g(x)$, such that:
$$ f(x) = \tilde{f}(x) + O(x^{-p}) $$ $$ g(x) = \tilde{g}(x) + O(x^{q}) $$
where $p,q \in \mathbb{Z}_{++}$ and f,g are positive functions. I want to find order of the following remainder term:
$$ R_{x} = \frac{\tilde{f}(x)}{\tilde{g}(x)} - \frac{f(x)}{g(x)} $$
So do to so, I write:
$$ R_{x} = \frac{\tilde{f}(x)}{\tilde{g}(x)} - \frac{\tilde{f}(x) + O(x^{-p})}{\tilde{g}(x) + O(x^{q})} = \frac{g(x)f(x)+O(x^{q})f(x)-g(x)f(x)+g(x)Q(x^{-p})}{\tilde{g}^{2}(x) + \tilde{g}^{2}(x)O(x^{q})}$$ $$ R_{x} = \frac{O(x^{q}) \tilde{f}(x) - \tilde{g}(x)O(x^{-p})}{[\tilde{g}(x) + O(x^{q})] \tilde{g}(x)} $$ $$ R_{x} = \frac{O(x^{q}) \frac{\tilde{f}}{\tilde{g}}(x) - O(x^{-p})}{[\tilde{g}(x) + O(x^{q})] \tilde{g}(x)} $$ $$ R_{x} = \frac{O(x^{q})}{\tilde{g}(x) + O(x^{q})} = \frac{O(x^{q})}{g(x)}$$
So we have: $$ R_{x} = O(x^{q})$$
Is this correct? If not, what am I doing wrong? How can I find this remainder term?
What about the order of the following:
$$ S_{x} = \frac{\tilde{f}(x) + O(x^{-p})}{\tilde{g}(x) + O(x^{q})}$$
How could I compute this?
If we follow: Order of error of a fraction
Would the answer then be simply:
$$ S_{x} = O(x^{-p}) $$
Or something else? Would it be possible to provide a step by step solution with some explanations?
Thanks!!