2
$\begingroup$

I'm trying to get mathematicas series function for $(1+x)^{m}$ to output a result that look like this:

$(1+x)^{m} = \sum_{n=0}^{\infty} \frac{m !}{n !(m-n) !}x^{n}$

However,

Clear["Global`*"];
series[expr_, x_, x0_] := 
 Defer[expr = Sum[#, {n, 0, \[Infinity]}]] &[
  FullSimplify@
    SeriesCoefficient[expr, {x, x0, n}, 
     Assumptions -> {n >= 0}] (x - x0)^n]
series[(1 + x)^m, x, 0]

$(1+x)^{m}=\sum_{n=0}^{\infty} x^{n}$ Binomial $[m, n]$

How can I get the form without special function Binomial[m,n]?

$\sum_{n=0}^{\infty} x^{n}$ Binomial $[m, n] ---> \sum_{n=0}^{\infty} \frac{m !}{n !(m-n) !}x^{n}$

I know that this result can be achieved by slightly modifying the code, but I have tried and can't do it yet.

$\endgroup$
7
  • $\begingroup$ "but I have tried and can't do it yet" Then what did you try? $\endgroup$
    – xzczd
    Mar 16 at 11:11
  • $\begingroup$ @xzczd Because FunctionExpand[Binomial[m, n]]==Gamma[1 + m]/(Gamma[1 + m - n] Gamma[1 + n]), so I modified some code in ComplexityFunction -> ((LeafCount@# + 10 Count[#, _Gamma | _Pochhammer, {0, \[Infinity]}]) &). But I can't get the result. $\endgroup$
    – lotus2019
    Mar 16 at 11:19
  • $\begingroup$ (Binomial[m, n] // FunctionExpand[#] &) /. Gamma[1 + a_] :> Factorial[a] // TraditionalForm $\endgroup$
    – Syed
    Mar 16 at 11:20
  • 1
    $\begingroup$ Simply define a rule: your expression /. Binomial[m_, n_] -> m!/(n! (m - n)!) $\endgroup$ Mar 16 at 11:54
  • 1
    $\begingroup$ @Syed I believe Gamma[a_] :> Factorial[a-1] is more robust (e.g. works on Gamma[2+n] and Gamma[n] etc.). Alternatively, one could simply write the rule to transform Binomial into factorials directly. $\endgroup$
    – Michael E2
    Mar 16 at 16:48

2 Answers 2

2
$\begingroup$
bitofac[test_] := test /. Binomial[n_, k_] -> n!/k!/(n - k)!
series[expr_, x_, x0_] := 
 Defer[expr = Sum[#, {n, 0, \[Infinity]}]] &[
   FullSimplify@
     SeriesCoefficient[expr, {x, x0, n}, 
      Assumptions -> {n >= 0}] (x - x0)^n] // bitofac
series[(1 + x)^m, x, 0]

res

$\endgroup$
3
$\begingroup$

Sadly, OP fails to understand the hint, so:

series[expr_, x_, x0_] := 
 Defer[expr = Sum[#, {n, 0, ∞}]] &[
  FullSimplify[#, Assumptions -> {m >= n >= 0 && {n, m} ∈ Integers}] &@
    FunctionExpand@SeriesCoefficient[expr, {x, x0, n}] (x - x0)^n]
series[(1 + x)^m, x, 0]
$\endgroup$

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.