\(a,\dfrac{a^2-2a-8}{a^2+2a}=\dfrac{a^2+2a-4a-8}{a\left(a+2\right)}=\dfrac{a\left(a+2\right)-4\left(a+2\right)}{a\left(a+2\right)}=\dfrac{\left(a-4\right)\left(a+2\right)}{a\left(a+2\right)}=\dfrac{a-4}{a}\)
\(b,\dfrac{2x^2-4x+2}{\left(x-1\right)^2}=\dfrac{2\left(x^2-2x+1\right)}{\left(x-1\right)^2}=\dfrac{2\left(x-1\right)^2}{\left(x-1\right)^2}=2\)