Calculus · real student question

Find the indefinite integral of 2/x - 1/x^2 with respect to x.

Question

Find

(2x1x2)dx\int\left(\frac{2}{x}-\frac{1}{x^2}\right)dx

Step-by-step solution

  1. Split the integral using linearity. Integration distributes over a difference, and constants come out front:

    (2x1x2)dx=2dxxdxx2\int\left(\frac{2}{x}-\frac{1}{x^2}\right)dx=2\int\frac{dx}{x}-\int\frac{dx}{x^2}

    The domain is x0x\neq0, and the antiderivative is valid separately on (,0)(-\infty,0) and (0,)(0,\infty).

  2. Handle the first term — the power rule exception. Writing 1x=x1\tfrac1x=x^{-1}, the usual formula xndx=xn+1n+1\int x^n dx=\tfrac{x^{n+1}}{n+1} would divide by n+1=0n+1=0. That is why n=1n=-1 is the single exception:

    dxx=lnx+C\int\frac{dx}{x}=\ln|x|+C

    The absolute value keeps it valid for negative xx too. So the first term contributes 2lnx2\ln|x|.

  3. Handle the second term with the ordinary power rule. Here 1x2=x2\tfrac{1}{x^2}=x^{-2} and n=2n=-2, so n+1=10n+1=-1\neq0 and the standard rule applies:

    x2dx=x11=1x\int x^{-2}dx=\frac{x^{-1}}{-1}=-\frac1x

  4. Apply the minus sign in front of the second integral. The integrand has 1x2-\tfrac{1}{x^2}, so

    x2dx=(1x)=+1x-\int x^{-2}dx=-\left(-\frac1x\right)=+\frac1x

    The double negative turning into a plus is the step most often lost.

  5. Combine into one antiderivative.

    (2x1x2)dx=2lnx+1x+C\int\left(\frac{2}{x}-\frac{1}{x^2}\right)dx=2\ln|x|+\frac1x+C

    Note how two superficially similar terms produce completely different function types — a logarithm and a rational term.

  6. Verify by differentiating. ddx[2lnx+1x]=2x1x2\dfrac{d}{dx}\left[2\ln|x|+\tfrac1x\right]=\dfrac{2}{x}-\dfrac{1}{x^2} ✓. Numerically, symmetric difference quotients at x=0.7, 2.3, 1.6x=0.7,\ 2.3,\ -1.6 match the integrand to five digits ✓, including a negative xx where the absolute value matters.

Answer

(2x1x2)dx=2lnx+1x+C\int\left(\frac{2}{x}-\frac{1}{x^2}\right)dx=2\ln|x|+\frac{1}{x}+C

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