I had this on my test, I just couldn't get it, after solving it a lot. $$\int\left\{\frac{\log x-1}{1+(\log x)^2}\right\}^2\,dx=\,?$$
I have tried substituting $\log(x)=t$ and then $$ \int \frac{(t-1)^{2} e^{t} d t}{\left(t^{2}+1\right)^{2}}=\int\left\{\frac{\left(t^{2}+1\right)}{\left(t^{2}+1\right)^{2}}-\frac{2 t}{\left(t^{2}+1\right)^{2}}\right\} e^{t} d t $$ and then, applying the by parts rule, $$ =e^{t}\left(\tan ^{-1} t-\frac{1}{t^{2}+1}\right)-\int e^{t}\left(\tan ^{-1} t-\frac{1}{t^{2}+1}\right) d t $$ after that I can't get ahead.
P.S.- All Curly brackets used here are normal brackets, not the ones used in fractional part. Thanks to @ParclyTaxel for pointing it out.
Since $1+\log^2x$ is squared and appears in the denominator, we might try an antiderivative of something over $1+\log^2x$ because of the quotient rule: $$\frac d{dx}\frac f{1+\log^2x}=\frac{f'(1+\log^2x)-f((2/x)\log x)}{(1+\log^2x)^2}$$ The numerator contains only $\log$s, so $f$ must cancel the $\frac1x$ of $\frac2x\log x$. So $f$ might be $x$; we check and it works, and the answer is $$\frac x{1+\log^2x}+K$$