Let \(h(x) = f(x)g(x)\), the derivative of this is:
\[ \frac{d}{dx} h(x) = \left( \frac{d}{dx}f(x) \right) g(x) + f(x)\frac{d}{dx}g(x) \]
We can rewrite this as:
\[ d \ h(x) = d \ f(x) * g(x) + f(x) * d \ g(x)\]
If we take the of integral of both sides:
\[ \int d \ h(x) = h(x) = \int g(x) \ d f(x) + \int f(x) \ d g(x) \]
Let \(g(x) =u\) and \(f(x)=v\):
\[\begin{align} uv = \int u \ d v + \int v \ d u \\ \int u \ d v = uv - \int v \ d u \end{align}\]