A better way to solve non-homogeneous linear recurrences?

131 Views Asked by At

I'm aware of how to solve these problems for both homogeneous and non-homogeneous linear relations. My approach has always been to multiply both side of the recurrence equation by $x^n$, sum over both side by the first valid index. Like the solution @Piyush Divyanakar provided on my previous question here.

However, the algebra for using this method can often get very messy. I'm looking at the solutions provided by brilliant.org, which looks very simple and easy to understand.

Disclaimer: due to the complexity of the equations in latex, I feel that it's not worth it to copy the solutions over. Please scroll down on brilliant to the first example under the section titled "Solving Nonhomogeneous Linear Recurrence Relations".

The one for solving homogeneous relations is great. However, they seem to have skipped over a few steps for solving non-homogenous ones. Namely, after getting the series $$-c_0 - c_1x + (3c_0 + c_2)x^2 + (2c_0 + 3c_1 - c_3)x^3 + \dots = -5 - 5x + 3x^2 - 10 x^3 + \dots$$

There's no explanation as to how

$$(2x^3 + 3x^2 - 1 ) c(x) = -7 + x + 9 x^2 + \frac{2}{1-x} - \frac{4}{(1-x)^2}$$

came about...

Of course, the coefficients were changed due to the right hand side of the recurrence, but how? Can we apply a similar systemmatic approach to non-homogeneous linear recurrences? In other words, where is the step they skipped?