2
$\begingroup$

I can calculate this limit:

Limit[(c^(1 - g) - 1)/(1 - g), g -> 1]

and obtain the correct value:

Log[c]

but if I try to use a transformation rule (e.g. to plot that function for different values of g), I get an Indeterminate result:

Limit[(c^(1 - g) - 1)/(1 - g), g -> d] /. d -> 1
Indeterminate

I would assume that the transformation rule applies BEFORE the limit is calculated, but apparently that's not the case; and, on the other hand, I don't know how to force Mathematica to apply the rule before the limit is calculated.

Thanks,

pierpa

$\endgroup$
6
$\begingroup$
Unevaluated[Limit[(c^(1 - g) - 1)/(1 - g), g -> d]] /. d -> 1
Hold[Limit[(c^(1 - g) - 1)/(1 - g), g -> d]] /. d -> 1 // ReleaseHold
With[{d = 1}, Limit[(c^(1 - g) - 1)/(1 - g), g -> d]]
Limit[(c^(1 - g) - 1)/(1 - g), g -> #] &@1
Block[{Limit}, SetAttributes[Limit, HoldAll]; Limit[(c^(1 - g) - 1)/(1 - g), g -> d] /. d -> 1]
foo[(c^(1 - g) - 1)/(1 - g), g -> d] /. d -> 1 /. foo -> Limit

all give

(* Log[c] *)

In version 10, you can also use

Activate[Inactive[Limit[(c^(1 - g) - 1)/(1 - g), g ->d]] /. d->1]
Activate[Inactive[Limit][(c^(1 - g) - 1)/(1 - g), g ->d] /. d->1] (* thanks: @ybeltukov *)
Activate[Inactivate[Limit[(c^(1 - g) - 1)/(1 - g), g ->d]] /. d->1] (* thanks: @ybeltukov *)
$\endgroup$
  • $\begingroup$ A nice comprehensive list :-) For new functionality the proper usage is Inactivate[Limit[...]] or Inactive[Limit][...]. $\endgroup$ – ybeltukov Feb 1 '15 at 0:14
  • $\begingroup$ Thank you @ybeltukov. All three variants seem work in the Wolfram Cloud platform. $\endgroup$ – kglr Feb 1 '15 at 0:39
  • $\begingroup$ Perfect, thanks a lot $\endgroup$ – pierpa Feb 2 '15 at 5:36

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.