Is total angular momentum or orbital angular momentum the generator of the rotation operator in quantum mechanics? Suppose that we have a wavefunction , $\psi(\textbf{r})$. An infinitesimal rotation will induce a change in the wavefunction
\begin{align*}
    \psi\rightarrow\psi'=\hat{U}_{\hat{\textbf{n}}}(\delta\theta)\psi(\textbf{r}')
\end{align*}
Where $\hat{U}_{\hat{\textbf{n}}}(\delta\theta)$ is an arbitrary rotation around axis $\hat{\textbf{n}}$ by infinitesimally small angle $\delta\theta$.
The transformation must maintain the wavefunction's value if  both the wavefunction and the position are transformed
\begin{align*}
    \psi'(\textbf{r}')=\psi(\textbf{r})
\end{align*}
Where $r'$ represents the transformed coordinates, $\textbf{r}'=R_{\hat{\textbf{n}}}(\theta)\textbf{r}\approx\textbf{r}-\delta\theta\hat{\textbf{n}}\times\textbf{r}$ for rotation matrix $R_{\hat{\textbf{n}}}(\theta)$. Therefore,
\begin{align*}
    \psi'(\textbf{r})&=\hat{U}_{\hat{\textbf{n}}}(\delta\theta)=\psi(R^{-1}_{\hat{\textbf{n}}}(\theta)\textbf{r})\\
    &\approx\psi(\textbf{r}-\delta\theta\hat{\textbf{n}}\times\textbf{r})\\
    &=\psi(\textbf{r})-\delta\theta(\hat{\textbf{n}}\times\hat{\textbf{R}})\cdot\nabla\psi(\textbf{r})+\mathcal{O}\left((\delta\theta)^{2}\right)\\
    &=\psi(\textbf{r})-\frac{i}{\hbar}\delta\theta(\hat{\textbf{n}}\times\hat{\textbf{R}})\cdot\hat{\textbf{P}}\psi(\textbf{r})+\mathcal{O}\left((\delta\theta)^{2}\right)\\
    &=\psi(\textbf{r})-\frac{i}{\hbar}\delta\theta\hat{\textbf{n}}\cdot(\hat{\textbf{R}}\times\hat{\textbf{P}})\psi(\textbf{r})+\mathcal{O}\left((\delta\theta)^{2}\right)\\
    &=(1-\frac{i}{\hbar}\delta\theta\hat{\textbf{n}}\cdot\hat{\textbf{L}})\psi(\textbf{r})+\mathcal{O}\left((\delta\theta)^{2}\right)
\end{align*}
Where $\hat{\textbf{R}}=(\hat{X},\hat{Y},\hat{Z})$ is the vector containing the position operators and
\begin{align*}
    \hat{\textbf{L}}=\hat{\textbf{R}}\times\hat{\textbf{P}}
\end{align*}
Is the (oribtal) angular momentum operator. Therefore, in the limit as $\delta\theta\rightarrow0$
\begin{align*}
    \hat{U}_{\hat{\textbf{n}}}(\delta\theta)=(\mathbb{1}-\frac{i}{\hbar}\delta\theta\hat{\textbf{n}}\cdot\hat{\textbf{L}})
\end{align*}
which can be exponentiated after using the composition property to obtain
\begin{align*}
    \hat{U}_{\hat{\textbf{n}}}(\theta)=\exp\left(-\frac{i}{\hbar}\theta\hat{\textbf{n}}\cdot\hat{\textbf{L}}\right)
\end{align*}
This suggests that the orbital angular momentum operator is the generator of the rotation operator, however in Sakurai they seem to insert the total angular momentum,
\begin{align*}
    \hat{J}=\hat{L}+\hat{S}
\end{align*}
for spin angular momentum $\hat{S}$ into the rotation operator. I can't see what I've missed out in my derivation. So my question is, total angular momentum or orbital angular momentum the generator of the rotation operator in quantum mechanics? And  total angular momentum is in fact the generator (as I expect it will be) what have I missed in my derivation?
 A: You miss the spin part, so it is correct that you do not derive $\hat{S}$ in the full angular momentum operator.
As we know spin is a basic property of particles, and a particle with spin $l$ ($l$ is a half-integer or an integer) needs $2l+1$ components to describe its wavefunction fully. Consider an electron, whose spin is ${1 \over 2}$, and it needs two functions, $\psi_{{1 \over 2}}(r)$ and $\psi_{-{1 \over 2}}(r)$, to correspondingly describe its spin-up and spin-down part. The whole wavefunction is the superposition of two, $\psi_{{1 \over 2}}(r)+\psi_{-{1 \over 2}}(r)$.
Now consider some rotation operator $\hat{U}_{\hat{n}}(\phi)$. Consider a particle with spin $l$ and one of its component $\psi_{m}(r)$ where $m \in \{l,l-1,l-2,\cdots,-l\}$, under the action of $\hat{U}(\phi)$, it transforms by the equation
$$\hat{U}_{\hat{n}}(\phi)\psi_{m}(r) = \sum_{m'}{D^{(l)}_{mm'}(\hat{n},\phi)\psi_{m'}\big((R(\hat{n},\phi))^{-1}r\big)}$$
where $D^{(l)}$ is the $2l+1$ irreducible representation of $\text{SU}(2)$ and $R \in \text{SO}(3)$ is the $3$-dimensional rotation. If you expand the equation with $\phi$ around $0$, you will get the full angular momentum operator $\hat{J}=\hat{L}+\hat{S}$ since the components of $\hat{S}$ after the multiplication of $i$ are the generators of the representation $D^{(l)}$ (the Lie algebra of $D^{(l)}$ is anti-Hermitian and $\hat{S}$ is Hermitian, and they differ by a factor of $i$). As a special case, when $l=0$, we have $\hat{J}=\hat{L}$, which is your result.
