# A nasty indefinite integral $\int \frac{1}{x(x+1)(x+2)(x+3)(x+4) … (x+m)} dx$

Below is a problem from the book "Calculus and Analytic Geometry" by Thomas Finney. I am hoping somebody can check my work. I consider it to be a particular hard problem. Thanks,
Bob
Problem:
We dare you to evalaute this integral.
$$\int \frac{1}{x(x+1)(x+2)(x+3)(x+4) ... (x+m)} \,\, dx$$ Answer:
To evaluate this integral, we will consider some special cases. For $$m = 0$$ we have: \begin{align*} \int \frac{1}{x} \,\, dx &= \ln|x| + C \\ \end{align*} Now for $$m = 1$$ we have the following integral: $$\int \frac{1}{x(x+1)} \,\, dx$$ \begin{align*} \frac{1}{x(x+1)} &= \frac{A}{x} + \frac{B}{x+1} \\ 1 &= A(x+1) + B(x) \\ \end{align*} At $$x = 0$$ we have $$1 = A(0+1)$$ which yields $$A = 1$$. \begin{align*} A + B &= 0 \\ 1 + B &= 0 \\ B &= -1 \\ \frac{1}{x(x+1)} &= \frac{1}{x} - \frac{1}{x+1} \\ \int \frac{1}{x(x+1)} \,\, dx &= \ln|x| - \ln|x+1| + C \\ \end{align*} Now for $$m = 2$$ we have the following integral: $$\int \frac{1}{x(x+1)(x+2)} \,\, dx$$ \begin{align*} \frac{1}{x(x+1)(x+2)} &= \frac{A}{x} + \frac{B}{x+1} + \frac{C}{x+2} \\ 1 &= A(x+1)(x+2) + B(x)(x+2) + C(x)(x+1) \\ \end{align*} At $$x = 0$$ we have $$1 = A(0+1)(0+2)$$ which yields $$A = \frac{1}{2}$$. \newline At $$x = -1$$ we have $$1 = B(-1)(-1+2) = -B$$ which yields $$B = -1$$. \newline At $$x = -2$$ we have $$1 = C(-2)(-2+1) = 2C$$ which yields $$C = \frac{1}{2}$$. \begin{align*} \frac{1}{x(x+1)(x+2)} &= \frac{ \frac{1}{2}}{x} - \frac{1}{x+1} + \frac{ \frac{1}{2}}{x+2} \\ \int \frac{1}{x(x+1)(x+2)} \,\, dx &= \frac{1}{2} \ln{|x|} - \ln{|x+1|} + \frac{1}{2} \ln{|x+2|} + C \\ \end{align*} \newline Now for $$m = 3$$ we have the following integral: $$\int \frac{1}{x(x+1)(x+2)(x+3)} \,\, dx$$ \begin{align*} \frac{1}{x(x+1)(x+2)(x+3)} &= \frac{A}{x} + \frac{B}{x+1} + \frac{C}{x+2} + \frac{D}{x+3} \\ 1 &= A(x+1)(x+2)(x+3) + B(x)(x+2)(x+3) + \\ & C(x)(x+1)(x+3) + D(x)(x+1)(x+2) \\ \end{align*} At $$x = 0$$ we have $$1 = A(0+1)(0+2)(0+3) = 6A$$ which yields $$A = \frac{1}{6}$$.

At $$x = -1$$ we have $$1 = B(-1)(-1+2)(-1+3) = -2B$$ which yields $$B = -\frac{1}{2}$$.

At $$x = -2$$ we have $$1 = C(-2)(-2+1)(-2+3) = 2C$$ which yields $$C = \frac{1}{2}$$.

At $$x = -3$$ we have $$1 = D(-3)(-3+1)(-3+2) = -6D$$ which yields $$D = -\frac{1}{6}$$.

Hence, we have the following solution: $$\int \frac{1}{x(x+1)(x+2)(x+3)} \,\, dx = \frac{1}{6}\ln{|x|} - \frac{1}{2}\ln{|x+1|} + \frac{1}{2}\ln{|x+2|} - \frac{1}{6}\ln{|x+3|} + C$$ \newline Now for $$m = 4$$ we have the following integral: $$\int \frac{1}{x(x+1)(x+2)(x+3)(x+4)} \,\, dx$$ \begin{align*} \frac{1}{x(x+1)(x+2)(x+3)(x+4)} &= \frac{A}{x} + \frac{B}{x+1} + \frac{C}{x+2} + \frac{D}{x+3} + \frac{E}{x+4} \\ 1 &= A(x+1)(x+2)(x+3)(x+4) + B(x)(x+2)(x+3)(x+4) + \\ &+ C(x)(x+1)(x+3)(x+4) \\ &+ D(x)(x+1)(x+2)(x+4) + E(x)(x+1)(x+2)(x+3) \\ \end{align*} At $$x = 0$$ we have $$1 = A(0+1)(0+2)(0+3)(0+4) = 24A$$ which yields $$A = \frac{1}{24}$$.

