# How to extract a variable before differentation operator?

I am trying to make some derivations of open channel flow equations. And the problem is, I quite don't get some of the operations that are given in books on the following subject. For example:

$Q=Q(x)$

$A=A(x)$

$U(x)=Q/A$

$g=9.81$

$\frac{1}{gA} \frac{d}{dx}(\frac{Q^2}{A})=\frac{1}{g} \frac{Q}{A} \frac{d}{dx}(\frac{Q}{A})=\frac{d}{dx}(\frac{U^2}{2g})$

In the example above: If the Q and A are dependent on x, can I simply move Q out of the d/dx?? Just like that?

Regards

-

$$\frac d {dx} \left (\frac {Q^2} A\right) = \frac{2AQQ'-A'Q^2}{A^2}$$
$$Q \frac{d}{dx}\left(\frac Q A\right)=Q\frac{AQ'-A'Q}{A^2}$$ So the only way these two things are equal is if $QAQ'=0$. In that case, you could move the $Q$ out.
@Misery I'm not familiar with the Saint-Venant system of equations, but a brief look at them indicates there are many more conditions on them than just a general equation in terms of $x$. I would suggest leaving this question unanswered for a while longer, perhaps someone more acquainted with the specific problem could help you out. –  process91 Sep 14 '12 at 11:37