One way to do it is to use the Series
functionality: Series[f[z], {z, c, n}]
expands f[z]
in z
around c
to order n
. Here we want to expand in 1/j
, so we'll make a new variable jinv
($j$-inverse) to represent 1/j
, and write our function in terms of that. We then want to expand around jinv = 0
to order 2
.
So, we get
Series[(1 + jinv)^x/(1 + x jinv), {jinv, 0, 2}]
which returns
1 + 1/2 (-1+x) x jinv^2 + O[jinv]^3
So, unfortunately(?), it looks like the book is right.
This is how I think of expanding around a “composite variable” like $1/j$, but as @user64494 points out, you can also expand around $j$ directly in this case, by expanding around $j=\infty$!
Series[(1 + 1/j)^x/(1 + x/j), {j, Infinity, 2}]
which gives the same answer under interpreting jinv
as 1/j
.
To see why, you could possibly use Wolfram Alpha's step-by-step solution from within Mathematica!
WolframAlpha["D[(1 + w)^x/(1 + x w), {w, 2}]", IncludePods -> "Input",
AppearanceElements -> {"Pods"}, PodStates -> {"Input__Show steps"}]
(Here w = jinv
, and we'd be substituting w = 0
at the end to get 1/2 (-1+x) x
.)
Series[(1 + 1/j)^x/(1 + x/j), {j, Infinity, 2}]
results in $$1+\frac{(x-1) x}{2 j^2}+O\left(\left(\frac{1}{j}\right)^3\right) .$$ $\endgroup$ReplaceAll
to perform substitutions, but YMMV. $\endgroup$