At $$x = -1$$ we have $$1 = B(-1)(-1+2)(-1+3)(-1+4) = -6B$$ which yields $$B = -\frac{1}{6}$$.

At $$x = -2$$ we have $$1 = C(-2)(-2+1)(-2+3)(-2+4) = 4C$$ which yields $$C = \frac{1}{4}$$.

At $$x = -3$$ we have $$1 = D(-3)(-3+1)(-3+2)(-3+4) = -6D$$ which yields $$D = -\frac{1}{6}$$.

At $$x = -4$$ we have $$1 = E(-4)(-4+1)(-4+2)(-4+3) = 24E$$ which yields $$E = \frac{1}{24}$$.

Hence we have the solution:
Now for $$m = 4$$ we have the following integral: $$\int \frac{1}{x(x+1)(x+2)(x+3)(x+4)} \,\, dx = \frac{\ln{|x|} - 4\ln{|x+1|} + 6\ln{|x+2|} - 4\ln{|x+3|} + \ln{|x+4|} }{24} + C$$ Now let's consider the general case. \begin{align*} \frac{1}{x(x+1)(x+2)(x+3)(x+4) \cdots (x+m)} \,\, &= \frac{C_0}{x} + \frac{C_1}{x+1} \cdots + \frac{C_m}{x+m} \\ \end{align*} \begin{align*} 1 &= {C_0}(x+1)(x+2) \cdots (x+m) + {C_1}(x)(x+2) \cdots (x+m) + {C_2}(x)(x+1)(x+3)(x+4) \cdots (x+m) + \\ & \cdots C_m(x)(x+1)(x+2) \cdots (x+m-1) \\ \end{align*} Now lets consider the first term. We set $$x = 0$$ and we get: \begin{align*} 1 &= {C_0}(0+1)(0+2) \cdots (x+m) = m! C_0 \\ C_0 &= \frac{1}{m!} \end{align*} Now lets consider the $$C_2$$ term. We set $$x = 2$$ and $$m > 4$$. We get: \begin{align*} 1 &= C_2(-2)(-2+1)(-2+3)(-2+4)(-2 + 5) \cdots (-2 + m) \\ 1 &= C_2 (2)(1)(2)(3)(4) \cdots (m-2) \\ 1 &= 2(m-2)! C_2 \\ C_2 &= \frac{1}{2(m-2)!} = \frac{m(m-1)}{2(m!)} \\ C_2 &= \frac{ \binom {m}{2} } {m!} \\ \end{align*} Now lets consider the last term. We set $$x = -m$$ and we get:
\begin{align*} 1 &= C_m(-m)(-m+1)(-m+2) \cdots (x+m -1) \\ C_m &= \frac{(-1)^{m}}{m!} \\ \end{align*} Now lets consider one of the middle terms. We set $$x = -k$$ where $$0 <= k <= m$$ and we get: \begin{align*} 1 &= C_k(-k)(-k+1)(-k+2) \cdots (-1) (1)(2) \cdots (-k + m - 1) \\ 1 &= {-1}^k C_k(k-1)(k-2) \cdots (1)(2) \cdots (-k + m - 1) \\ C_k &= \frac{ 1 }{ {(-1)}^k C_k(k-1)(k-2) \cdots (1)(2) \cdots (-k + m - 1) } \\ C_k &= \frac{ k! }{ {(-1)}^k C_k(k-1)(k-2) \cdots (1)m! } \\ C_k &= \frac{ \binom {m}{k} }{ {(-1)}^k m! } \\ \end{align*} Hence the answer is: $$\sum_{k=0}^{k=m} \left( \frac{ \binom {m}{k} }{ {(-1)}^k m! }\right) \ln{|x+k|} + C$$

• What's your question? – user376343 May 19 at 19:05
• @user376343 - From the opening of the post, "I am hoping somebody can check my work." – Eevee Trainer May 19 at 19:07
• It seems it is right, but the powers of $-1$ must be in parentheses. ... and it is usual to put them in numerators rather than in denominators. – user376343 May 19 at 19:12
• There are no mistakes in your work per se. However, you should try to make solutions to problems as concise as possible without sacrificing clarity. If I were teaching a class how to do this problem, I would probably show all the work you showed in your answer. If I were doing this problem for homework, I would set up a standard induction argument. Base cases ($m = 0$, $m = 1$): $\ldots$. Inductive step: $\ldots$. Your prof probably doesn't want to see your thought process; he just wants to see a clear and complete solution. – Charles Hudgins May 19 at 19:57
• @Bob the powers of $−1$ must be in parentheses, otherwise it is always $-1$. – user376343 May 19 at 20:20

At this line: "Now lets consider the first term. We set $$x=0$$ and we get:" $$1 = {C_0}(0+1)(0+2) \cdots (x+m) = m!C_0$$ When you set $$x=0$$ there won't be any $$x$$ left.

For $$C_2$$ there is no mistake but then for the general term you did the same typo.

