Proof that a category is cartesian closed
Solution 1:
The point is that when you map $H_D \times P$ to $H_C \times P$ via $Hf$, $\operatorname{1_D}$ goes to $f$ and $z$ is left intact.
What you know is that $\alpha: R\xrightarrow{} Q^P$ will be a natural transformation, so for $f: D \to C$ this has to commute: $\require{AMScd}$ \begin{CD} R(C) @>{\alpha_C}>> \{H_C \times P \to Q\} \\ @VRfVV @VVprecomposition \>with\> Hf \times idV \\ R(D) @>{\alpha_D}>> \{H_D \times P \to Q\}. \end{CD}
This means that this commutes: \begin{CD} H_D \times P @>{\alpha_D(Rf(x))}>> Q \\ @VHf \times idVV @VV=V \\ H_C \times P @>{\alpha_C(x)}>> Q. \end{CD}
In particular, plugging in $(\operatorname{1_D}, z) \in H_D(D) \times P(D)$ gives $\alpha_C(x)(f,z) = \alpha_D(Rf(x))((\operatorname{1_D}, z)) = \phi(Rf(x),z)$.