I'd like to examine the continuity of the following function:

f[x_] := Limit[(n^x - n^(-x) ) / (n^x + n^(-x) ), n -> Infinity]

I know that this function isn't continuous because $f(x)=-1$ for $x<0$, for $x=0$ $f(x)=0$, and finally $f(x)=1$ for $x>0$ .

$$ x<0\quad \quad f(x)=-1 \\ x=0\quad \quad f(x)=\ \ \ 0 \\ x>0\quad \quad f(x)=\ \ \ 1 \\ $$

I would rather have a more formal proof than my guess. Could someone give me a tip on how I can prove this using Mathematica?

  • $\begingroup$ In general, Mathematica does not generate formal proofs. Probably closest built-in Mma functionality gets to proving something in general sense is capability of generating counterexamples - but not finding counterexamples is not a formal proof, of course. $\endgroup$ – kirma May 13 '15 at 10:26
  • $\begingroup$ Oh, maybe I formed my question in wrong way. I don't need exactly formal proof, but I just would like to make some calculations, how to show this discontinuity. For now I haven't idea how can I show that $\endgroup$ – adolzi May 13 '15 at 10:32
  • $\begingroup$ My first suggestion would be finding a solution for x with Solve, looking for differing values of Limits of x from different Directions (1 and -1). This should be trivial, but I don't have Mathematica handy just now... $\endgroup$ – kirma May 13 '15 at 11:26
  • $\begingroup$ Generaly I'm able to compute Limits from different Directions, but how can I prove that I should find around x=0? $\endgroup$ – adolzi May 13 '15 at 11:31
  • 3
    $\begingroup$ $n^x = e^{(\ln n) x}$, and $(e^y - e^{-y})/(e^y + e^{-y}) = \tanh y$. So your function is just $\tanh( (\ln n) x)$. This, along with the fact that $\tanh(\pm \infty) = \pm 1$ and $\tanh(0) = 0$, should be enough to prove your assertions. $\endgroup$ – Michael Seifert May 13 '15 at 13:29

As requested, I'm expanding on my comment above, in which I noted that $$ \frac{n^{x} - n^{-x}}{n^x + n^{-x}} = \tanh [ (\ln n) x] $$ If you want to coax Mathematica to show this for you, you have to be a little tricky. In particular, Mathematica will automatically evaluate Exp[Log[n] x] into n^x unless you tell it not to. However, if you Hold the expression, and apply the ExpToTrig function to it before you release the hold, you get the result above:

f[x] /. Power[n, x_] -> Exp[Hold[Log[n] x]]

enter image description here

enter image description here

Once you've done this, then Mathematica can handle the limits correctly:

Map[Limit[%, n -> Infinity, Assumptions -> #] &, {x > 0, x == 0, x < 0}]

(* {1, 0, -1} *)

I'm not sure this is a generally useful result—I had to kind of know where I was going in order to guide Mathematica there—but it's good to see that it can be done, at least.

| improve this answer | |
  • $\begingroup$ Thank you for writing this up! I have found that I sometimes struggle mightily to manipulate expressions in Mathematica, even in those cases where I knew where to go, so I always appreciate seeing how others do it! (+1) $\endgroup$ – MarcoB May 14 '15 at 14:37

Limit takes Assumptions


f[x_] := Limit[(n^x - n^(-x))/(n^x + n^(-x)), n -> Infinity]

Assuming[{#}, f[x]] & /@ {x < 0, x == 0, x > 0}

{-1, 0, 1}

Plot[f[x], {x, -5, 5}, Exclusions -> 0,
 Epilog -> {Red, AbsolutePointSize[6], Point[{0, f[0]}]}]

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.