\(x-y+\sqrt{xy^2}-\sqrt{y^3}\)
\(=\left(x-y\right)+\left(y\sqrt{x}-y\sqrt{y}\right)\)
\(=\left(\sqrt{x}-\sqrt{y}\right)\left(\sqrt{x}+\sqrt{y}\right)+y\left(\sqrt{x}-\sqrt{y}\right)\)
\(=\left(\sqrt{x}-\sqrt{y}\right)\left(\sqrt{x}+\sqrt{y}+y\right)\)