## Derivation of Generalization of the Gamma Function

The following definite integral problem was posted on stackexchange today.

(1)

The version of the gamma function, a useful function for solving improper integrals, that I learned as an undergraduate physics major is

(2)

At first glance, it appears that the gamma function (equation (2)) can be used to solve equation (1), since a constant times a definite integral is equal to the constant times the definite integral. However, since , equation (2) can’t be used to solve equation (1); the integrands are not of the same form. But it is possible to derive a formula for solving improper integrals of the same form as equation (2) using u-substitution and the gamma function.

Equation (1) has the form

(3)

(with c and a being constants being any constant).

Let

(4)

It follows from equation (4) that

(5)

and

(6)

Applying equations (4), (5), and (6) to equation (3):

(7)

(8)

In equation (7), is just the gamma function, and is thus equal to .

Note: the bounds of integration have not changed, since when x goes to zero, from equation (4), u goes to zero as well. And when x goes to infinity, u goes to infinity for any non-zero constant a.

Finally, from equations(7) and (2) (the gamma function):

(9)

From (1), and . So the solution to (1) is:

Without using equation (8), the integral could still be solved, but it would require using integration by parts multiple times (unless there is another method that I am unaware of), which is an unnecessarily long and arduous way to evaluate the integral.

## Using Python To Find Square-Triangular Numbers

A number is triangular if it satisfies the formula for some positive integer . The square-triangular numbers are numbers that are both triangular and the square of a positive integer.

Letting the n-th triangular number equal

…and the square of the m-th positive integer equal … it follows that a positive integer is both triangular and a square if

for some value of n and some value of m. Finding pairs of values of m and n that satisfy this equation is not easy by hand. The following manipulations of the equations above allow for the use of a simple python algorithm to find square-triangular numbers.

The following two definitions will help simplify the equation above:

With the definitions of w and z above, can be re-written as

Finding values of w and z that satisfy the equation above is not simple, but solutions can be found easily in Python. The following short algorithm finds the first 6 square-triangular numbers.

## Informal Proof of the Associative Law of Matrix Multiplication

In general, if A is an matrix (meaning it has m rows and n columns), the matrix product AB will exist if and only if the matrix B has n rows. If B is an matrix, AB will be an matrix. In general, if A is an matrix (meaning it has m rows and n columns), the matrix product AB will exist if and only if the matrix B has n rows. If B is an matrix, AB will be an matrix.

When multiplying one matrix by another, the number of columns of the matrix on the left must be equal to the number of rows of the matrix on the right. The number of rows of the resulting matrix will be equal to the number of rows of the matrix on the left, and the number of columns will be equal to the number of columns of the matrix on the right.

For (AB)C to exist, C must have p rows (the same number of rows as columns of AB). If C is a matrix, (AB)C will be an matrix.

If (AB)C exists, A(BC) will also exist and have the same shape as (AB)C. For these matrices to exist, A must have the same number of columns as B has rows, and C must have the same number of rows as B has columns. If B is an matrix, for BC to exist, C must have p rows. If C is a matrix, BC will be an matrix. If (AB)C exists, that means that AB exists. If BC is an matrix, then A must have n columns. If A is an matrix, A(BC) will be an matrix. So if A is an matrix, B is an matrix, and C is a matrix, it follows that (AB)C and A(BC) both exist and are matrices.

When (AB)C and A(BC) both exist, . To prove this, all we must do is prove that an arbitrary column of AB(C) will be equal to the same arbitrary column in A(BC).

If represents the i-th column of any matrix K, matrix B can be represented as

is the i-th column of B, and is a vector with n rows. The i-th column of AB is equal to A times the i-th column of B.

The j-th column of the matrix C can be represented as

is the value in row i, column j of C.

Column j of (AB)C is equal to AB times column j of C. This is equal to the linear combination of the i-th columns of (AB) with the i-th values in .

The j-th column of BC is equal to , which is equal to the linear combination of the i-th columns of B with the i-th values in :

The j-th column of A(BC) is equal to the jth column of BC, times A.

Since the j-th column of (AB)C is equal to the j-th column of A(BC), it follows that .