Can you switch $g'$ and $f'$ in the integration by parts formula? I'm practicing calculus for the future and have a question about the integration by parts formula. 
I was taught: $\int f(x)g'(x) =f(x)g(x)-\int f'(x)g(x)dx $
But would switching $f'$ and $g'$ in the formula to this still work?
$\int f'(x)g(x) = f(x)g(x) - \int f(x)g'(x)dx$
If so is one way harder than the other?
In a problem like $\int x\cos(x)$ does it matter which values you pick for $f(x)$ and $g(x)$, or would both ways yield the correct answer?
 A: Your two expressions are equivalent as you've just switched terms around. In particular, you can get
$$\begin{equation}\begin{aligned}
& f(x)g'(x) = f(x)g(x) - f'(x)g(x) \\
& f'(x)g(x) + f(x)g'(x) = f(x)g(x) \\
& f'(x)g(x) = f(x)g(x) - f(x)g'(x)
\end{aligned}\end{equation}\tag{1}\label{eq1A}$$
However, note you haven't really switched the terms around directly.
For the second part of your question, i.e., whether or not it makes a difference which factor in $\int x\cos(x)$ you pick for $f(x)$ and which you pick for $g(x)$ because you integrate one & differentiate the other. In this case, you would want to differentiate $x$, as it becomes $1$ (so integrating $\cos(x)$ would give you $\sin(x)$, so the remaining integral is $\int \cos(x)dx$ which is fairly easy to integrate), rather than integrate it as it would become $\frac{x^2}{2}$ (as your result would be worse since you would then have an $x^2$ factor in your remaining integral). Regardless which one you choose, the result will be correct, and can potentially lead to the right answer. However, you may actually be making things more complicated for yourself instead of simpler, so you won't be able to necessarily simplify & finish if you use a different order.
A: Both will yield the same answer, but some integrals makes the math work out nicer. 
Changing what you choose as the "parts" is a common strategy to try when solving these.
