If $a,b$ are the roots of $x^2-px+q=0$ and $a',b'$ are the roots of $x^2-p'x+q'=0$, then find the value of $(a-a')^2+(b-b')^2+(a-b')^2+(b-a)^2$
MY WORK:

I tried using the sum of roots and product of roots rules - then I also tried to expand the expression and use the two sum of roots and product conditions but I couldn't do it. I also tried subtracting and adding the equations but it didn't work.
Your method has a few typos. First off, it should be $a'b'=q'$. Also, at the very last step, the expansion of the square of the second term should read:
$$(b-b')^2=b^2+b'^2\color{red}{-2bb'}$$
@egreg's answer is complete. But, I am leaving my answer open as it points out the mistakes in your attempt.