$\int \frac{\sin x}{x}dx=\sin x \log x$?

In your second integration by parts, you got the signs wrong (and you forgot a $dx$). It should be $$\int \cos x \log x dx = \log x \sin x - \int \frac{\sin x}{x} dx$$ If you plug this back into your first formula, you get: $$\int \frac{\sin x}{x} dx = \log x \sin x - \left( \log x \sin x - \int \frac{\sin x}{x} dx \right) = \int \frac{\sin x}{x} dx$$ which doesn't say much. Basically you did the same integration by parts twice, once in one direction then in reverse. You cannot compute anything like that.


Note that $$\int \cos x \log x=\log x \sin x - \int \frac{\sin x}x dx,$$ as integration of $\cos x$ is $\sin x$. So your answer was wrong.

Try a different method. From Maclurins series we have $$\sin x=\sum_{n=0}^{\infty}\frac{(-1)^n x^{2n+1}}{(2n+1)!}.$$ Thus $$\int\frac{\sin x}{x}=\sum_{n=0}^{\infty}\int\frac{(-1)^n x^{2n}}{(2n+1)!}=\sum_{n=0}^{\infty}\frac{(-1)^n x^{2n+1}}{(2n+1)(2n+1)!}+c.$$