Calculus · real student question

Find the indefinite integral of ln(x) * arctan(x) with respect to x.

Question

Find

lnxtan1(x)dx.\int \ln x\,\tan^{-1}(x)\,dx.

Step-by-step solution

  1. Choose which factor to differentiate. Both lnx\ln x and tan1x\tan^{-1}x have simple derivatives but awkward antiderivatives. Taking u=lnxu=\ln x (so du=dxxdu=\frac{dx}{x}) and dv=tan1(x)dxdv=\tan^{-1}(x)\,dx works better, because the resulting 1x\frac{1}{x} will cancel against the xx inside vv — the choice that makes the leftover integral simpler rather than worse.

  2. Find v=tan1xdxv=\int\tan^{-1}x\,dx by a preliminary integration by parts. With a=tan1xa=\tan^{-1}x and db=dxdb=dx:

    tan1xdx=xtan1xx1+x2dx=xtan1x12ln(1+x2).\int\tan^{-1}x\,dx=x\tan^{-1}x-\int\frac{x}{1+x^{2}}dx=x\tan^{-1}x-\tfrac12\ln(1+x^{2}).

    The last integral is a uu-substitution with u=1+x2u=1+x^{2}, giving the 12\tfrac12.

  3. Apply the main integration by parts. With u=lnxu=\ln x and v=xtan1x12ln(1+x2)v=x\tan^{-1}x-\tfrac12\ln(1+x^{2}):

    lnxtan1xdx=lnx(xtan1x12ln(1+x2))(xtan1x12ln(1+x2))dxx.\int\ln x\,\tan^{-1}x\,dx=\ln x\left(x\tan^{-1}x-\tfrac12\ln(1+x^{2})\right)-\int\left(x\tan^{-1}x-\tfrac12\ln(1+x^{2})\right)\frac{dx}{x}.

    Dividing through by xx inside the integral gives

    lnxtan1xdx=xlnxtan1x12lnxln(1+x2)tan1xdx+12ln(1+x2)xdx.\int\ln x\,\tan^{-1}x\,dx=x\ln x\tan^{-1}x-\tfrac12\ln x\ln(1+x^{2})-\int\tan^{-1}x\,dx+\tfrac12\int\frac{\ln(1+x^{2})}{x}dx.

    This is exactly the cancellation predicted in step 1: xtan1x1xx\tan^{-1}x\cdot\frac1x collapses to tan1x\tan^{-1}x, an integral already computed.

  4. Recognise the remaining integral as a dilogarithm. The piece ln(1+x2)xdx\int\frac{\ln(1+x^{2})}{x}dx has no elementary antiderivative. Substituting t=x2t=-x^{2} and comparing with the definition Li2(z)=0zln(1w)wdw\operatorname{Li}_{2}(z)=-\int_{0}^{z}\frac{\ln(1-w)}{w}dw gives

    ln(1+x2)xdx=12Li2(x2)+C.\int\frac{\ln(1+x^{2})}{x}dx=-\tfrac12\operatorname{Li}_{2}(-x^{2})+C.

    A numeric check: differentiating 12Li2(x2)-\tfrac12\operatorname{Li}_{2}(-x^{2}) at x=0.6x=0.6 gives 0.51247450.5124745, and ln(1.36)0.6=0.5124745\frac{\ln(1.36)}{0.6}=0.5124745 ✓.

  5. Assemble the closed form. Substituting tan1xdx\int\tan^{-1}x\,dx from step 2 and the dilogarithm from step 4:

    lnxtan1xdx=xlnxtan1x12lnxln(1+x2)xtan1x+12ln(1+x2)14Li2(x2)+C.\int\ln x\,\tan^{-1}x\,dx=x\ln x\tan^{-1}x-\tfrac12\ln x\ln(1+x^{2})-x\tan^{-1}x+\tfrac12\ln(1+x^{2})-\tfrac14\operatorname{Li}_{2}(-x^{2})+C.

    So the answer exists in closed form, but only once the dilogarithm is admitted — no combination of elementary functions will do.

  6. Verify by differentiating numerically. Evaluating the derivative of the right-hand side with a central difference: at x=0.5x=0.5 it gives 0.32137603-0.32137603 against ln(0.5)tan1(0.5)=0.32137603\ln(0.5)\tan^{-1}(0.5)=-0.32137603 ✓; at x=0.7x=0.7, 0.21783065-0.21783065 against 0.21783065-0.21783065 ✓. Agreement to eight digits at two independent points confirms every coefficient.

Answer

lnxtan1xdx=xlnxtan1x12lnxln(1+x2)xtan1x+12ln(1+x2)14Li2(x2)+C\int\ln x\,\tan^{-1}x\,dx=x\ln x\tan^{-1}x-\tfrac12\ln x\ln(1+x^{2})-x\tan^{-1}x+\tfrac12\ln(1+x^{2})-\tfrac14\operatorname{Li}_{2}(-x^{2})+C

Need to solve a different problem like this? Open the solver →