96

I've learned in my analysis class, that

$$ \int \frac{1}{x} \mathrm dx = \ln(x). $$

I can live with that, and it's what I use when solving equations like that. But how can I solve this, without knowing that beforehand.

Assuming the standard rule for integration is

$$ \int x^a \, \mathrm dx = \frac{1}{a+1} \cdot x^{a+1} + C .$$

If I use that and apply this to $\int \frac{1}{x} \,\mathrm dx$:

$$ \begin{align*} \int \frac{1}{x}\mathrm dx &= \int x^{-1} \,\mathrm dx \\ &= \frac{1}{-1+1} \cdot x^{-1+1} \\ &= \frac{x^0}{0} \end{align*} $$

Obviously, this doesn't work, as I get a division by $0$. I don't really see, how I can end up with $\ln(x)$. There seems to be something very fundamental that I'm missing.

I study computer sciences, so, we usually omit things like in-depth math theory like that. We just learned that $\int \frac{1}{x} dx = \ln(x)$ and that's what we use.

polemon
  • 1,041
  • 23
    You forgot to add C – user93089 Sep 19 '13 at 07:27
  • 34
    @Piman even if I add $C$, I still have a division by $0$. – polemon Sep 19 '13 at 07:28
  • 3
    yeah I know but still, its indefinite integration. I'm talking about the first equation btw – user93089 Sep 19 '13 at 07:30
  • This was asked on the site before, and provoked some rather odd exchanges. – Did Sep 19 '13 at 07:59
  • 2
    Found it. Not 100% sure this is exactly what you have in mind though, so please just say if it is or not. – Did Sep 19 '13 at 08:03
  • 6
    $\ln|x| + C$.... – MattyZ Sep 19 '13 at 09:02
  • you get the expression $ x^{0}$ by direct integration howver if you 'regularize ' this divergence by substraction of the term $ 1/0 $ you get $ \frac{x^{0}-1}{0}=ln(x)$ by expanding the expression by a taylor series – Jose Garcia Sep 19 '13 at 10:27
  • 3
    @Bitrex $\log |x| + C(x)$ where $C(x)$ is locally constant on $\mathbb R \setminus {0}$. – kahen Sep 19 '13 at 10:33
  • but knowing that the derivative of ln x is 1/x is not enough? – Ant Sep 19 '13 at 14:07
  • 1
    I wrote this blog post about it a while ago. http://arcsecond.wordpress.com/2011/12/17/why-is-the-integral-of-1x-equal-to-the-natural-logarithm-of-x/ My blog says people followed a link from here to there, but I can't find that link on this page, so here it is. It takes a picture-based approach to the problem. – Mark Eichenlaub Sep 19 '13 at 16:41
  • 1
    Hi - You ask some pretty neat questions that produce some pretty neat answers. May I suggest that you accept an answer to your questions (by clicking on the adjacent check mark) if you feel your question was answered. Kind of a nice way to express appreciation. Regards, –  Sep 20 '13 at 15:45
  • L'H$\hat{\rm o}$pital . – Felix Marin Sep 25 '13 at 04:33
  • You can use the inverse function theorem. – UserX Aug 24 '14 at 16:41
  • Related: https://math.stackexchange.com/questions/2118082/why-isnt-int-frac1xdx-fracx00/2118089#2118089 – Simply Beautiful Art May 29 '17 at 14:13

11 Answers11

115

If you want to try to prove $\int\frac{\mathrm dx}x=\ln x + C $ (for $x \gt 0$), try the substitution

$$ \begin{align} x &= e^u \\ \mathrm dx &= e^u \mathrm du \end{align} $$

This substitution is justified because the exponential function is bijective from $\mathbb{R}$ to $(0,\infty)$ (hence for every $x$ there exists a $u$) and continuously differentiable (which allows an integration by substitution).

$$\int\frac{\mathrm dx}x=\int\frac{e^u\mathrm du}{e^u}=u+C$$

Now just use the fact that natural log is the inverse of the exponential function. If $x=e^u,u=\ln x$.

Ali Caglayan
  • 5,726
Mike
  • 13,318
88

