Question: A password is 8 characters long. Each character can contain 26 lower case or 26 uppercase letters or a integer from 0-9. What is the probability that an 8 character password contains exactly 1 OR 2 integers? 

Please explain as the book answer is P = .630 

Assuming that I could use (52^6\*10^2+52^7\*10)/62^8 was incorrect. This is the sum of the product between the possibilities of having one integer in the password and having two integers in the password; 62^8 is the total possibilities given each character can be a lower/uppercase or integer.

Answer: 
Yes, this can be expressed in the language of linear algebra, as you seem to desire. Namely, over any infinite field $\,F\,$ the polynomials $\,\{X^i\}\,$ are basis of the polynomial function ring $\,K[X],\,$ hence $\ c+ aX = \langle c,a,0,0\ldots\rangle = \langle d,b,0,0\ldots\rangle = d+b X\,$ iff they have the same coefficients, i.e. $\, c=d,\, a=b.\,$ 

Similarly $\,\sin(x),\, \cos(x)\,$ are a basis for the solution space of of $\,y'' + y = 0\,$ (they are linearly independent by the Wronskian criterion) so an analogous statement holds.

**Remark** $\ $ This can fail over *finite* fields, e.g. by little Fermat $\,X^p = X\,$ as *functions* on $\,\Bbb F\_p = \Bbb Z/p.\,$ However, it remains true for the ring of *formal* polynomials $\,R[x]\,$ (vs. polynomial *functions*), since, by definition, two *formal* polynomials are equal iff their corresponding coefficients are equal.
This is by definition: the polynomials $P(X)=\alpha\_pX^p+\alpha\_{p-1}X^{p-1}+\dots+\alpha\_0$ and $Q(X)=\beta\_qX^q+\beta\_{q-1}X^{q-1}+\dots+\beta\_0$ are equal *if and only if*
$$
p=q, \alpha\_0=\beta\_0, \alpha\_1=\beta\_1, \dots, \alpha\_p=\beta\_p.
$$
In the case of polynomials over an infinite field $F$, such as $\mathbb{R}$ or $\mathbb{C}$, this is equivalent to
$$
\text{for all $a\in F$},\quad P(a)=Q(a)
$$
because in this case $P(X)-Q(X)$ would have infinitely many roots, which cannot be for a non zero polynomial (the converse is obvious). However, since polynomials over finite fields are really useful, for instance in studying error correcting codes or cryptography on elliptic curves, the other definition is preferred.

To see why one shouldn't rely on the identification with polynomial functions, consider a finite field $F=\{a\_1,a\_2,\dots,a\_n\}$ and the polynomial
$$
P(X)=(X-a\_1)(X-a\_2)\dots(X-a\_n)
$$
which assumes the zero value for every element in $F$, but should definitely be considered non zero.

It's a different case for functions, where the definition is rightfully
$$
f=g\text{ if and only if }f(a)=g(a)\text{ for all $a$ in the common domain}.
$$
For the case of
$$
a\sin x+b\cos x=c\sin x+d\cos x
$$
just set $r=a-c$ and $s=b-d$, so you have to prove that, if
$$
r\sin x+s\cos x=0, \text{ for all $x\in\mathbb{R}$}
$$
then $r=0$ and $s=0$. Simply choose $x=0$ and $x=\pi/2$, which gives
$$
\begin{cases}
0=r\sin0+s\cos0=s,\\
0=r\sin(\pi/2)+s\cos(\pi/2)=r.
\end{cases}
$$