Consider the function $Z(x) = z(x,y(x))$, where
$$z(x,y) = 2x^2y \quad \text{and} \quad y(x) = e^{3x^2}.$$
Determine $Z'(x)$.

According to the chain rule (case 2)
$$Z'(x) = z'_x(x,y(x)) + z'_y(x,y(x))y'(x).$$
Hence, we need the partial derivatives of $z(x,y)$ at $(x,y(x))$ and the derivative of $y(x)$:
$$
\begin{align}
z'_x(x,y) &= 2y \cdot 2x = 4xy\\
z'_x(x,y(x)) &= 4x \cdot e^{3x^2} = 4xe^{3x^2}\\[2mm]
z'_y(x,y) &= 2x^2 \cdot 1 = 2x^2\\
z'_y(x,y(x)) &= 2x^2\\[2mm]
y'(x) &= e^{3x^2} \cdot (3 \cdot 2x) = 6xe^{3x^2}.
\end{align}
$$
Now we find $Z'(x)$ by plugging in the prescriptions of $z'_x(x,y(x))$, $z'_y(x,y(x))$ and $y'(x)$:
$$
Z'(x) = 4xe^{3x^2} + 2x^2 \cdot 6xe^{3x^2} = 4xe^{3x^2} + 12x^3e^{3x^2}.
$$