Minor point: there is a sign error in $T_n$. The exponential terms in the solution of heat equation should decay, not blow up (apart from some weird cases considered in section 4.3).
Main point: we need homogeneous boundary conditions for the separation of variables to work. Indeed, a basic idea of the method is that functions satisfying boundary conditions form a linear space, for which we find a convenient basis (i.e., eigenfunctions of the operator $d^2/dx^2$). The functions satisfying an inhomogeneous boundary condition, such as $u(1,t)=1$, do not form a linear space.
What to do: make it homogeneous. Introduce $v(x,t)= u(x,t) -1$, which satisfies the same PDE with
$$v_t = v_{xx}, v_x {(0,t)}=0 , v(1,t) =0 , v(x,0) = x^2-1$$
Then proceed as you were, except that
$$A_n = \{x^2-1, \cos ( (n + 1/2)\pi x )\}$$
To minimize writing, set $\omega=\pi(n+1/2)$ and integrate the product of $x^2-1$ with $\cos( \omega x)$ using the tabular method:
$$\begin{array}{| c | c |} \hline x^2-1 & \cos \omega x \\ \hline 2x & \omega^{-1} \sin \omega x \\ \hline 2 & -\omega^{-2} \cos \omega x \\ \hline 0 & -\omega^{-3} \sin \omega x \\ \hline\end{array}$$
$$\int x^2 \cos \omega x\,dx = (x^2-1) (\omega^{-1} \sin \omega x) - 2x (-\omega^{-2} \cos \omega x) + 2 (-\omega^{-3} \sin \omega x) +C $$
Plugging the limits, you get $$ 2 \omega^{-2} \cos \omega - 2 \omega^{-3} \sin \omega $$ Since the cosine vanishes at half-integer multiples of $\pi$, the only thing that remains is $- 2 \omega^{-3} \sin \omega$.
You already know how to solve the equation with null boundary condition. Let $u=v+\phi$, where you chose $\phi$ in such a way that $v$ satisfies the same equation and $v(0,t)=0$. Then solve for $v$. There is a very simple choice for $\phi$.
Best Answer
It seems that he is only claiming here that $u$ is a solution of (1), (2). He does not prove uniqueness in the book, and it should probably be understood that a uniqueness result (with some qualifier) must be supplied by external sources (As a commenter said, there is no uniqueness without qualifiers). Keep in mind that this is not meant to be a rigorous graduate text, and at times you encounter something like this in the book.