# What's the value of $\displaystyle y^{(n)}$when $\displaystyle y=\frac{x^n}{(x+1)^2(x+2)^2}$

What's the value of $\displaystyle y^{(n)}$when $\displaystyle y=\frac{x^n}{(x+1)^2(x+2)^2}$?

My Try:Let $\displaystyle y_n=\frac{x^n}{(x+1)^2(x+2)^2}$,so $\displaystyle y_n=xy_{n-1}$.According to Leibniz's formula,$$y_n^{(n)}=ny_{n-1}^{(n-1)}+xy_{n-1}^{(n)}$$.But I don't konw how to achieve it.

-
My first instinct is partial fractions - write $$y=p(x)+\frac{a_1}{x+1}+\frac{a_2}{(x+1)^2}+\frac{a_3}{x+2}+\frac{a_4}{(x+2)^2}‌​$$ But I'm not sure if this can be done in any reasonable way. – Thomas Andrews Apr 25 '13 at 12:50
@Thomas, To do partial fractions you would need to first do long division. – vadim123 Apr 25 '13 at 12:52
It may be that you were actually asked for the $n$-th derivative at $0$, in which case the answer is easy, $\frac{n!}{4}$. – André Nicolas Apr 25 '13 at 12:54
@AndréNicolas I'm sure I expressed right. – Dancing Moon Apr 25 '13 at 12:58
A related problem. By the way, if you benefit from the answers, do not forget to up vote them. – Mhenni Benghorbal Apr 25 '13 at 13:02

You can prove inductively that $$y_n = p_n(x) + (-1)^n\left(\frac{-(n+2)}{x+1}+\frac{1}{(x+1)^2} + \frac{2^{n+1}-n2^{n-1}}{x+2} + \frac{2^n}{(x+2)^2}\right)$$

Where $p_n$ is a polynomial of degree less than $n$.

That would let you compute $y_n^{(n)}$. It doesn't appear to give a pretty result, however.

I suspect Andre is right, and the real problem was to compute $y^{(n)}$ at $x=0$.

I arrived at this by noting that if $y_n = p_n(x)+\frac{a_n}{x+1}+\frac{b_n}{(x+1)^2}+\frac{c_n}{x+2}+\frac{d_n}{(x+2)^2}$ we can use the fact that $y_{n+1}=xy_n$ to get a recursive definition of $(a_{n+1},b_{n+1},c_{n+1},d_{n+1})$ in terms of $(a_n,b_n,c_n,d_n)$:$$a_{n+1}=b_n-a_n, b_{n+1}=-b_n, c_{n+1}=d_n-2c_n, d_{n+1}=-2d_n$$ Then I solved the recursion. It is nice that $a_i, b_i$ are never affected by values $c_i,d_i$, so the problem splits to solving two $2$-dimensional linear recurrences, and the matrices are fairly easy:

$$\begin{pmatrix}a_{n}\\b_n\end{pmatrix} = \begin{pmatrix}-1&1\\0&-1\end{pmatrix}^n\begin{pmatrix}a_{0}\\b_0\end{pmatrix}$$ and: $$\begin{pmatrix}c_{n}\\d_n\end{pmatrix} = \begin{pmatrix}-2&1\\0&-2\end{pmatrix}^n\begin{pmatrix}c_{0}\\d_0\end{pmatrix}$$

Then use that $\begin{pmatrix}1&\alpha\\0&1\end{pmatrix}^n=\begin{pmatrix}1&n\alpha\\0&1\end{pmatrix}$. Finally, find $a_0=-2,b_0=1,c_0=2,d_0=1$ to get the above expression.

I'm wondering if there is a fun way to do this using $$h(x,z)=\sum_{n=0}^\infty y_nz^n = \frac{1}{(1-xz)(1+x)^2(2+x)^2}$$ and computing the partial fractions for this relative to $x$, yielding functions:

$$h(x,z)=\frac{a(z)}{1+x} + \frac{b(z)}{(1+x)^2} + \frac{c(z)}{x+2}+\frac{d(z)}{(x+2)^2} + \frac{f(z)}{1-xz}$$

Where $a(z),b(z),c(z),d(z), \text{ and } f(z)$ are rational functions of $z$. Knowing the power series for these functions then would give us the power series the $n$th partial derivative of $h$ relative to $x$.

