I was playing around with Wolfram Alpha and I performed the following query:
integral of 1/(x-1) dx
The answer it returned was ln(x - 1) as you would expect.
I then tried to integrate the function multiplied by -1 expecting to get the original answer times -1 (as per integration rules for a function multiplied by a constant):
integral of -1/(x-1) dx
The answer it returned was -ln(1-x) instead of the expected -ln(x-1).
I did a quick, lazy check to see if our answers were the same with the following query:
-ln(1-x) / -ln(x-1)
However, they are not equivalent. They do have the same real value for x >= 1, though.
Am I doing something wrong? Have I simply forgotten some of my integral or log rules? Is this a limitation of the free version of WolframAlpha? Any help would be much appreciated!
tl;dr The results you're seeing are correct. You're seeing a branch cut
The logic you've used here is really common even among very smart engineers and proffesors, but not correct. They don't have to be equal.
Lets assume you have two expressions called "a" and "b". You know "a" and "b" are equal. Their indefinite integrals have to be equal too right? Integral a(x) d(x) has to be equal to Integral b(x) d(x)? No, they don't have to be equal. It is very common for them to be equal, but there are three major reasons why you will not see them being equal:
First, the values of the indefinite integrals can always differ by a constant. Sometimes you the constant difference won't be obvious in the resulting formula like it would be in most calculus examples of this.
Second, where you are using inverse functions such as Log, Sqrt, ArcSine, etc, there are branch cuts. These will cause the results to differ by a piecewise constant function. This is what is happening in your example. If you subtract the two results you get and Simplify under the assumption that their input is a real number, you get a piecewise constant function equal to PiI for x less than zero and equal to -PiI for x greater than zero
Lastly, integration is often done "generically", meaning we basically ignore the value at some isolated points. A good example of this is that we say the integral of x^n is x^(n+1)/(n+1). This isn't true for n=-1 in which case the integral is Log[x].
Thank you! My understanding of calculus is only at an undergrad engineering level. And that was 6 years ago. And I didn't do very well at the time! I'm just getting myself back to where I left off and hopefully farther. Thanks!
In:= Integrate[-1/(x - 1), x]
Out= -Log[1 - x]
In:= Integrate[1/(1 - x), x]
Out= -Log[1 - x]
I really wish I saw this myself. Very simple explanation. Thanks!