Solving $r'(x) = \frac{ p(x)-r(x)s'(x) }{ s(x) }$ Can we solve
$$r'(x) = \frac{ p(x)-r(x)s'(x) }{ s(x) }$$
with unknown $p(x)$, if we are allowed to pick any $s(x)$ that makes the differential equation easiest?
Or, if we need to know $p(x)$, and can pick any $s(x)$ that we like (for instance, one that makes solving easiest), how do we solve this?
In both cases, we are solving for $r'(x)$.
 A: In any case, this is an in-homogenous linear first-order ODE:
The associated homogeneous equation $$r'(x)=-\frac{s'(x)}{s(x)} r(x) $$ has the general solution $$r(x)=\frac{c}{s(x)}. $$
Using variation of parameters, we try the ansatz $r(x)=\frac{c(x)}{s(x)}$ in the original equation. This gives:
$$\frac{c'(x) s(x)-c(x)s'(x)}{s(x)^2}=\frac{p(x)-\frac{c(x)}{s(x)}s'(x)}{s(x)}, $$
which simplifies to 
$$c'(x)=p(x).$$
Thus the general solution to your problem is
$$r(x)=\frac{c+\int_{x_0}^x p(t) \mathrm{d}t}{s(x)}. $$
A: The given equation
$r'(x) = \dfrac{ p(x)-r(x)s'(x) }{ s(x) } \tag{1}$
may, as was done by user1337 in her/his answer, be solved by standard procedures available for first order, non-homogeneous, linear ordinary differential equations, viz., as user11237 has shown us, variation of parameters; it may also be addressed, perhaps equivalenty, in a more or less standard manner by noting that the homogeneous equation
$r'(x) = -\dfrac{s'(x)}{s(x)} r(x) \tag{2}$
may be written
$r'(x) = -(\ln s(x))' r(x) \tag{3}$
for $s(x) \ne 0$, which as is well known has the general solution
$r(x) = r(x_0)e^{-\int_{x_0}^x (\ln s(u))'du}$
$= r(x_0)e^{-((\ln s(x) - \ln s(x_0))} = r(x_0)e^{\ln s(x_0)}e^{-\ln s(x)} = \dfrac{r(x_0)s(x_0)}{s(x)} \tag{4}$
which may be checked by direct differentiation:
$r'(x) = r(x_0)s(x_0)((s(x))^{-1})' = -r(x_0)s(x_0)(s(x))^{-2}s'(x)$
$= -\dfrac{s'(x)}{s(x)}\dfrac{r(x_0)s(x_0)}{s(x)} = -\dfrac{s'(x)}{s(x)}r(x) = -(\ln(s(x))'r(x). \tag{5}$
From (4) we see that the solution to (1), which may be written
$r'(x) = -\dfrac{s'(x) }{ s(x) }r(x) + \dfrac{p(x)}{s(x)} = -(\ln s(x))'r(x) + \dfrac{p(x)}{s(x)}, \tag{6}$
is in fact
$r(x) = e^{-\int_{x_0}^x (\ln s(u))'du}(r(x_0) + \int_{x_0}^x e^{\int_{x_0}^u  \ln(s(v))'dv}(\dfrac{p(u)}{s(u)}) du), \tag{7}$
which may also be validated by direct differentiation; I leave this as an exercise for the readership.  It is instructive, however, to examine the integral $\int_{x_0}^x e^{\int_{x_0}^u  \ln(s(v))'dv}(\dfrac{p(u)}{s(u)}) du$ in more detail; we see that
$e^{\int_{x_0}^u  \ln(s(v))'dv} = e^{(\ln s(u) - \ln s(x_0))} = \dfrac{s(u)}{s(x_0)}, \tag{8}$
and inserting this into $\int_{x_0}^x e^{\int_{x_0}^u  \ln(s(v))'dv}(\dfrac{p(u)}{s(u)}) du$ we find
$\int_{x_0}^x e^{\int_{x_0}^u  \ln(s(v))'dv}(\dfrac{p(u)}{s(u)}) du = \int_{x_0}^x \dfrac{s(u)}{s(x_0)}\dfrac{p(u)}{s(u)} du = \dfrac{1}{s(x_0)}\int_{x_0}^x p(u), \tag{9} $
and using (9) in (7):
$r(x) = e^{-\int_{x_0}^x (\ln s(u))'du}(r(x_0) + \dfrac{1}{s(x_0)}\int_{x_0}^x p(u)), \tag{10}$
and since, by a calculation of what is effectively the reciprocal of (8),
$e^{-\int_{x_0}^x (\ln s(u))'du} = \dfrac{s(x_0)}{s(x)}, \tag{11}$
we see that (10) becomes
$r(x) =  \dfrac{s(x_0)}{s(x)}(r(x_0) + \dfrac{1}{s(x_0)}\int_{x_0}^x p(u)du) = \dfrac{s(x_0)r(x_0) + \int_{x_0}^x p(u)du}{s(x)}, \tag{12}$
a solution which both agrees with, and is more specific than that posted by user1337, thought it is clear that, taking $x = x_0$, his constant $c = s(x_0)r(x_0)$.  Basically, what we have here is that $s(x_0)/s(x)$ is the fundamental solution matrix of the $1$-dimensional system (1).
The above presents the standard techniques for solving (1); but there is yet a third approach, which is specific to the peculiar features of the given equation.  That is to note that (1) implies
$s(x)r'(x) = p(x) - r(x)s'(x) \tag{13}$
or
$s(x)r'(x) + s'(x)r(x) = p(x); \tag{14}$
we then observe that since
$(s(x)r(x))' = s(x)r'(x) + s'(x)r(x), \tag{15}$
we may write (14) as
$(s(x)r(x))' = p(x) \tag{16}$
which may be immediately integrated:
$s(x)r(x) - s(x_0)r(x_0) = \int_{x_0}^x (s(u)r(u))'du = \int_{x_0}^x p(u)du, \tag{17}$
or, once again
$r(x) = \dfrac{s(x_0)r(x_0) + \int_{x_0}^x p(u)du}{s(x)}. \tag{18}$
Having obtained the form of the solution by several means, I close by addressing the OP's concerns about the choices of $p(x)$ and $s(x)$.  Evidently $s(x)$ may be taken to be any differentiable function without introducing too much extra work save computing it's derivative; so, I would say taking $s(x)$ $C^1$ but otherwise arbitrary is probably OK.  Since $\int p((u)du$ is needed for the solution, a little more care must be taken in picking $p(x)$.  If a closed-form, analytic solution is needed, then $p(x)$ must be chosen so that such may be had, whether by hand or by the hand of Wolfram Alpha.  But otherwise, I think, $p(x)$ need only be integrable for the solution to make sense.
In the light of this small controversy I close, as have so often done in the past, but perhaps not very often in the future, with the $58$ characters:
Hope this helps.  Cheers,
and as always,
Fiat Lux!!!
A: Shortcut: the differential equation is equivalent to 
$$
r'(x)s(x)+r(x)s'(x)=p(x).
$$
Now the LHS is the derivative of $(rs)$ hence the solutions $r$ are such that
$$
r(x)s(x)=P(x),
$$ 
where $P$ is any primitive of $p$. That is, there exists $c$ and $x_0$ such that, for every $x$,
$$
r(x)=\frac1{s(x)}\left(c+\int_{x_0}^xp(t)\,\mathrm dt\right).
$$
