So I have a problem where I'm supposed to simplify the integral $$\oint_C(\mathbf{ r\cdot B)r \times dr},$$ where $\mathbf r=(x, y, z)$ and $\mathbf B$ is a constant vector, using index notation. I get it to $$\iint_S(dS_i\partial_m(r_pB_pr_m)-\partial_i(r_pB_pr_l)dS_l),$$ but I don't really understand how to handle the second part of it. The first one I'm able to simplify to $$3(\mathbf{r \cdot B})\mathbf {dS} + \mathbf {dS}(\mathbf r \cdot \nabla)(\mathbf{r \cdot B}),$$but from the second part I get $$[(\mathbf{r \cdot dS)\nabla(r \cdot B)}]_i + r_pB_p\partial_i(r_l)dS_l,$$ where I have no idea how to simplify the second expression.
I've come across this problem before in an excerecise where I was supposed to simplify $$\oint_C(\mathbf{A \times dr)},$$ but in the solution here they only gave the answer in the form $$\iint_S (\partial_jA_jdS_i-\partial_iA_jdS_j),$$ which doesn't really help much.
Any help would be much appreciated!
Thank you.