Let's use your result : $$\int x^a \, dx = \frac{x^{a+1}}{a+1} + C=\frac{x^{a+1}-1}{a+1} +C'$$ and take the limit as $\,a\to -1\,$ (since $\;x^{a+1}=e^{(a+1)\ln(x)}$) : $$\lim_{a\to\,-1}\int x^a \, dx = C'+\lim_{a\to\,-1}\frac{e^{(a+1)\ln(x)}-1}{a+1}=C'+\ln(x)$$ Hoping this will help your intuition,

Raymond Manzoni
  • 43,021
  • 5
  • 86
  • 140
  • 12
    adding the step $\cdots\ = C'+\lim_{a\to 0}\frac{e^{\mathrm{ln}(x)\cdot a}-e^0}{a}=C'+\frac{\partial}{\partial a}e^{\mathrm{ln}(x)\cdot a}|_{a=0}=\cdots$ helps understanding why $\mathrm{ln}(x)$ comes down there at the end. – Nikolaj-K Sep 19 '13 at 08:36
  • Thanks for this addition @NickKidman. – Raymond Manzoni Sep 19 '13 at 08:45
  • 9
    I think that this is the best answer. Indeed, Raymond did not use derivative to prove that the integral is equal to $\ln(x)$ (that is, prove that the integral of $f$ is $F$ knowing that $\frac{dF}{dx} = f$ or similar approaches). Rather, he proved that the class of functions $\frac{x^{a+1}}{a+1}$ converges to $\ln(x)$ when $a$ approaches $-1$. Really nice point! – the_candyman Sep 19 '13 at 10:11
  • 3
    This is the way I like to approach this, since students often have the same thoughts as polemon. (+1) I used a rewrite of the limit $\lim\limits_{n\to\infty}\left(1+\frac xn\right)^n=e^x$ to get a similar result. However, I worry that it is too close to yours. – robjohn Sep 19 '13 at 10:43
  • hum.... This might be way off base, but isn't the next question, "Why should the limit of a function agree with the value at that limit?" (or in this case, we are parameterizing a class of functions with $a$, rather than a single function.) – Squirtle Sep 19 '13 at 14:01
  • 3
    @Squirtle: The convergence of these functions is uniform on compact sets, and so the limit of their integrals is the integral of their limits. – robjohn Sep 19 '13 at 15:03
  • @the_candyman Isn't the derivative of the exponential function used here, as mentioned in Nick Kidman's comment? – treble Sep 19 '13 at 17:36
  • @treble That passage is not mandatory. Indeed, $\lim_{a->0}\frac{x^a - 1}{a} = log(x) ~ \forall x > 0$ (source http://en.wikipedia.org/wiki/List_of_limits#Notable_special_limits) – the_candyman Sep 20 '13 at 08:33
  • Nice one, I would never have thought to do this... – bjd2385 Aug 21 '14 at 23:49
  • Thanks @BrandonDoyle. The (not very original...) idea here was that $\dfrac{x^{a+1}}{a+1}$ became singular for $a=-1$ so : let's change the constant to remove the singularity. Excellent mathematical explorations! – Raymond Manzoni Aug 22 '14 at 08:42
52

Logarithms are all about solving exponential equations right? For example, logarithms are useful if you want to solve $2^x=3$. Maybe you are really confused about how in the world finding the area under $y=\frac{1}{x}$ has anything to do with solving such equations. Hopefully this post will illuminate that - but it may be a bit long winded.

Say you wanted to solve $2^x=3$ and you are a 16th century mathematician. So, no calculator. You could just use bisection method, getting closer and closer approximations, but this involves the very laborious process of computing roots, and you wouldn't want to have to do this every time you have an exponential equation to solve. So here is the genius idea. You will pay someone to calculate $1.0001^n$ for you for $n=1$ to $1000000$. You can teach them the mechanical skill of multiplying these numbers in a week because you only have to shift and add (see what I mean by computing the first few!). Then you look in your table to find that $1.0001^{6931} \approx 2$ and $1.0001^{10986} \approx 3$.

This helps you because now $2^n = 3$ can be rewritten as $1.0001^{6931n} = 1.0001^{10986}$, so $n = 10986/6931 \approx 1.585$. Just to double check ourselves, $2^{1.585} \approx 3.00007798$, so it pretty much worked.

This same table allows you to approximate the solutions to a huge number of exponential equations, in exactly the same manner. The upfront investment of labor is worth the time, because now you and your buddies can all solve these equations just by table lookups.

Later on, you want more precision, so you pay a whole group of laborers to calculate the powers of $1.000001$. You notice that in the old table for $1.0001$, the entry for $1.0001^{10000} = 2.71814593$, and the entry for $1.000001^{1000000} = 2.71828047$. Seems like a pretty special number to be coming up in these exponential tables, so you call it $e$ for exponential.

You have done all you can with exponential equations for the time being, so you turn your attention to other matters. First you notice the curious fact that the number of faces plus the number of vertexes minus the number of edges of any polyhedron seems to always be 2. You struggle to find a proof of this, but are tormented to no end. Later you turn to predicting the motion of the planets. Some time later your patron wants you to design some kind of war machine. Finally, many years after your experiments with exponential equations, you turn your attention to the problem of finding areas bounded by hyperbolas. You know that there are classical solutions to the area under a parabola, but as far as you know, no one has tackled the area under $y = \frac{1}{x}$ from $x=1$ to $x=2$, for instance.

You set about attempting to calculate this area. Your first thought is just to carve the region up into a great number of rectangles, all of equal base. You choose cut up the interval $[1,2]$ at the points $1.0001, 1.0002, 1.0003, 1.0004, 1.0005 ,... 1.9999$ and sum the areas of all the rectangles you get. You find that the answer is about $.693122$. Gifted as you are with the supernatural recall of a 16th century mathematician, you remember that all those years ago, $1.0001^{6931} \approx 2$. What a great mystery! What could be at the bottom of this coincidence?

First of all, in your old tables you were repeatedly multiplying 1.001, which is not exactly how you cut up [1,2] in your area calculation. However, there is nothing wrong with cutting up the interval [1,2] at the points $1.001, 1.001^2, 1.001^3, 1.001^4,$ etc. These numbers are all still close to each other, so computing the area of the corresponding rectangles will give a good approximation to the area under your curve, and these rectangles at least have a chance at relating the two problems.

So what are the areas of these rectangles? The area of the first rectangle is $1 \cdot (1.001-1) = .001$. The area of the second rectangle is $\frac{1}{1.001} \cdot (1.001^2-1.001) = .001$. The area of the third rectangle is $\frac{1}{1.001^2} \cdot (1.001^3-1.001^2) = .001$! Hey! These are all the same area! So the total area under the curve is just going to be $A = .001n$, where n is the solution to $1.001^n=2$. This is only an approximation though. We would get a better approximation if we used our table for 1.000001. It would be handy to write our result in a way which was agnostic about which table we were using. Oh ya, that number e always appeared in our table. So, we could say

$1.001^n = 2 \implies (1.001^{1000})^{0.001n} = 2 \implies e^A = 2$

Wow! Carrying out the same reasoning for any other $t$, we find that the area $A_t$ from $x=1$ to $x=t$ under $\frac{1}{x}$ should satisfy $e^{A_t} = t$. In other words this area function is giving an inverse to the exponential function with base e.


Hopefully this little story helps you understand what finding $\displaystyle\int_1^t \frac{1}{x} dx$ has to do with solving exponential equations, and also why the number $e$ comes into the picture naturally. To summarize, you cut up the interval [1,t] at the points $1, 1.001^2, 1.001^3, ..., 1.001^n$, where $n$ is the largest power of $1.001$ which is still less than $t$. To get from one rectangle to the next, the width gets multiplied by 1.001 and the height gets divided by 1.001, so the areas of all of these rectangles are the same. Thus the area under the rectangle $A$ is just $.001n$. But then $(1.001^{1000})^{.001n} \approx t$, and so $e^{.001n} \approx t$, which means $e^{A} \approx t$. This approximation gets better and better if you choose $1.000001$, or $1.00000000001$. So we actually have the equality $e^A =t$. Using the definition of natural logarithm as inverse of exponential function, we have $A = \ln(t)$.

I would recommend playing with this by writing a computer program to solve $a^n=b$ using the method we discussed (limit yourself to only addition, multiplication, and for loops). If you do not know how to program, just making a spreadsheet would be pretty informative: you can have your computer take the place of your laborer. Draw pictures of the area under the curve, partitioned in the way we have discussed, and see how that ties in. There is a lot to digest here.

Anant
  • 520
27

The rule doesn't work when $a = -1$. There is a nice way you can get at the derivative of an inverse function if you know the derivative of the function, by way of something called implicit differentiation. Thus if you are willing to grant that $\frac{d}{dx} e^x = e^x$, then I can show that $\frac{d}{dx} \ln x = 1/x$, which is the result that you want. Write $y = \ln x$, then $e^y = x$ so that by the chain rule, $$\frac{d}{dx} e^y = e^y\frac{dy}{dx}$$ thus $$1 = e^y \frac{dy}{dx}$$ thus $$1 = x \frac{dy}{dx}$$ thus $$\frac{dy}{dx} = 1/x$$ which by definition is equivalent to the equation $$ \int \frac{1}{x} dx = \ln x +c $$

treble
  • 4,094
  • 18
  • 21
  • Hmm... Kinda hard for me to wrap my mind around this. I kinda see what you're doing, although pretty much the only thing I gather, is that the standard formula simply doesn't work if $a = -1$. – polemon Sep 19 '13 at 07:52
  • @polemon This answer is essentially the same as Mike's and Vishal's answers. It's just presented differently. (You should be able to detect this. I personally prefer Mike's answer for its shortness though.) – Tunococ Sep 19 '13 at 11:21
