# 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

-

Not in general:

$$\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.

What book do you see this equation in?

-
Well, it is a classical stuff. It can be found in every open channel hydraulics book. This is a part of derivation from 1D Saint-Venant system of equations to steady gradually varied flow equation. And I get the same results when trying to 'think about' it. It is not proper derviation. But for almost two hundred years it was belived to fine... Therefore I asked here :] Ok, I get it, when no lateral inflow is there Q'[x] is 0. Thanks a lot!! You helped me very very much :] –  Misery Sep 14 '12 at 11:28
@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
Well, I am quite familiar with them. But what I am trying to do is to understand the derivation from non-conservative to conservative form. But I just cand understand it. No matter how I do derive it, I don't get the form that is in the books. So I thought, that maybe it is some similar thing like with this here. –  Misery Sep 14 '12 at 11:42