Lemma 36.5.3. Let $f : X \to S$ be an affine morphism of schemes. For $E$ in $D_\mathit{QCoh}(\mathcal{O}_ S)$ we have $Rf_* Lf^* E = E \otimes ^\mathbf {L}_{\mathcal{O}_ S} f_*\mathcal{O}_ X$.

Proof. Since $f$ is affine the map $f_*\mathcal{O}_ X \to Rf_*\mathcal{O}_ X$ is an isomorphism (Cohomology of Schemes, Lemma 30.2.3). There is a canonical map $E \otimes ^\mathbf {L} f_*\mathcal{O}_ X = E \otimes ^\mathbf {L} Rf_*\mathcal{O}_ X \to Rf_* Lf^* E$ adjoint to the map

$Lf^*(E \otimes ^\mathbf {L} Rf_*\mathcal{O}_ X) = Lf^*E \otimes ^\mathbf {L} Lf^*Rf_*\mathcal{O}_ X \longrightarrow Lf^* E \otimes ^\mathbf {L} \mathcal{O}_ X = Lf^* E$

coming from $1 : Lf^*E \to Lf^*E$ and the canonical map $Lf^*Rf_*\mathcal{O}_ X \to \mathcal{O}_ X$. To check the map so constructed is an isomorphism we may work locally on $S$. Hence we may assume $S$ and therefore $X$ is affine. In this case the statement is clear from the description of the derived categories $D_\mathit{QCoh}(\mathcal{O}_ X)$ and $D_\mathit{QCoh}(\mathcal{O}_ S)$ and the functor $Lf^*$ given in Lemmas 36.3.5 and 36.3.8. Some details omitted. $\square$

In your comment you can use Markdown and LaTeX style mathematics (enclose it like $\pi$). A preview option is available if you wish to see how it works out (just click on the eye in the toolbar).