Expanding a ket in the position basis? My textbook says that to find the ket $|ψ\rangle$ in the same position basis as the ket $|ø\rangle$ we do the following: $$|ψ\rangle=\int dø|ø\rangle \langle ø|ψ\rangle$$ Firstly can $|ø\rangle$ be any ket? i.e. this expression just puts $|ψ\rangle$ in the same basis as $|ø\rangle$ regardless of the components of $|ø\rangle$?
Secondly my textbook goes on to say to place $|ψ\rangle$ in the position basis we do the following:  $$|ψ\rangle=\int d^3r\ |\mathbf{r}\rangle\langle \mathbf{r}|ψ\rangle$$
Why have we suddenly gained a cubed sign? 
Are we taking the integral over nothing? i.e. are the integrals we are doing simply $\int dø$ and $\int d^3r$?
(I am new to this sort of physics/maths and am self teaching so please can you keep the explanations relativity simple) thanks
 A: So first of all, the first equation you gave is only correct, if the $|ø\rangle$ form a basis. It has nothing to do with "in which basis they are".
The easiest way to understand this is probably with a 3D vector-analogy. So if $b_i$, $i=1\dots3$ form a basis, for any vector $v$ it is legitimate to write $$v=\sum_{i=1}^3 b_i (b_i\cdot v)$$
There, the $b_i\cdot v$ are the components of $v$ in the representation of the $b_i$.
It is the very same for bras and kets. It is "just" not 3d but has infinite dimension, so if we have a basis of infinite $|ø\rangle$, $ø\in \mathbb{R}$ or $|r\rangle$, $r\in \mathbb{R}^3$, denote the scalar product ($a\cdot b$) using dirac notatiton ($\langle a|b\rangle$), and write integrals instead of sums we get te formulas given by you (mathematically this is non trivial). Therefor the $\langle r|\psi\rangle$ are the components in the position basis.
A: Regarding the first part of your question,they have just inserted a complete set of basis because $|\phi>$ is a basis in some infinite dimensional Hilbert space (in your case), therefore sum (integral) of all such bases is identity on the Hilbert space. Note that in second part 
$\langle r|\phi\rangle$=$\phi(r)$. 
