Xeriar wrote:Something special about sqrt (1 - sin^2) - integrals and 1/2 then, or does it get used elsewhere?

It's the binomial theorem, and it's valid for complex numbers, if we write C(x,y) = x!/[y!(x-y)!] and x! = Int_0^\infty[ t^x exp(-t) dt ]. One can verify by integration by parts that x! is the standard factorial for non-negative integers and (x+1)! = (x+1)x! for all complex numbers, if x! is defined. We actually have (x-1)! = Γ(x) as the so-called "gamma function" for this. Unfortunately, it's not defined at nonpositive integers, so we can't use it for those cases (although since we're generally taking ratios, the limits might be well-defined).

Xeriar wrote:That sounds like math abuse.

Not really. We can define the symbol C(n,k) as with the above code, which works for most complex numbers as well. Or if we treat the binomial theorem formally as defining the symbol C(n,k):

(1+z)^x = Sum_{k=0}^\infty C(x,k) z^k,

then C(x,k) exists even for negative integers x and actually complex numbers as well, since the right-hand side is just the MacLaurin series of the left-hand side, and it is well-defined. Now, we have

(1-z)^{-1} = (1 + z + z² + z³ + ... )

as the generating function of the number of ways to pick k objects out of one box, i.e., the coefficient of z^k is that number (which is 1, as it should be). Hence if we have n boxes, the coefficient of z^k in

(1-z)^{-n} = (1 + z + z² + z³ + ... )^n

gives us the number of ways to pick k objects out of n boxes with no restrictions as to how many we can pick from each box. For example, for n = 5 boxes and k = 2 objects, we can pick both out of one box (C(5,1) = 5 choices) or two out of different boxes (C(5,2) = 10 choices); thus the total number is 15. Sure enough,

(1+z)^{-5} = 1+5z+15z²+35z³+...

has the correct coefficient of z². Hence C(-5,2) = (-1)²15 = 15. Similarly, we would have C(-5,3) = -35.

Alternatively, we can say that |C(-n,k)| is the number of ways we can pick k things out of n choices if we're allowed to pick something more than once, but without order. (If with order, the answer is obviously n^k.) We don't have to do this, by the way--|C(-n,k)| = C(n+k-1,k). That's the form that's usually used.