You can't have after you set $$x=-m$$: $$1 = C_m(-m)(-m+1)(-m+2) \cdots (\color{red}x+m -1)$$ And for the last part for some reason, you have $$C_k$$ in the denominator. \begin{align*} 1 &= C_k(-k)(-k+1)(-k+2) \cdots (-1) (1)(2) \cdots (-k + m - 1) \\ 1 &= (-1)^k C_k(k-1)(k-2) \cdots (1)(2) \cdots (-k + m - 1) \\ C_k &= \frac{ 1 }{ (-1)^k \color{red}{C_k}(k-1)(k-2) \cdots (1)(2) \cdots (-k + m - 1) } \\ C_k &= \frac{ k! }{ (-1)^k \color{red}{C_k}(k-1)(k-2) \cdots (1)m! } \\ C_k &= \frac{ \binom {m}{k} }{ (-1)^k m! } \\ \end{align*} Other than this everything it's correct.

• Minor nitpick. It's more appropriate to have $(-1)^k$ instead of $-1^k$. It makes it clearer that it's $-1$ being raised to the power. Otherwise per the order of operations, for example, $$-2^6 = -(2^6) = -64 \ne (-2)^6 = 64$$ – Eevee Trainer May 20 at 2:07
• @EeveeTrainer Actually it was a LaTeX typo: {-1}^k instead of (-1)^k. – Jean-Claude Arbaut May 20 at 7:13

A simpler approach is possible without all the other preliminary work. Let $$q_m(x) = \prod_{k=0}^m (x+k), \quad f_m(x) = \frac{1}{q_m(x)}.$$ Then $$f$$ admits a partial fraction decomposition of the form $$f_m(x) = \sum_{n=0}^m \frac{A_n}{x+n} \tag{1}$$ for suitable constants $$A_0, \ldots, A_m$$ which we wish to find, hence an antiderivative of $$f$$ is $$\int f_m(x) \, dx = \sum_{n=0}^m A_n \log |x+n|. \tag{2}$$ (I have omitted the constant of integration for convenience.) So all that remains is to determine the form of $$A_n$$. To do this, we observe that $$1 = q_m(x) \sum_{n=0}^m \frac{A_n}{x+n} = \sum_{n=0}^m p_n(x) A_n,$$ where $$p_n(x) = \prod_{k \ne n} (x+k) = (-1)^n \prod_{k=0}^{n-1} (-x-k) \prod_{k=n+1}^m (k + x).$$ Then in particular $$p_n(-n) = (-1)^n \prod_{k=0}^{n-1} (n-k) \prod_{k=n+1}^m (k-n) = (-1)^n n!(m-n)! = \frac{(-1)^n m!}{\binom{m}{n}},$$ and $$p_n(-k) = 0$$ for all other nonnegative integers $$k \le m$$ not equal to $$n$$. Therefore, $$A_n = \frac{1}{p_n(-n)} = \frac{(-1)^n}{m!} \binom{m}{n}$$ and $$\int f_m(x) \, dx = \sum_{n=0}^m \frac{(-1)^n}{m!} \binom{m}{n} \log |x+n| + C$$ as claimed.

We could set up a difference equation. Partial fractions indicates that $$f_m(x)=\frac1{\prod_{k=0}^m(x+k)}=\sum_{k=0}^m\frac{A_k^{(m)}}{x+m}$$ And it is a simple calculation to show that $$f_{m-1}(x)-f_{m-1}(x+1)=mf_m(x)$$ So, comparing coefficients of $$\frac1{x+k}$$ we have $$A_0^{(m-1)}=mA_0^{(m)}$$, $$A_{m-1}^{(m-1)}=-mA_m^{(m)}$$, and $$A_k^{(m-1)}-A_{k-1}^{(m-1)}=mA_k^{(m)}$$ for $$1\le k\le m-1$$. If we let $$A_k^{(m)}=\frac{(-1)^k}{m!}B_k^{(m)}$$ then our difference equations read $$B_0^{(m-1)}=B_0^{(m)}=\cdots=B_0^{(0)}=A_0^{(0)}=1$$, $$B_{m-1}^{(m-1)}=B_m^{(m)}=\cdots=B_0^{(0)}=1$$ and $$B_k^{(m-1)}+B_{k-1}^{(m-1)}=B_k^{(m)}$$ for $$1\le k\le m-1$$. We recognize these as the difference equations for Pascal's triangle, so $$B_k^{(m)}={m\choose k}$$ so it follows that $$A_k^{(m)}=\frac{(-1)^k}{m!}{m\choose k}$$ and $$\int f_m(x)dx=\sum_{k=0}^m\frac{(-1)^k}{m!}{m\choose k}\ln|x+k|+C$$

It looks right to me [That is, I did the calculation independently and got the same answer]. For brevity/clarity purposes you really only need to include the “general case”.

It would be more conventional to write $$C_k = \frac{(-1)^k}{k!(m-k)!}$$