My nonhomogeneous recurrence trial solution fails

$$T_n = 6T_{n-1} - 13T_{n-2} + 12T_{n-3} - 4T_{n-4} + 5n^2 + 3n + 2 + 2^n + n2^n$$

The characteristic polynomial is $x^4 - 6x^3 + 13x^2 - 12x + 4 = 0$, or $(x-2)^2 (x-1)^2 = 0$. Therefore the homogeneous solution looks like:

$$T_n = \alpha_1 2^n + \alpha_2 n 2^n + \alpha_3 (1)^n + \alpha_4 n (1)^n$$

The non-homogeneous components $5n^2 + 3n + 2 + 2^n + n2^n$ have some interference with this when we create our trial solution. We cannot assume trial solution $an^2 + bn + c + d2^n + en2^n$.

The $an^2$ term clashes with nothing.

$bn$ clashes with $\alpha_4 n (1)^n$.

The constant $c$ clashes with $\alpha_3 (1)^n$.

$d2^n$ clashes with $\alpha_1 2^n$.

$en2^n$ also clashes with $\alpha_2 n 2^n$.

The trial terms need to each be multiplied by factors of $n$ until nothing is colliding with anything in the homogeneous piece (nor colliding with other non-homogeneous terms).

I changed the trial solution to $an^2 + bn^3 + cn^4 + dn^2 2^n + en^3 2^n$.

But when I plug it into the non-homogeneous recurrence, I get an unsolvable system for some reason, according to Mathematica. Where did I go wrong?

• Don't delete old questions and then repost them verbatim. Especially questions that you have already double posted. Have some consideration for the other users of this forum. Before you deleted your old post, I was about to post to you that the recursion solution is of the form $$T_n = \sum_{k = 0}^3 \lambda_k~n^k~2^n + \sum_{k=0}^4 \lambda_{k + 4}~n^k$$ for 9 unknown $\lambda$ values. Use initial values to solve. – DanielV Jan 14 '16 at 14:48
• @DanielV I did so because I feel like nobody is actually reading what I'm saying. Everything you've said is already in my post. I am trying to understand why my approach is not working here when it works for so many other problems. For some reason when I try to span all the terms I need, it fails. As far as I can tell my solution matches your recurrence form (nine terms, with max terms $\lambda n^3 2^n$ and $\lambda n^4$. Please see my trial solution for the non-homogeneous form plus the recursion I have for the homogeneous form. Together they match your recursive form. – AJJ Jan 14 '16 at 15:02
• Nowhere in your post do I see an equation with 9 distinct variables, and nowhere do I see an attempt to find the values of those 9 variables, much less the initial conditions needed to determine what they would be. – DanielV Jan 14 '16 at 15:07
• For problems like these you can combine the homogeneous with the non-homogeneous. In this case, that becomes $T_n = \alpha_1 2^n + \alpha_2 n 2^n + \alpha_3 (1)^n + \alpha_4 n (1)^n + an^2 + bn^3 + cn^4 + dn^2 2^n + en^3 2^n$ = $\alpha_1 n^0 2^n + \alpha_2 n^1 2^n + dn^2 2^n + en^3 2^n + \alpha_3 n^0 + \alpha_4 n^1 + an^2 + bn^3 + cn^4$ (nine variables with the same terms as your recurrence). The whole problem is that I can't find the values of these nine variables even when I assign values to the first four values of $T$. It doesn't like the form of the recurrence with $9$ variables. – AJJ Jan 14 '16 at 15:12
• If need be, let $T(0)... T(4) = 1, 2, 3, 4$. Doesn't matter what they are; the problem is that I can't get the system to work out even with this general recurrence form. – AJJ Jan 14 '16 at 15:16

If $T_n = n$ for $1 \le n \le 4$, then use the recursive definition to get

$$T[1 \dots 9] = [1, ~2, ~3, ~4, 339, ~ 2658, ~12869, ~49362, ~164969]$$

Plug that into $$T_n = \sum_{k = 0}^3 \lambda_k~n^k~2^n + \sum_{k=0}^4 \lambda_{k + 4}~n^k$$

to get 9 equations and 9 variables. Solve for $\lambda$ to get:

$$\lambda[0 \dots 8] = \left[ -\frac{389}{2}, ~ -\frac{1}{6}, ~0, ~\frac{2}{3}, ~238, ~\frac{367}{6}, ~\frac{967}{12}, ~\frac{53}{6}, ~\frac{5}{12} \right]$$

Which is:

$$T_{n} = 2^n ~ \left(-\frac{389}{2} -\frac{1}{6}n + \frac{2}{3}n^3 \right) + 238 + \frac{367}{6}n + \frac{967}{12}n^2 + \frac{53}{6} n^3 + \frac{5}{12} n^4 \tag{S}$$

Evaluate $$S \vert_{n \to n} - 6~S\vert_{n \to n - 1} + 13~S\vert_{n \to n - 2} - 12~S\vert_{n \to n - 3} + 4~S\vert_{n \to n - 4}$$

• I am curious: If you solve the non-homogeneous part by itself, do you find no solution to $a,b,c,d,e$? (i.e. $an^2 + bn^3 + cn^4 + dn^2 2^n + en^3 2^n$). Normally people solve the non-homogeneous part separately from the homogeneous part instead of combining them and solving for the constants all at once, but now I am wondering if your approach is the better way to go about it... – AJJ Jan 14 '16 at 16:08