20

There are several approaches. One is based on the limit $$ \lim_{n\to\infty}n\left(x^{1/n}-1\right)=\log(x)\tag{1} $$ By adjusting the constant of integration, we have $$ \int x^n\,\mathrm{d}x=\frac1{n+1}\left(x^{n+1}-1\right)+C\tag{2} $$ Taking the limit of $(2)$ as $n\to-1$ and using $(1)$ yields $$ \int x^{-1}\,\mathrm{d}x=\log(x)+C\tag{3} $$ $(1)$ is essentially a rewrite of the standard limit $$ \lim_{n\to\infty}\left(1+\frac xn\right)^n=e^x\tag{4} $$

robjohn
  • 345,667
  • 4
    I had this sitting on my computer from before Raymond's answer, but I fell asleep. Now that I read back, I see this is similar to his. – robjohn Sep 19 '13 at 10:34
  • 1
    Excellent summary of the properties of $\ln$ and $\exp$ : $(+1)$ of course ! Thanks too for your comments and clarifications about my answer. Cheers, – Raymond Manzoni Sep 19 '13 at 22:08
  • Are you allowed to switch limit and integral?What is the justification – Vivaan Daga Jun 26 '20 at 10:23
  • As I commented to Squirtle on Raymond Manzoni's answer: The convergence of these functions is uniform on compact sets, and so the limit of their integrals is the integral of their limits. – robjohn Jun 26 '20 at 11:21
  • What if you go the other way and differentiate the limit can you switch limit and the derivative like: https://math.stackexchange.com/questions/3735158/can-you-justify-interchange-of-limit-and-derivative-integral-in-this-example – Vivaan Daga Jun 26 '20 at 12:57
