Let the given two numbers be $x$ and $y$. Then,
\[x\text{ }+\text{ }y\text{ }=\text{ }15\text{ }\ldots ..\text{ }\left( 1 \right)\]
\[y\text{ }=\text{ }\left( 15\text{ }-\text{ }x \right)\]
Now we have, \[z\text{ }=\text{ }{{x}^{2}}~{{y}^{3}}\]
\[z\text{ }=\text{ }{{x}^{2}}~{{\left( 15\text{ }-\text{ }x \right)}^{3}}~\left( from\text{ }equation\text{ }1 \right)\]