How to solve this system of equations through the creation functions? In my exercise I have: $$a_n=6a_{n-1}-3a_{n-2}+[n=0]+3[n=1]$$ [...] is a Iverson bracket.
I am using generating function method to solve recurrence equations. I multiply both sides by $x^n$ and sum over all possible values of $n$
It gives me $A(x) = \sum_{n \ge 0} a_n x^n$
After long division I should get fractions like $\frac{C}{(1-\lambda x)^k}$ which evaluate to $\binom{n+k-1}{k-1} \lambda ^n x^n$ which can give me an explicit formula for $a_n$
$$A(x)=x\cdot 6A(x)-3x^2 A(x)+1+3x$$
$$A(x)=\frac{3x+1}{3x^2-x+1}$$

How to solve this system of equations through the creation functions?

I have a problem with it because in this moment I must do long division of $A(x)=\frac{3x+1}{3x^2-x+1}$ but the denominator of the quadratic equation is less than zero and I don't know what to do now.
 A: 
After long division I should get fractions like $\frac{C}{(1-\lambda x)^k}$ which evaluate to $\binom{n+k-1}{k-1} \lambda ^n x^n$

What happened to $C$?


$$A(x)=x\cdot 6A(x)-3x^2 A(x)+1+3x$$
$$A(x)=\frac{3x+1}{3x^2-x+1}$$

What happened to the $6$?


I have a problem with it because in this moment I must do long division of $A(x)=\frac{3x+1}{3x^2-x+1}$ but the denominator of the quadratic equation is less than zero and I don't know what to do now.

Find out what happened to the $6$ and you'll get a positive denominator.
But even if the denominator were really negative, that just means that the roots of the quadratic are non-real complex numbers. The algebra still works, and you can still do a partial fraction decomposition: $$\frac{3x+1}{(x-\alpha)(x-\beta)} = \frac{p(x)}{x - \alpha} + \frac{q(x)}{x - \beta}$$ just requires $$(x-\beta)p(x) + (x-\alpha)q(x) = 3x + 1$$ so we can take $p(x) = p_0, q(x) = q_0$ and solve the simultaneous equations $$p_0 + q_0 = 3 \\ -\beta p_0 - \alpha q_0 = 1$$
