<s>[INST] Method of partial fractions when denumerator cannot be factorized? Suppose I'm given an expression: \begin{align*} P(x) = \frac{1+x}{1-2x-x^2}. \end{align*} The denumerator cannot be readily factorized, so I found the zeros, which are \begin{align*} \lambda_1 = -1 - \sqrt{2} \qquad \lambda_2 = -1 + \sqrt{2}. \end{align*}
I want to apply the method of partial fraction to $P(x)$ now. I wanted to write \begin{align*} P(x) = \frac{1+x}{1-2x-x^2} = \frac{A}{(x- \lambda_1)} + \frac{B}{(x- \lambda_2)} \end{align*} but this equality does not hold. Since $(x-\lambda_1) (x- \lambda_2) = x^2 + 2x -1 \neq 1-2x-x^2$. So what denumerators should I choose to go with $A$ and $B$? 
 [/INST] Notice, we have $$\frac{x+1}{1-2x-x^2}$$ $$=\frac{x+1}{-(x^2+2x-1)}$$  $$=\frac{-(x+1)}{(x^2+2x+1)-2}$$ $$=\frac{-x-1}{(x+1)^2-(\sqrt2)^2}$$  $$=\frac{-x-1}{(x+1-\sqrt2)(x+1+\sqrt2)}$$ Now, let 
$$\frac{-x-1}{(x+1-\sqrt2)(x+1+\sqrt2)}=\frac{A}{x+1-\sqrt2}+\frac{B}{x+1+\sqrt2}$$
By comparing the corresponding coefficients of the sides, we get   $$\begin{cases}
A+B=-1\\ A(1+\sqrt2)+B(1-\sqrt 2)=-1\end{cases}$$  By solving the above equations we get $$A=-\frac{1}{2}, \ B=-\frac{1}{2}$$
Hence, we get
$$\bbox[5px, border:2px solid #C0A000]{\color{red}{\frac{x+1}{1-2x-x^2}=-\frac{1}{2(x+1-\sqrt2)}-\frac{1}{2(x+1+\sqrt2)}}}$$
</s>