13

Actually your first equation should read

$$ \ln(x) = \int_{1}^{x}\frac{1}{t} dt$$

Now we show this.

Here is an approach that starts from the basics.

Define the exponential map by the power series in the usual way. Then $\exp: \mathbb{R} \to \mathbb{R}_{+}$ is an increasing bijective map. Thus, it has an increasing inverse function

$$ \ln: \mathbb{R}_{+} \to \mathbb{R} $$

We know that $\exp$ is a differentiable function such that

$$ \exp^{\prime}(x) = \exp(x) \qquad \forall \; x \in \mathbb{R}$$

Now we use the followgin theorem:

Theorem: Let $U \subset \mathbb{R}$ and suppose $f : U \to \mathbb{R}$ is an injective function, differentiable at some $a \in U$. In addition, suppose that $f^{-1}: f(U) \to U$ is continuous at $b = f(a)$. Then $f^{-1}$ is differentiable at $b$ if and only if $f^{\prime}(a) \neq 0$ and in that case,

$$ (f^{-1})^{\prime}(b) = \frac{1}{f^{\prime}(a)}$$

So we get that $\ln(x)$ is differentiable for all $y \in \mathbb{R}_{+}$ (since $\exp(x) \neq 0$) and (assuming $ y = \exp(x)$)

