Message Boards Message Boards

1
|
16050 Views
|
9 Replies
|
6 Total Likes
View groups...
Share
Share this post:

Integrate[1/x, x] should give Log[Abs[x]] but does not ?

Posted 7 years ago

Hello everyone, I tried to use the following statement:

In[1]:= Integrate[1/x, x]

Out[1]= Log[x]

Why the Out is without the absolute value? My goal is to get Out=Log[Abs[x]].

Thank you very much for your help.

POSTED BY: Gennaro Arguzzi
9 Replies
Posted 7 years ago

The general real antiderivative, rarely taught in calculus courses, is

$$\int {1 \over x} \; dx = \cases{ \log x + C_1 & $x > 0$ \cr \log (-x) + C_2 & x < 0 \cr}\,,$$

where $C_1$ and $C_2$ are independent real constants. The independence is due to the disconnected domain over the reals. Over the complex plane, the domain is connected but there is a branch-cut discontinuity (along the negative real axis for Mathematica's Log[x]).

In practical work, in the way the antiderivative arises, one usually has at hand a specific domain that does not contain $0$. In such a case the independence of $C_1$ and $C_2$ does not arise and one may deal with the formula $\log |x| + C$ for the antiderivative since $|x| = x$, $C = C_1$ or $|x| = -x$, $C = C_2$ according as the domain is positive or negative respectively.

Likewise, such practical work may be dealt with using the complex logarithm (such as Log[x] in Mathematica), but the constant of integration will have to contain a term of $-i\,\pi$ if $x$ is negative so that the value of the antiderivative will be real. This is often inconvenient when using Mathematica in introductory calculus classes, in which students have not yet been introduced to complex functions.

POSTED BY: Updating Name

I don't understand what you mean here by the "independence" of C1 and C1. In fact, on the strictly positive reals, the value of the integral is the set of all functions of the form log(x) + C, and on the strictly negative reals, the value of the integral is the set of all functions of the form log(−x) + C. There's no error or harm I see in using the same symbol C in the expressions for the two sets.

POSTED BY: Murray Eisenberg

1. The second paragraph in U.N.'s post seems to make the same point as your point about using just $C$.

2. I guess something like this is meant about the independence:

Problem: Find a function $f \colon {\Bbb R}\backslash \{0\} \rightarrow {\Bbb R}$ such that $f'(x) = 1/x$, $f(-1) = 1$, and $f(1) = 2$.

Solution: $f(x) = \cases{\log(-x) + 1 & $x <0$ \cr \log(x) + 2 & $x>0$ \cr}$

This function is not of the form $\log |x| + C$. And the general problem with conditions $f(-1) = C_1$ and $f(1) = C_2$ has a solution space of dimension 2.

3. Another way to look at the dimension of the solution space is this: The general real antiderivative given by a particular solution $\log|x|$ plus any solution to $Df=0$ over the domain of $1/x$. The condition $Df=0$ implies only that $f$ is locally constant. If the domain consists of a certain number of disjoint open intervals, then the dimension of the solution space of $Df=0$ will be equal to the number of intervals. In the case of $1/x$, in which the domain consists of two intervals, the dimension is two, which may be parametrized by two independent parameters $C_1$, $C_2$.

More generally, for a rational function $p(x)/q(x)$, if $q$ has $n$ real roots (counted without multiplicities), then the space of its antiderivatives will have dimension $n+1$. However, its complex domain consists of a single connected component, and the solution space consequently can be parametrized by a single constant.

4. The domains in which locally constant functions play a role tend to be in higher mathematics, not in first-year calculus (or even in most second-year differential equation courses).

I think that's the point of the paragraph that begins "In practical work..." I referred to in point 1 above. In most problems in introductory calculus, the domain can be restricted to a single interval and a single constant $C$ parameterizes the solution space.

The problem in point 2 above, while completely elementary, has not appeared in any calculus book I've read or taught from, as far as I can recall. Clearly it is not considered an important point to explain in introductory calculus.

On the other hand, locally constant functions arise in some branches of engineering and other fields in which you have continuous inputs and discrete outputs. DSolve[] and NDSolve[] can handle locally constant functions with DiscreteVariables and WhenEvent in some situations. I don't think it can handle this case though.

POSTED BY: Michael Rogers

RealAbs[] is new in Mathematica 11.1, so it would to be in 10.2.

So, what you got as an answer is basically a reformatted input.

Since the recent introduction of RealAbs we have

In[11]:= D[Log[RealAbs[x]], x] // Simplify

Out[11]= 1/x

Is RealIntegrate coming soon?

POSTED BY: Gianluca Gorni

Hello @Gianluca Gorni , my software gives me a different output:

In[24]:= D[Log[RealAbs[x]], x] // Simplify

Out[24]= Derivative[1][RealAbs][x]/RealAbs[x]

Do you know why? I'm using Mathematica 10.2.

POSTED BY: Gennaro Arguzzi

Integrate returns a primitive (also called antiderivative or indefinite integral) valid in the complex plane, which means that the derivative will recover the integrand. The proposed result of Log[Abs[x]] is not correct for this purpose.

POSTED BY: Daniel Lichtblau

I'm not sure what you ask for is the correct result:

In[86]:= Integrate[1/x, {x, 1, z}]
Out[86]= ConditionalExpression[Log[z], Re[z] > 0 || z \[NotElement] Reals]

Remember that in general Mathematica treats symbols that you haven't otherwise specified as complex. So if you replace z with I, you will find I Pi/2 which is Log[I]. So in general the result of that integral for negative real z doesn't exist, but it does exist for arbitrary complex numbers, so you just can't take the Abs there.

This is where things start to get interesting: Exp[I Pi/2 + 2 k Pi] == I for all k, so actually you can't really say that Log is the inverse of Exp in the complex plane. This will get you into the amazing territory of Riemann surfaces, but I don't want to go any further. Maybe you can read this wikipedia article.

POSTED BY: Carlo Barbieri

Hello @Carlo Barbieri , is there a way to tell to Mathematica that x is real? If I do this, Mathematica'll give me Log[Abs[x]] (I hope).

POSTED BY: Gennaro Arguzzi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract