# Integration by parts problem

1. Jul 18, 2017

### Mr Davis 97

1. The problem statement, all variables and given/known data
$\displaystyle \int \frac{\log (x)}{x}~ dx$

2. Relevant equations

3. The attempt at a solution
I am a little confused about the first part. We know that the $\displaystyle \int \frac{1}{x}~ dx = \log |x|$. So how can we proceed with integration by parts if one of the logs has an absolute value and the other doesn't? Wouldn't we just end up with $\log |x| \log (x) - \int \frac{\log |x|}{x} ~ dx$?

2. Jul 18, 2017

### scottdave

The argument of log(x) must be greater than zero, for real results. Since log(x) is in the integral, then we must have x > 0, so log(x) and log|x| will be the same thing.

3. Jul 18, 2017

### andrewkirk

Unless you are operating in the context of complex numbers you can forget about the absolute value because $\log x$ is only defined for positive $x$.

So, restricting the domain to $\mathbb R_+$ your last formula becomes
$$\int\frac{\log x}xdx=(\log x)^2 - \int\frac{\log x}xdx$$
which you can then solve.

EDIT: Jinxed again!

4. Jul 18, 2017

### Mr Davis 97

That makes sense. What about in the case when we start out with something like $\displaystyle \int \frac{\sin x}{\cos x} \log (\cos x)$? Do we just assume that x is in the domain such that $\cos x$ is greater than 0?

5. Jul 18, 2017

### andrewkirk

Yes. But more care is needed in that case, because, unlike the previous example, the domain is not topologically connected, being a series of open sets of the form $\left(\frac{4k-1}2\pi,\frac{4k+1}2\pi\right)$ for $k\in\mathbb Z$.

Many of the uses to which one might put an indefinite integral would be invalidated if one were to use it for values of $x$ that are in different (separated) components of that domain.

So it would be safest to specify a particular component, eg restricting the solution to the interval $(-\pi/2,\pi/2)$.

6. Jul 18, 2017

### LCKurtz

@Mr Davis 97 I assume you are aware that, even though integration by parts works pretty easily, the more "obvious" method would be the substitution $u = \log x,~du = \frac 1 x dx$.

7. Jul 19, 2017

### Eclair_de_XII

Huh, in all my years of taking Calculus, it never occurred to me that $ln(x)$ and $log(x)$ share the same derivative...

8. Jul 19, 2017

### andrewkirk

I think you might be interpreting the references above to $\log x$ as being log base 10. They are not, they are references to the log base $e$ or natural logarithm. My impression is that the practice of interpreting $\log x$ to mean log base 10 and using ln for the natural log started to fade out when pocket calculators started to replace logarithm tables and slide rules so that there was no common reason to refer to a log base 10. Perhaps it is still used in engineering.

9. Jul 19, 2017

### Staff: Mentor

Both of my calculators (small Casio scientific and an aged HP 48G) and the Windows calculator I use a lot have separate log and ln buttons. The meaning of "log" depends on the surrounding context -- in post-calculus textbooks, "log" is often taken to mean $\log_e$ or $\ln$. In computer science texts, "log" usually means $\log_2$.

10. Jul 19, 2017

### scottdave

WolframAlpha assumes log(x) refers to natural log. You can type in ln or LN, if you want. It will change it to log, though.
I loved my HP 48G. The display on mine is going out. A few years ago I got an HP 50G. Not quite an upgrade, in my opinion, though.
The way I was taught in school was to put the subscript log2(x) where 2 is the base. But if nothing then base 10 was implied, then ln means log base e (natural log).

11. Jul 19, 2017

### scottdave

I have yet to see a calculator put LOG on a button to calculate the natural log. Sure, the days of using log tables are pretty much gone, but base 10 logarithms are still used, like in pH scale and dB, for example.
Any time you need to display a chart of graph spanning a large range of values (like the electromagnetic spectrum), often the logarithmic scale (base 10) is used to display the wide range.

12. Jul 19, 2017

### Staff: Mentor

Same here.

Ditto for this, as well.

13. Jul 19, 2017

### andrewkirk

I haven't had a calculator since my beloved HP 12C died a long while back. If I need to calculate some numbers I can't do in my head I typically use R, which is usually open on my computer, or Wolfram Alpha - both of which interpret 'log' to mean log base e.

I rarely use Excel but I just checked with that and found that it interprets log as log base 10.

So I suppose it all depends on what one is used to.

14. Jul 20, 2017

### LCKurtz

And, of course, as far as this thread is concerned, the only thing that matters is that the OP, who hasn't returned since we got on this track, understands that answer needs an appropriate fudge factor if we aren't talking about natural logarithms.