Integral Calculator

Type a function of x to integrate it and see how each step is chosen.

Use x. Type powers with ^, and functions with brackets: sin(x), e^(2x), ln(x), sqrt(x).

Try

Result

You entered∫1x2−1 dx\int \frac{1}{x^{2} - 1}\,dx

∫1x2−1 dx=ln⁡∣x−1∣2−ln⁡∣x+1∣2+C\displaystyle \int \frac{1}{x^{2} - 1}\,dx = \frac{\ln\left|x - 1\right|}{2} - \frac{\ln\left|x + 1\right|}{2} + C
Show the work
  1. Partial fractions

    The denominator is factored. Each linear factor gets a constant over it (one term for every power), and each irreducible quadratic factor gets a linear numerator over it.

    Using P(x)(x−a)(x−b)=Ax−a+Bx−b\frac{P(x)}{(x-a)(x-b)} = \frac{A}{x-a} + \frac{B}{x-b}

    x2−1=(x−1)(x+1)1x2−1=A(x−1)+B(x+1)\begin{gathered} x^{2} - 1 = \left(x - 1\right)\left(x + 1\right) \\ \frac{1}{x^{2} - 1} = \frac{A}{\left(x - 1\right)} + \frac{B}{\left(x + 1\right)} \end{gathered}
  2. Solve for the coefficients

    Multiply through by the denominator and compare coefficients of like powers of x (a linear system).

    A=12, B=−12A = \frac{1}{2},\ B = -\frac{1}{2}
  3. Integrate each term

    Each term has a basic antiderivative: a logarithm for a first power, a power for a higher power, and a logarithm plus an arctangent for a quadratic.

    Using ∫dxx−a=ln⁡∣x−a∣+C\int \frac{dx}{x-a} = \ln\left|x-a\right| + C

    ∫1x2−1 dx=∫12(x−1) dx+∫−12(x+1) dx\int \frac{1}{x^{2} - 1}\,dx = \int \frac{\frac{1}{2}}{\left(x - 1\right)}\,dx + \int \frac{-\frac{1}{2}}{\left(x + 1\right)}\,dx
  4. Result

    An antiderivative is only defined up to a constant, so the constant of integration CC is added.

    ∫1x2−1 dx=ln⁡∣x−1∣2−ln⁡∣x+1∣2+C\int \frac{1}{x^{2} - 1}\,dx = \frac{\ln\left|x - 1\right|}{2} - \frac{\ln\left|x + 1\right|}{2} + C

Worked examples