TITLE: Derivative of a product and derivative of quotient of functions theorem: I don't understand its proof
QUESTION [5 upvotes]: I'm studying for math exam and one of the questions that often appears is related to derivative of a product of two functions.
The theorem says that $(f(x)g(x))'=f'(x)g(x)+f(x)g'(x)$.
The proof goes like this:
$f(x+h)g(x+h)-f(x)g(x)=(f(x+h)-f(x))g(x)+(g(x+h)-g(x))f(x)$
After that we divide the equation by h and let h approach 0.
Now what I don't understand is how they got the right side of the proof.
Same problem with quotient:
Theorem says:
$\left(\frac{f(x)} {g(x)}\right)'=\frac{f'(x)g(x)-f(x)g'(x)} {g^2(x)}$
The above comes from
$\frac {f(x+h)} {g(x+h)} - \frac {f(x)} {g(x)} = \frac{(f(x+h)-f(x))g(x)-(g(x+6h)-g(x))f(x)} {g(x+h)g(x)}$
I can see from where $f(x+h)g(x)$ comes, but I can't see from where $f(x)g(x)$ came.

REPLY [2 votes]: As per AndrejaKo's comment, I am posting my comment as an answer. Note that there are very interesting and useful answers to this question motivating the formula for the derivative of a product: my answer is simply a technical explanation of a typo in the argument provided in the question.
You should add and subtract the quantity $f(x)g(x+h)$ from the left hand side of your equation (and the equality you wrote is indeed incorrect). Once you collect terms appropriately, everything should be clear!