To solve the integral \(\int \frac{x^3 - x - 2}{1 - x^2} \, dx\), we will follow these steps:
### Step 1: Polynomial Long Division
Since the degree of the numerator is greater than the degree of the denominator, we first perform polynomial long division.
1. Divide \(x^3\) by \(1\) (the leading term of the denominator):
- The result is \(x^3\).
2. Multiply \(1 - x^2\) by \(x\):
- \(x(1 - x^2) = x - x^3\).
3. Subtract this from the original numerator:
\[
(x^3 - x - 2) - (x - x^3) = -2.
\]
Thus, we can express the integral as:
\[
\int \left( x + \frac{-2}{1 - x^2} \right) \, dx.
\]
### Step 2: Rewrite the Integral
Now, we rewrite the integral:
\[
\int x \, dx + \int \frac{-2}{1 - x^2} \, dx.
\]
### Step 3: Integrate Each Term
1. The first integral:
\[
\int x \, dx = \frac{x^2}{2}.
\]
2. The second integral can be simplified using the identity \(1 - x^2 = (1 - x)(1 + x)\):
\[
\int \frac{-2}{1 - x^2} \, dx = -2 \int \frac{1}{1 - x^2} \, dx.
\]
This can be solved using partial fractions:
\[
\frac{-2}{1 - x^2} = \frac{-2}{(1 - x)(1 + x)} = \frac{A}{1 - x} + \frac{B}{1 + x}.
\]
### Step 4: Set Up Partial Fractions
To find \(A\) and \(B\):
\[
-2 = A(1 + x) + B(1 - x).
\]
Expanding this gives:
\[
-2 = A + Ax + B - Bx.
\]
Combining like terms:
\[
-2 = (A + B) + (A - B)x.
\]
Setting coefficients equal:
1. \(A + B = -2\)
2. \(A - B = 0\)
### Step 5: Solve for \(A\) and \(B\)
From \(A - B = 0\), we have \(A = B\). Substituting into \(A + B = -2\):
\[
2A = -2 \implies A = -1, \, B = -1.
\]
### Step 6: Rewrite the Integral
Now we can rewrite the integral:
\[
\int \frac{-2}{1 - x^2} \, dx = -2 \left( \int \frac{-1}{1 - x} \, dx + \int \frac{-1}{1 + x} \, dx \right).
\]
This becomes:
\[
2 \left( \ln |1 - x| + \ln |1 + x| \right).
\]
### Step 7: Combine the Results
Putting it all together:
\[
\int \frac{x^3 - x - 2}{1 - x^2} \, dx = \frac{x^2}{2} + 2 \ln |1 - x| + 2 \ln |1 + x| + C.
\]
### Final Answer
Thus, the final answer is:
\[
\frac{x^2}{2} + 2 \ln |1 - x| + 2 \ln |1 + x| + C.
\]
---