-1

I am trying to find the value of $k$ (maybe it does not exist) for

$$\displaystyle \int_k^2 \dfrac{1}{\ln{v}-v} ~ dv=1$$ I used Solving Integrals for my approach as

f[k_?NumericQ] := NIntegrate[1/(Log[x] - x), {x, k, 2}]

FindRoot[f[k] == 1, {k, 2}]

This returns

$${k = 3.7864655704597134}$$

This result is larger than the upper limit of the integration value.

I use Windows 7, MMA version $11.0.1.0$.

Is this approach wrong or am I doing something incorrectly?

Moo
  • 3,260
  • 1
  • 12
  • 28
  • I get this result for k : {k -> 3.78647} with version 11.01 on Mach OS X. – Anton Antonov Feb 20 '17 at 01:15
  • I redid it with a fresh kernel and got your result, however, that result is larger than the higher limit of integration, so that confuses me. – Moo Feb 20 '17 at 01:18
  • Then you should put appropriate constraints to your problem formulation or change the integrand. – Anton Antonov Feb 20 '17 at 01:22
  • Please look at the stated integral - it was already there. In fact, why is FindRoot not observing the upper limit placed on $k$? – Moo Feb 20 '17 at 01:22
  • 3
    When we think about the graph of $\ln x$ vs $x$, we are reminded that $x > \ln x$ for all positive $x$. Therefore the integrand is negative for all positive values of $x$. To get a positive value for the integral, we must evaluate it from a greater value of $x$ to a lesser value of $x$. The "lower" limit on an integral does not mean it is numerically less than the "upper" limit. – LouisB Feb 20 '17 at 02:11
  • 1
    I'm voting to close this question as off-topic because the issue it raises is not really a Mathematica issue but a matter of the OP not having grasped the mathematics involved. – m_goldberg Feb 20 '17 at 02:40

1 Answers1

4

My guess is that you have some previous definitions that are not cleared. Using your definitions in a fresh notebook:

f[k_?NumericQ] := NIntegrate[1/(Log[x] - x), {x, k, 2}]
FindRoot[f[k] == 1, {k, 2}]
(*{k -> 3.78647}*)

Checking the solution:

f[3.7864655704597134`]
(*1.*)
NIntegrate[1/(Log[x] - x), {x, 3.7864655704597134`, 2}]
(*1.*)
Marchi
  • 1,838
  • 9
  • 7
  • I redid it with a fresh kernel and got your result, however, that result is larger than the higher limit of integration, so that confuses me. – Moo Feb 20 '17 at 01:18
  • 2
    @Moo - If you plot the integrand, i.e., Plot[1/(Log[x] - x), {x, 1, 4}] you will see that the integrand is negative in the range of interest. Consequently, to get a positive integral, the lower bound of the integration must be greater than the upper bound. – Bob Hanlon Feb 20 '17 at 01:24
  • @BobHanlon: That makes sense - back to the drawing board - something is wrong in the result as this does not work. Rats! Thank you. – Moo Feb 20 '17 at 01:26
  • @Marchi: Why does FindRoot not observe the upper limit placed on $k$? That is, we have FindRoot[f[k] == 1, {k, 2}], so shouldn't $k$ be no greater than $2$? – Moo Feb 20 '17 at 01:27
  • 2
    @Moo: No. The {k,2} in your FindRoot tells Mathematica to start at $k=2$ and find the closest root (higher or lower). – David G. Stork Feb 20 '17 at 01:38
  • @DavidG.Stork: Thanks - I misread that! – Moo Feb 20 '17 at 01:39