Answer
$x=\dfrac{a^{2}+b^{2}}{b-a}$
Work Step by Step
$ax+b^{2}=bx-a^{2}$
Take $bx$ to the left side and $b^{2}$ to the right side:
$ax-bx=-a^{2}-b^{2}$
Take out common factor $x$ from the left side and common factor $-1$ from the right side:
$x(a-b)=-(a^{2}+b^{2})$
Take $a-b$ to divide the right side:
$x=-\dfrac{a^{2}+b^{2}}{a-b}$
$x=\dfrac{a^{2}+b^{2}}{b-a}$