$$ \ln^{\prime}(y) = \frac{1}{\exp(x)} = \frac{1}{y}$$

Now use Fundamental Theorem of Calculus to get the first equation.

Vishal Gupta
  • 6,946
  • Hmm, isn't it then much simpler after your first integration formula then $ \ln(1+x) = \int_1^{1+x} \frac 1t dt = \int_0^{x} \frac 1{1+t} dt $ and then termwise integration gives $ \int_0^x (1-t+t^2-t^3+...-...) dt = (\frac x1 -\frac 01) - (\frac {x^2}{2}-\frac 02) + ... = \frac x1 - \frac {x^2}{2} + ... = \log(1+x) $ ? – Gottfried Helms Sep 19 '13 at 23:00
  • @GottfriedHelms All these things need some advanced stuff. What I wrote is the most elementary way I know to do prove the first formula. – Vishal Gupta Sep 21 '13 at 15:06
4

Along with the other fine responses, I would also like to point out you could reason this through limits.

The regular formula for integral of $x^n$ actually still works, only that it adds a huge constant to it as $n$ goes towards $-1$. That's because $\frac{x^{n+1}}{n+1}$ can be well approximated as $\ln x+\frac{1}{1-n}$ as $n$ goes to $-1$.

$$\begin{array}{rcl} \lim_{\alpha \to 1}\int x^{-\alpha}dx &=& \lim_{\alpha \to 1} \frac{x^{1-\alpha}}{1-\alpha}+C \\ &=& \lim_{\alpha \to 1} \frac{x^{1-\alpha}-1}{1-\alpha}+C+\frac{1}{1-\alpha} \\ &=&\lim_{\beta \to 0} \frac{x^{\beta}-1}{\beta}+C+\frac{1}{1-\alpha}\\ &=&\ln x+\left(C+\frac{1}{1-\alpha}\right)\\ \end{array}$$

KalEl
  • 3,297
3

To show $\int\frac{dx}{x}=\ln{x}+C$ for positive $x$, we can show that the derivative of $\ln{x}$ is $\frac{1}{x}$. This can be done using the standard limit $$\lim_{x\to0}\frac{\ln(1+x)}{x}=1$$ and the definition of the derivative. We have $$ \frac{d}{dx}\left(\ln{x}\right)= \lim_{h\to0}\frac{\ln(x+h)-\ln{x}}{h}= \lim_{h\to0}\frac{1}{h}\ln\left(1+\frac{h}{x}\right)=\left[t= \frac{1}{x}\right]= \lim_{t\to0}\frac{1}{x}\cdot\frac{\ln(1+t)}{t}= \frac{1}{x}, $$ which is what we wanted to show.

Mårten W
  • 3,480
2

I did sign up just to say some answers here are misleading.

$$\int \frac{1}{x} dx = \ln(x). $$

is not a calculation but a definition. This is how ln(x) is defined. ln(x) is defined before exp(x)

