Integration by parts help Integration by parts 
$$x\tan^{-1}x~dx=\frac12\left(x^2+1\right)\tan^{-1}x-\frac12x+c$$
and 
$$x^2e^{-3x}dx =-\frac13e^{-3x}\left(x^2+\frac23x+\frac29\right)+c$$
I have
$$d(uv)=u~dv+v~du$$
Can anyone please help me?

First one:
Recall that $d(\arctan(x)) = \dfrac{dx}{1+x^2}$.
$$\int x \arctan(x) dx = \underbrace{\int \arctan(x) d\left(\dfrac{x^2}2 \right)}_{\displaystyle \int v du} = \overbrace{\dfrac{x^2 \arctan(x)}2}^{\displaystyle uv} - \underbrace{\int \dfrac{x^2}{2(1+x^2)}dx}_{\displaystyle \int u dv}$$
Now
$$\int \dfrac{x^2}{2(1+x^2)}dx = \int \dfrac{1+x^2-1}{2(1+x^2)}dx = \int \dfrac{dx}2 - \int \dfrac{dx}{2(1+x^2)} = \dfrac{x}2 - \dfrac{\arctan(x)}2$$
Hence, we get that
$$\int x \arctan(x) dx = \dfrac{x^2 \arctan(x)}2 - \dfrac{x}2 + \dfrac{\arctan(x)}2 + c = \dfrac{(1+x^2) \arctan(x)}2 - \dfrac{x}2 + c$$

Second one:
$$\int x^2 e^{-3x} dx = \underbrace{\int x^2 d \left(\dfrac{e^{-3x}}{-3}\right)}_{\displaystyle \int v du} = \overbrace{\dfrac{e^{-3x}}{-3} x^2}^{\displaystyle uv} - \underbrace{\int \dfrac{e^{-3x}}{-3} (2x) dx}_{\displaystyle \int u dv} = \dfrac{e^{-3x}}{-3} x^2 + \dfrac23 \int xe^{-3x} dx$$
Now let us do integration by parts again to evaluate $\displaystyle \int xe^{-3x} dx$.
$$\int xe^{-3x} dx = \underbrace{\int x d \left(\dfrac{e^{-3x}}{-3}\right)}_{\displaystyle \int v du} = \overbrace{x \dfrac{e^{-3x}}{-3}}^{\displaystyle uv} - \underbrace{\int \dfrac{e^{-3x}}{-3} dx}_{\displaystyle \int u dv} = -\dfrac{x e^{-3x}}3 - \dfrac{e^{-3x}}{27}$$
Putting this back, we get that
$$\int x^2 e^{-3x} dx = -\dfrac13 e^{-3x}x^2 - \dfrac29 e^{-3x}x - \dfrac2{27} e^{-3x} + c = - \dfrac{e^{-3x}}3 \left(x^2 + \dfrac{2x}3 + \dfrac2{27}\right) + c$$
