Better way of factorising $x^2-a^2+x+a$ I am currently at the subject factorisation and I have the following problem:
Fully factorize: $$ {x^2}-{a^2}+x+a $$
What I did was the following:
Create a common factor: $$ x({1^2}+1)-a(1^2-1) $$
But creating a common factor didn't work. 
After a lot of guessing I got the correct answer: $$(x+a)(x-a+1)$$  

My question is, is there any way of getting this answer without guessing a lot?

 A: The first two terms are a difference of squares. This can be factored $x^2 - a^2 = (x+a)(x-a)$. Using this fact, we get: 
$$\begin{align} {x^2}-{a^2}+x+a & = \color{blue}{(x+a)}(x-a) + \color{blue}{(x +a)} \\ \\
& = \color{blue}{(x+a)}((x-a) + 1)\\ \\  
& = (x+a)(x-a+1)\end{align}$$
A: This is a quadratic polynomial in $x$, so you can factor it using your usual techniques and analogs thereof for factoring quadratic polynomials. (alternatively, you can view it as a quadratic polynomial in $a$)
The 'brute force' method would be to use the quadratic formula to find the roots. However, factoring techniques involving looking at the factors of the leading and constant terms are effective for this problem.
A: To factor a quadratic polynomial 
we can use the zeroes of the polynomial. If the polynomial is
$$x^2+px+q$$
and the zeroes are $x_1$ and $x_2$
then we have
$$x^2+px+q=(x-x_1)(x-x_2)$$
and $x_1$ and $x_2$ are the solutions of the equation
$$x^2+px+q=0$$
which are given by
$$x_{1,2}=\frac{p}{2} \pm \sqrt{\frac{p^2}{4}-q}$$
The polynomial 
$${x^2}-{a^2}+x+a \tag{1}$$
can be seen as a polynomial with the variable $x$ with coeffizients that are polynomials with variable $a$ over $\mathbb{Z}$, so we write $(1)$ as
$$x^2+x+(a-a^2) \tag{2}$$
and we have
$$\begin{array}\\
p&=&1\\
q&=&a-a^2
\end{array}$$
and therefore
$$\frac{p^2}{4}-q=a^2-a+\frac{1}{4}=(a-\frac{1}{2})^2 \tag{3}$$
So $$\begin{array}\\
x_1&=&-\frac{1}{2}+(a-\frac{1}{2})&=&a-1\\
x_2&=&-\frac{1}{2}-(a-\frac{1}{2})&=&-a\\
\end{array}$$
So the factorization is
$$(x-x_1)(x-x_2)=(x-(-a))(x-(a-1))$$
I did not prove here that this procedure must always work (e.g. that the square root does exist), but one can check that the result calculated is a factorization of the given polynomial. More details (even for degrees greater than 3) can be found here.