http://en.wikipedia.org/wiki/Natural_logarithm#Definitions

  • 11
    This is one way of defining $\ln$, but not the only one. – mdp Sep 19 '13 at 12:19
  • this is the most common definition. otherwise you need to determine what is your definition from ln then we can talk about calculation. – faravish Sep 19 '13 at 12:37
  • 3
    I think your first sentence needs a citation - I'm not sure I've ever seen $\ln$ defined like this, but I'm not an analyst, so that doesn't mean it isn't common. While you are right that the answer depends on the definition of $\ln$, I think it's unfair to describe the other answers as misleading for starting from a different definition to yours. – mdp Sep 19 '13 at 12:42
  • for the sake of using word all you are right and i modified my words. for using word the most common definition I have no citation but in most of resources such as wolfram this is the first definition. defining based on log.e is usually for people who don't know what integrate is. the problem is that real power is not defined yet while logarithm is defined based on that. – faravish Sep 19 '13 at 12:50
  • 1
    I guess it's not that important (and I don't mean to sound like I'm being argumentative about this) - but it's not the first definition on Wolfram. The first definition is that it's log base e, and logarithms are defined (on Wolfram) as inverses to exponentiation. This does seem a more reasonable interpretation of the original question. I'm not trying to be critical though - your answer certainly adds something useful. – mdp Sep 19 '13 at 13:00
  • 1
    @MattPressland thanks for your attention. but all the problem is here. we use e without defining them, what is e? even e is defined based on ln (1) still definition of wolfram is not complete because power is not defined yet. defining power as exp(n)=e^n= ee... n times is not useful for real numbers since e^pi has no meaning. In universities first ln is defined. then exp then e then power. otherwise you will face a loop in definitions. – faravish Sep 19 '13 at 13:11
  • I would not find it surprising if Wolfram had a loop in the definitions, but I maintain that there are other ways of defining these things to the way you describe, that also don't contain loops. For example you can define both powers to any real number, and $e$, in terms of limits only involving rational powers. – mdp Sep 19 '13 at 13:16
  • @MattPressland, I don't know if you are student of Math or not. you are right there are other definitions. one may stuck to them. They may look easier definitions that's why some people use them. however in fact they make everything more complicated. because after accepting those easy definitions, proving theorems get much more complicated. for example you need to prove why exp is inverse of ln or if you say e=sigma(1/n!) then it gets too hard to prove why ln(e) is 1. These definitions for schools are fine but in university level are not that popular. – faravish Sep 19 '13 at 13:29
  • 4
    The definition presented here isn't even correct, its $ln(a) = \int_1^a \frac{1}{x} dx$ – Squirtle Sep 19 '13 at 14:04
  • @Squirtle true but i'm new here and not familiar with how to enter math formulas. – faravish Sep 19 '13 at 14:16
  • @faravish I am a student of maths - I'm not denying that there are pros and cons to the different sets of definitions, merely pointing out that there are choices. My university education did not stick to just one possible set of definitions, but used several and proved their equivalence. – mdp Sep 19 '13 at 15:11
  • 1
    @MattPressland, seems this conversation is going so long and getting diverted from the main stream and better to stop somewhere. still I dont care about negative votes since my sincere reason to post was just helping. have a nice time and thanks for giving your opinion. – faravish Sep 19 '13 at 15:21
  • 2
    Generally $\ln x$ is only defined before $e^x$ until you learn about ODEs (or perhaps Taylor series). The exponential is a "nicer" function than the logarithm (because it doesn't have any singularities), so it's useful to make it the logically primary function; it's just that the natural definitions all require a little more background to make rigorous than the natural definition of the logarithm. – Micah Sep 19 '13 at 16:53
  • 1
    @MattPressland In response to your first comment about a citation for this being taken as a definition for $\log$, see Spivak's Calculus (an analysis textbook). He uses $\log x=\int_1^x\frac{dx}x$ and $\exp=\log^{-1}$. Then he proves that $e^x=\exp x$ (where $e=\exp 1$) for all rational $x$, and thereafter defines $e^x=\exp x$ on all real $x$. From this you can show $\frac d{dx}e^x=e^x$ and $e^x=\sum_{n=1}^\infty\frac{x^n}{n!}$. – Mario Carneiro Sep 25 '13 at 00:20
  • @MarioCarneiro I wanted a citation for it being the most common, I had assumed that it was the definition at least somewhere! But it's still interesting to know that Spivak does things this way round. – mdp Sep 25 '13 at 06:41
2

One must not intermingle, what is definition and what is theorem. Before handling the given question, one should clearly state what we mean by exponential function, and what we mean by logarithmic function. There are a lot of theorems in between the definition and the final result. For a nice and accurate answer one should go through W Rudin's Pr of Math Analysis. A little known book "Beardon's Complex analysis is marvelous in this respect.

R K Sinha
  • 821
  • 9
  • 6
2

In my opinion, the primitive of the function $1/x$ has to be studied without mentioning the exponential function $e^x$. Indeed, the exponential function is the inverse function of the primitive of $1/x$ function. This recalls the story of the chicken and the egg: what we consider as known, $e^x$ or $\ln (x)$ ?