2
$\begingroup$

How can I get binomial coefficients in expansion of $(n x+i) (1+i x)^n+(n x-i) (1-i x)^n$, where $i=\sqrt{-1}$ and $n$ is an integer. I have no idea how to coax Mathematica to do something remotely close to this without doing a lot of copying and pasting as if I was doing it by hand. If possible, I like the coefficients given in binomial notation.

$\endgroup$
2
  • $\begingroup$ Would help if actual Mathematica input was provided.. $\endgroup$ Jan 8 '14 at 17:58
  • $\begingroup$ you mean: (1 - I x)^n (-I + n x) + (1 + I x)^n (I + n x)? $\endgroup$
    – user11356
    Jan 8 '14 at 18:00
4
$\begingroup$

It is difficult to automatically obtain such expansion. However, we can make сhain of identical transformations

I (1 - I n x) (1 + I x)^n - I (1 + I n x) (1 - I x)^n // FullSimplify

I (1 - I n x) Sum[Binomial[n, m] (I x)^m, {m, 0, n}] - 
  I (1 + I n x) Sum[Binomial[n, m] (-I x)^m, {m, 0, n}] // FullSimplify

I (1 - I n x) Sum[Binomial[n, m] (I x)^m, {m, 0, n}] - 
  I (1 + I n x) Sum[Binomial[n, m] (-I x)^m, {m, 0, n}] // FullSimplify

2 I Sum[Binomial[n, m] (I x)^m, {m, 1, n, 2}] + 
  2 n x Sum[Binomial[n, m] (I x)^m, {m, 0, n, 2}] // FullSimplify

2 I Sum[Binomial[n, m] (I x)^m, {m, 1, n, 2}] - 
  2 n I Sum[Binomial[n, m - 1] (I x)^m, {m, 1, n + 1, 2}] // FullSimplify

Sum[2 I (Binomial[n, m] - n Binomial[n, m - 1]) (I x)^m, {m, 1, n + 1,
    2}] // FullSimplify

Sum[2 I (Binomial[n, 2 j + 1] - n Binomial[n, 2 j]) (I x)^(2 j + 1), 
  {j, 1, (n + 1)/2}] // FullSimplify

Each line outputs

(1 - I x)^n (-I + n x) + (1 + I x)^n (I + n x)

Finally, the expansion is

Sum[2 I (Binomial[n, 2 j + 1] - n Binomial[n, 2 j]) (I x)^(2 j + 1), 
    {j, 1, (n + 1)/2}] // HoldForm // TraditionalForm

$$ \sum _{j=1}^{\frac{n+1}{2}} 2 i \left(\binom{n}{2 j+1}-n \binom{n}{2 j}\right) (i x)^{2 j+1} $$

$\endgroup$
3
  • $\begingroup$ That's very nice. Thank you. It is easy to see that those pesky $i$'s go away. I did get the same expression doing it by hand (of course with no $i$'s in it). I wish I could also accept this as the answer. $\endgroup$
    – user11356
    Jan 8 '14 at 23:28
  • $\begingroup$ With all due respect to Daniel, I think this reply meets the conditions I set in my question better. So, I'll switch my accepted answer. I wish I could accept both. $\endgroup$
    – user11356
    Jan 9 '14 at 0:32
  • $\begingroup$ Heartbroken though I am over the loss of credit, I'm fully in agreement with the outcome here. (Actually I thought of noting yesterday that you might have accepted my response too soon, and should feel free to undo that. I would have sent it today had you not made the change.) $\endgroup$ Jan 9 '14 at 16:29
2
$\begingroup$

If you mean to do this for general n then this is something that "works", after a fashion.

ee = (1 - I x)^n (-I + n x) + (1 + I x)^n (I + n x);

ss = 
 SeriesCoefficient[ee, {x, 0, j}, 
  Assumptions -> 0 <= j <= n && Element[n, Integers]];

The result is in terms of ghastly DifferenceRoot objects. It evaluates nicely though, and in a way that gives functions of n (as it ought).

Table[ss, {j, 0, 10}]

(* Out[16]= {0, 0, 0, -2 (-(1/6) (-2 + n) (-1 + n) n + 
    1/2 (-1 + n) n^2), 0, 
 2 (-(1/120) (-4 + n) (-3 + n) (-2 + n) (-1 + n) n + 
    1/24 (-3 + n) (-2 + n) (-1 + 
       n) n^2), 0, -2 (-(((-6 + n) (-5 + n) (-4 + n) (-3 + n) (-2 + 
        n) (-1 + n) n)/5040) + 
    1/720 (-5 + n) (-4 + n) (-3 + n) (-2 + n) (-1 + n) n^2), 0, 
 2 (-(1/362880)(-8 + n) (-7 + n) (-6 + n) (-5 + n) (-4 + n) (-3 + 
        n) (-2 + n) (-1 + n) n + ((-7 + n) (-6 + n) (-5 + n) (-4 + 
       n) (-3 + n) (-2 + n) (-1 + n) n^2)/40320), 0} *)
$\endgroup$
3
  • $\begingroup$ Thank you. That's a lot more than what I was able to accomplish. I need to study your reply tho :) $\endgroup$
    – user11356
    Jan 8 '14 at 18:16
  • $\begingroup$ Now that I understand what that output means, it seems I have to it by hand. But I thank you for taking the time to answer. $\endgroup$
    – user11356
    Jan 8 '14 at 18:35
  • $\begingroup$ Unless you are versed in DifferenceRoot understanding, I'd not give that aspect much thought (I'm not, and I didn't). Just treat it as a black box is what I recommend (and do). $\endgroup$ Jan 8 '14 at 18:41

Your Answer

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