It is clear that we may assume replace $R$ by $R/IJ$ and $K$ by $K \otimes_R^\mathbf{L} R/IJ$. Then $R \to R/(I \cap J)$ is a surjection whose kernel has square zero. Hence by Lemma \ref{lemma-perfect-modulo-nilpotent-ideal} it suffices to prove that $K \otimes_R^\mathbf{L} R/(I \cap J)$ is perfect. Thus we may assume that $I \cap J = 0$. \medskip\noindent We prove the lemma in case $I \cap J = 0$. First, we may represent $K$ by a K-flat complex $K^\bullet$ with all $K^n$ flat, see Lemma \ref{lemma-K-flat-resolution}. Then we see that we have a short exact sequence of complexes $$ 0 \to K^\bullet \to K^\bullet/IK^\bullet \oplus K^\bullet/JK^\bullet \to K^\bullet/(I + J)K^\bullet \to 0 $$ Note that $K^\bullet/IK^\bullet$ represents $K \otimes^\mathbf{L}_R R/I$ by construction of the derived tensor product. Similarly for $K^\bullet/JK^\bullet$ and $K^\bullet/(I + J)K^\bullet$. Note that $K^\bullet/(I + J)K^\bullet$ is a perfect complex of $R/(I + J)$-modules, see Lemma \ref{lemma-pull-perfect}. Hence the complexes $K^\bullet/IK^\bullet$, and $K^\bullet/JK^\bullet$ and $K^\bullet/(I + J)K^\bullet$ have finitely many nonzero cohomology groups (since a perfect complex has finite Tor-amplitude, see Lemma \ref{lemma-perfect}). We conclude that $K \in D^b(R)$ by the long exact cohomology sequence associated to short exact sequence of complexes displayed above. In particular we assume $K^\bullet$ is a bounded above complex of free $R$-modules (see Derived Categories, Lemma \ref{derived-lemma-subcategory-left-resolution}). \medskip\noindent We will now show that $K$ is perfect using the criterion of Proposition \ref{proposition-perfect-is-compact}. Thus we let $E_j \in D(R)$ be a family of objects parametrized by a set $J$. We choose complexes $E_j^\bullet$ with flat terms representing $E_j$, see for example Lemma \ref{lemma-K-flat-resolution}. It is clear that $$ 0 \to E_j^\bullet \to E_j^\bullet/IE_j^\bullet \oplus E_j^\bullet/JE_j^\bullet \to E_j^\bullet/(I + J)E_j^\bullet \to 0 $$ is a short exact sequence of complexes. Taking direct sums we obtain a similar short exact sequence $$ 0 \to \bigoplus E_j^\bullet \to \bigoplus E_j^\bullet/IE_j^\bullet \oplus E_j^\bullet/JE_j^\bullet \to \bigoplus E_j^\bullet/(I + J)E_j^\bullet \to 0 $$ (Note that $- \otimes_R R/I$ commutes with direct sums.) This short exact sequence determines a distinguished triangle in $D(R)$, see Derived Categories, Lemma \ref{derived-lemma-derived-canonical-delta-functor}. Apply the homological functor $\Hom_{D(R)}(K, -)$ (see Derived Categories, Lemma \ref{derived-lemma-representable-homological}) to get a commutative diagram $$ \xymatrix{ \bigoplus \Hom_{D(R)}(K^\bullet, E_j^\bullet/(I + J))[-1] \ar[r] \ar[d] & \Hom_{D(R)}(K^\bullet, \bigoplus E_j^\bullet/(I + J))[-1] \ar[d] \\ \bigoplus \Hom_{D(R)}(K^\bullet, E_j^\bullet/I \oplus E_j^\bullet/J)[-1] \ar[r] \ar[d] & \Hom_{D(R)}(K^\bullet, \bigoplus E_j^\bullet/I \oplus E_j^\bullet/J)[-1] \ar[d] \\ \bigoplus \Hom_{D(R)}(K^\bullet, E_j^\bullet) \ar[r] \ar[d] & \Hom_{D(R)}(K^\bullet, \bigoplus E_j^\bullet) \ar[d] \\ \bigoplus \Hom_{D(R)}(K^\bullet, E_j^\bullet/I \oplus E_j^\bullet/J) \ar[r] \ar[d] & \Hom_{D(R)}(K^\bullet, \bigoplus E_j^\bullet/I \oplus E_j^\bullet/J) \ar[d] \\ \bigoplus \Hom_{D(R)}(K^\bullet, E_j^\bullet/(I + J)) \ar[r] & \Hom_{D(R)}(K^\bullet, \bigoplus E_j^\bullet/(I + J)) } $$ with exact columns. It is clear that, for any complex $E^\bullet$ of $R$-modules we have \begin{align*} \Hom_{D(R)}(K^\bullet, E^\bullet/I) & = \Hom_{K(R)}(K^\bullet, E^\bullet/I) \\ & = \Hom_{K(R/I)}(K^\bullet/IK^\bullet, E^\bullet/I) \\ & = \Hom_{D(R/I)}(K^\bullet/IK^\bullet, E^\bullet/I) \end{align*} and similarly for when dividing by $J$ or $I + J$, see Derived Categories, Lemma \ref{derived-lemma-morphisms-from-projective-complex}. Derived Categories. Thus all the horizontal arrows, except for possibly the middle one, are isomorphisms as the complexes $K^\bullet/IK^\bullet$, $K^\bullet/JK^\bullet$, $K^\bullet/(I + J)K^\bullet$ are perfect complexes of $R/I$, $R/J$, $R/(I + J)$-modules, see Proposition \ref{proposition-perfect-is-compact}. It follows from the $5$-lemma (Homology, Lemma \ref{homology-lemma-five-lemma}) that the middle map is an isomorphism and the lemma follows by Proposition \ref{proposition-perfect-is-compact}.