In equation $(1)$, $R$ is the dependent variable and $C$ is the independent variable, while $h$ and $\bar{C}$ are parameters. I want to use this equation to find an expression for $R$ in terms of $C$ when $C=\bar{C}$.
$$\frac{d\ln(R)}{d\ln(C)} = \frac{h \frac{\bar{C}}{C}}{1-h+h\frac{\bar{C}}{C}} \tag{1}$$
My question is whether I should do this by first substituting in $C=\bar{C}$ and then integrating with respect to $C$ (or $\ln(C)$), or first integrating and then substituting?
Trying it the first way, I get:
(Substituting $C=\bar{C}$ into $(1)$:) $$\frac{d\ln(R)}{d\ln(C)} = h \tag{2}$$
(Integrating:) $$\ln(R)=h\ln(C)+const \tag{3}$$
Trying the second way I get:
(Integrating $(1)$ w.r.t. $\ln(C)$:)
$$\ln(R)=\ln(C)-\ln((h-1)C-h\bar{C}) + const \tag{4}$$
(Substituting $C=\bar{C}$:)
$$\ln(R) = \ln(\bar{C}) - \ln(-\bar{C}) + const \tag{5}$$
Two very different outcomes! So, which order of operations is correct? Or have I just made a mistake somewhere?
Always do your substitutions after integrating/differentiating. This is basically the same type of question as the following question: $y=x^2$, what is $\frac {dy} {dx}$ when $x=3$? If you substitute and then differentiate, you get $y=9$ so $y'=0$. If you differentiate first, $y' = 2x = 6$. Clearly the latter order is correct; your question is just a more complicated example of the same.