Maximising a Ratio - Relationship of Marginal Numerator and Denominator I am trying to maximize a ratio with respect to $x$, where both numerator and denominator are dependent on variable $x.$  
The problem is a follows:
$$ S(x) = \frac {E - C(x)} {V - R(x)} $$
$$ C(x) = \frac {\frac{O w p}{x^2} + \frac{O w \gamma G k}{x}} {QA} $$
$$ R(x) = M - h x $$
Where my goal is to maximize $S(x).$ All the other variables are independent of $x.$
I have been thinking about the conditions that must be met, if the ratio is maximized. My current guess is that the maximum $S(x)$ is where following holds:
$$ \frac{E} {V} = \frac {C'(x)} {R'(x)} $$
Where $C'(x)$ and $R'(x)$ are the first derivatives respectively.
However, I am not entirely sure that this is the case and I can't prove this mathematically. Is this conditions right? How can I prove this?
Many thanks in advance.

The function $S(x)$ is maximized for $x\rightarrow 0,$ where $S(x)\rightarrow \infty$ (depending on the sign of the constants and from which side you approach), which can be seen by considering $C(x).$ 
Disregarding the singularity, the maximum occurs when 
$$S'(x)=0 \implies \frac{C'(x)}{R'(x)}=\frac{E-C(x)}{V-R(x)},$$
which can be shown using standard differentiation techniques (product and chain rule). Note that you have to check the limits $x\rightarrow \pm \infty$ (where $S(x)\rightarrow 0$) and that this equation has multiple solutions, all of which needs to be checked.
