Integrate x dx/(1-x). I have proceeded thus-

Int xdx/(1-x)=int -(x-1+1)/(x-1)
=-Int[1+ 1/(x-1)]dx
=-Int dx-Int dx/(x-1)
=-x-log(x-1). On differentiating, we get original expression-
d/dx[-x-log(x-1)]=-1-1/(x-1)=-x/(x-1)=x/(1-x).
However, the answer in the book is
-x-log(1-x)and differentiating this also we get same expression-
d/dx[-x-log(1-x)]=-1+1/(1-x)=x/(1-x).
There are no constants of integration in this example and log(1-x)is not=log(x-1), then where is the anomaly?

You have to specify your domain.

For log(x-1) you need x>1

For log(1-x) you need x<1

May times you will find it written that

∫ dx/x = log |x| + C

just for this reason.

The anomaly in your solution arises from a sign error during integration. Let's go through the steps to see where the mistake occurred.

You correctly started with the integral:

∫ x dx / (1 - x)

Next, you attempted to decompose the fraction using partial fractions, which gives:

∫ -1 dx - ∫ 1 / (x - 1) dx

The first integral evaluates to:

-∫ 1 dx = -x + C1

For the second integral, you made a sign error. It should be:

-∫ 1 / (x - 1) dx = -ln |x - 1| + C2

Putting the two results together, you should have:

-∫ x dx / (1 - x) = -x - ln |x - 1| + C

So, the correct answer is -x - ln |x - 1| + C, not -x - log(x - 1). Differentiating -x - ln |x - 1| will indeed give you x / (1 - x), as you observed.

The discrepancy in your calculation arises from different choices for the antiderivative of dx/(x-1) during the integration step.

Let's go through the calculation step by step to identify the error.

Starting from the integral:
∫ x dx/(1-x)

You smartly split the rational function using partial fractions:
∫ x dx/(1-x) = ∫ (1 + 1/(x-1)) dx

Now, let's integrate the expression separately:

1) ∫ 1 dx
This is a straightforward integration, and the result is x.

2) ∫ 1/(x-1) dx
This integral requires a substitution. Let u = x - 1, then du = dx. The integral becomes:
∫ 1/u du = ln|u| + C = ln|x-1| + C

Combining the two integrals, we have:
∫ (1 + 1/(x-1)) dx = ∫ 1 dx + ∫ 1/(x-1) dx = x + ln|x-1| + C

Therefore, the correct antiderivative is x + ln|x-1| + C, not -x - log(1-x) as stated in the book.

To differentiate x + ln|x-1| + C, we can use the chain rule for the natural logarithm:
d/dx (ln|x-1|) = 1/(x-1) * d/dx (x-1) = 1/(x-1)

Differentiating the entire expression yields:
d/dx (x + ln|x-1| + C) = 1 + 1/(x-1) = (x-1+1)/(x-1) = x/(x-1) = x/(1-x)

Hence, the book's answer of -x - log(1-x) is incorrect, and the correct answer is x + ln|x-1| + C, which differentiates to x/(1-x) as expected.