Factoring $\frac{n(n+1)}2x^2-x-2$ for $n\in\mathbb Z$ I was factoring quadratic polynomials for high-school practice and I noticed a pattern: $$\begin{align} x^2-x-2 &=(x+1)(x-2) \\ 3x^2-x-2 &=(x-1)(3x-2) \\ 6x^2-x-2 &= (2x+1)(3x-2) \\ 10x^2-x-2 &= (2x-1)(5x+2) \\ 15x^2-x-2 &= (3x+1)(5x-2) \\ 21x^2-x-2 &= (3x-1)(7x+2) \\ &\vdots\end{align}$$ So it seemed that, for any integer $n$, we have:

$$\frac{n(n+1)}2x^2-x-2=\Big(\left\lceil{\frac n2}\right\rceil x+(-1)^{n+1}\Big)\Big(\left\lceil{n+\frac{(-1)^n}2}\right\rceil x + 2(-1)^n\Big).$$

where the pattern I showed above begins with $n=1$ and ends with $n=6$.
I am not sure how to prove this (assuming it is true). I know that $-2=(-1)^{n+1}\cdot 2(-1)^n$ but I don't know how to prove that: $$\left\lceil{\frac n2}\right\rceil\cdot \left\lceil{n+\frac{(-1)^n}2}\right\rceil=\frac{n(n+1)}2\tag{$\star$}$$ and $$2(-1)^n\left\lceil{\frac n2}\right\rceil+(-1)^{n+1}\left\lceil{n+\frac{(-1)^n}2}\right\rceil=-1$$ which I believe is necessary to prove this conjecture. Since $n$ is an integer, I was thinking of letting $n=\left\lceil\frac k2\right\rceil$ for any real $k$ or something, and I'd assume that $$\left\lceil{\frac n2}\right\rceil=\left\lceil{\frac{\left\lceil{\frac k2}\right\rceil}2}\right\rceil=\left\lceil{\frac k4}\right\rceil$$ but I'm not sure how "round-off arithmetic" works (informally speaking). Any help is appreciated.

Edit:
Thanks to @lone_student's comment, I have shown $(\star)$ to be true for all $n\in\mathbb Z$ by considering $n$ even and odd.
Lemma:$$\left\lceil {\frac nm}\right\rceil=\left\lfloor{\frac{n-1}m+1}\right\rfloor\tag1$$
Here, $m=2$.
Also: $$n-\left\lfloor\frac n2\right\rfloor=\left\lceil\frac n2\right\rceil\tag2$$
Using these, we can show that:
$$\frac{n(n+1)}2=\left\lceil\frac n2\right\rceil\cdot\left\lceil{n+\frac{(-1)^n}2}\right\rceil=\underbrace{\Big(n-\left\lfloor\frac n2\right\rfloor\Big)}_{\text{By } (2)}\cdot\underbrace{\left\lfloor\frac{2n+(-1)^n-1}2+1\right\rfloor}_{\text{By (1)}}$$
When $n=2k\in\mathbb Z$ we have $$k(2k+1)=\big(2k-\left\lfloor k\right\rfloor\big)\lfloor2k+1\rfloor=k(2k+1)$$ since $k$ and $2k+1$ are integers, and, by definition, $\lceil \alpha\rceil =\lfloor \alpha\rfloor = \alpha$ iff $\alpha\in\mathbb Z$.
Similarly, when $n=2k-1$, we have: $$k(2k-1)=\Big(2k-1-\left\lfloor k-\frac 12\right\rfloor\Big)\lfloor 2k-1\rfloor = k(2k-1)$$ since obviously $\left\lfloor k-\frac 12\right\rfloor = k-1$ for $k\in\mathbb Z$.

I believe there was some confusion towards my question: did I mean to factorise the quadratic in terms of $n$ or did I mean to prove specifically the ceiling-function product identity? I did intend to ask a question on the latter subject, but I had falsely assumed that the case-by-case polynomial pattern I showed above could only be represented through the ceiling functions. This was wrong.

Hint
To get factors, write $$\frac{n (n+1)}{2}x^2 - x- 2 = \frac{n (n+1)}{2} \left(x^2  -\frac{2}{n(n+1)}x - \frac{2}{n} \cdot \frac{2}{n+1} \right)  = \frac{n (n+1)}{2} \left(x^2  -(\frac{2}{n} -\frac{2}{n+1})x - \frac{2}{n} \cdot \frac{2}{n+1} \right) = \frac{n (n+1)}{2} \left( (x- \frac2n)(x+ \frac{2}{n+1}) \right)$$
Can you proceed?
