Although, this question has already been partly answered by VillasV, I will clarify some things and give a more satisfactory result. First of all, if you are given any equation involving a single instance function, $f$, the way to solve for $f$ is to solve for it like it is a variable. Additionally, the right side of the expression should be in terms of $f$'s parameters and possibly some constants. Solving for $\delta$ in the equation you give results in $$\delta(x,e)=\frac{x^3-\hat{x}^3}{e},$$
as VillasV pointed out. However, this can be simplified by factoring $x^3-\hat{x}^3$ into $(x-\hat{x})(x^2+x\hat{x}+x^2)$ using difference of cubes and cancel out the common factor of $x-\hat{x}$ to get $\delta (x,e) = -x^2-x\hat{x}-\hat{x}^2$. Additionally, we need to rewrite this expression since $\hat{x}$ is neither a constant nor a parameter of $\delta$. We do this by substituting: $\hat{x}=e+x$ to get: $$\delta(x,e) = -x^2-x(e+x)-(e+x)^2 = -x^2-ex-x^2-e^2-2ex-x^2=-(3x^2+3ex+e^2),$$ so the answer is $$\delta(e,x)=-(3x^2+3ex+e^2)$$