Let $R$ be an integral domain, $P$ be a prime ideal of $R$. Let $f\in R[x]$, where $f(x):=a_nx^n +\dots + a_1x+a_0$, such that $a_n\not\in P$, $a_i\in P$ ($i<n$), $a_0\in P^2$. Then $f$ is irreducible.
I was trying to prove this by analogy with the proof in the book Contemporary Abstract Algebra by Gallian, but I have no idea what the author means when he says "... so there is a least integer $t$ such that $p\nmid b_t$. Also, where he says "Let $a_t=b_tc_0 + b_{t-1}c_1+\dots+b_0c_0$" - it is not clear where this is coming from and what this means. [Aside: Actually, I have been penalized several times for omitting much more obvious things in my proof. So, if Gallian wrote his proofs in an assignment or an exam in my university, he'd surely not get top marks].
I would appreciate your help in trying to figure out this stuff.

In fact he wants to say the smallest $t$ such that $p$ does not divide $b_t$ such a $t$ exists since $p$ does not divide $b_r$ So $p$ divides $b_{t-1},...,b_0$.
The expression of $a_t$ comes from the multiplication of $g$ and $h$, he writes the coefficient $t$ of $gh$ ,if you write $a_t=b_ta_0+b_{t-1}c_1+...+b_0a_t$, you have $p$ divides $b_{t-i}a_i, i=1,...,t$. Since $p$ divides $b_{t-i}$, you deduce that $p$ divides $b_ta_0$ since $p$ divides $a_t$. This is impossible since $p$ is a prime and $p$ does not divide neither $a_0$ nor $b_t$.