It turns out there is a simple relationship between these functions and the sequences $a_i,b_i,c_i,d_i$, namely, $a(z)=\sum_{i} a_iz^i$, and the same for $b,c,d.$

For example, Wolfram Alpha gives me $a(z)=\frac{-z-2}{(1+z)^2}$, which is $\sum_{n=0}^\infty (-1)^{n+1}(n+2)z^n$, and $a_n=(-1)^{n+1}(n+2)$ was just what I got above.

-
How do you get the partial fraction?I'm unfamiliar with it.Thank Q for your response! – Dancing Moon Apr 25 '13 at 13:57
Added not to outline how I got this. – Thomas Andrews Apr 25 '13 at 14:02
Thank Q,everybody! – Dancing Moon Apr 25 '13 at 14:14
If $z$ is the indeterminate, then there's nothing to do, right? I suppose you want $x$ to be the indeterminate. In this case, there are two ways to get WolframAlpha to give you the result. First, you could just enter the full Mathematica command, which allows a second argument specifying the variable: Apart[1/((1-z*x)*((1+x)^2)*((2+x)^2)),x]. Alternatively, you could use the fact that some symbols $(a,b,c)$ are typically treated as parameters, while others $(x,z)$ as variables. So just swap your $z$ with and $a$. – Mark McClure Apr 25 '13 at 16:19
No, I mean $z$ is an indeterminate. The $1-xz$ still makes it non-constant relative to $x$. Basically, we are solving a partial fraction with coefficients in $\mathbb R[z]$. $x$ is the "variable" of the partial fraction. I suppose you can treat both as indeterminate, but the point is, we are solving partial fractions over the field of rational functions on an indeterminate $z$. @MarkMcClure – Thomas Andrews Apr 25 '13 at 16:23

Assertion: $$y_n^{(n)} = \frac{A_nx+B_n}{(x+1)^{n+2}}+\frac{C_nx+D_n}{(x+2)^{n+2}}$$ Now, we are going to need $$xy_{n}^{(n+1)}=\frac{-(n+1)A_nx^2+(A_n-B_n(n+2))x}{(x+1)^{n+3}}+\frac{-(n+1)C_nx^2+(2C_n-(n+2)D_n)x}{(x+2)^{n+3}}$$ and $$(n+1)y_{n}^{(n)}=(n+1)\frac{(A_nx+B_n)(x+1)}{(x+1)^{n+3}}+(n+1)\frac{(C_nx+D_n)(x+2)}{(x+2)^{n+3}}$$ Combining these and applying the Leibniz rule, we get $$y_{n+1}^{(n+1)}=\frac{((n+2)A_n-B_n)x+(n+1)B_n}{(x+1)^{n+3}}+\frac{(2(n+2)C_n-D_n)x+2(n+1)D_n}{(x+2)^{n+3}}$$ Matching with the original assertion, we have $$A_{n+1}=(n+2)A_n-B_n\\ B_{n+1}=(n+1)B_n\\ C_{n+1}=2(n+2)C_n-D_n\\ D_{n+1}=2(n+1)D_n$$ And as $y_0^{(0)} = -\frac{2x+1}{(x+1)^2}+\frac{2x+5}{(x+2)^2}$, we also have that $$A_0 = -2\\ B_0 = -1\\ C_0 = 2\\ D_0 = 5$$ Now, we can solve for $B_n$ and $D_n$ relatively easily. $A_n$ and $C_n$ will require a little more work. But I'll leave the rest to you.

-
I understand most of your answer except your assumption,can you explan it? – Dancing Moon Apr 25 '13 at 14:11
The assertion actually came quite simply - I used a computer algebra program (Maxima) to see what the first few functions $y_n^{(n)}$ looked like. When viewed with a "partfrac" command to make it show the result of partial fractions, I noticed that they all took the form you see there. It's also possible to express with four separate terms, like this: $$\frac{E_n}{(x+1)^{n+1}}+\frac{F_n}{(x+1)^{n+2}}+\frac{G_n}{(x+2)^{n+1}}+\frac{‌​H_n}{(x+2)^{n+2}}$$ which will get you a slightly different set of recurrence relations. – Glen O Apr 25 '13 at 14:14