The goal of integration by parts is to differentiate one of the terms in the product so that it becomes #1#, leaving only one term to be integrated. Take a look at this problem to understand better.
Let #u = x# and#dv = cos(3x)dx#. To apply the integration by parts formula, we need #v# and #du#. #du = dx#. We can find #v# through #u#-substitution.
Let #u_2 = 3x#. Then #du_2 = 3dx# and #dx = (du_2)/3#
We can rewrite:
#=int(cosu_2) * (du_2)/3#
#=1/3intcosu_2du_2#
#=1/3sinu_2#
Since #u_2 = 3x#:
#=1/3sin(3x)#
Thus, #v = 1/3sin(3x)#.
The integration by parts formula is #int(udv) = uv - int(vdu)#.
#int(xcos(3x)) dx= 1/3sin(3x) * x - int(1 * 1/3sin(3x)dx)#
#int(xcos3x)dx = 1/3xsin(3x) - int(1/3sin(3x)dx)#
We repeat the substitution process performed above to integrate #1/3sin(3x)#
Let #u = 3x#. Then #du = 3dx# and #dx = 1/3du#
#=int1/3sinu * 1/3du#
#=1/9intsinu du#
#=-1/9cosu#
#=-1/9cos(3x)#
The integral of the entire expression is therefore:
#int(xcos3x)dx = 1/3xsin3x+ 1/9cos3x+ C#, where#C# is a constant.
Hopefully this helps!