For part (a), you have
\(\dfrac x{x^2+x-6}=\dfrac x{(x+3)(x-2)}=\dfrac a{x+3}+\dfrac b{x-2}\)
\(x=a(x-2)+b(x+3)\)
If \(x=2\), then \(2=b(2-3)\implies b=-2\).
If \(x=-3\), then \(-3=a(-3-2)\implies a=\dfrac35\).
So,
\(\dfrac x{x^2+x-6}=\dfrac 3{5(x+3)}-\dfrac 2{x-2}\)
For part (b), since the degrees of the numerator and denominator are the same, you first need to find the quotient and remainder upon division.
\(\dfrac{x^2}{x^2+x+2}=\dfrac{x^2+x+2-x-2}{x^2+x+2}=1-\dfrac{x+2}{x^2+x+2}\)
In the remainder term, the denominator \(x^2+x+2\) can't be factorized into linear components with real coefficients, since the discriminant is negative \((1-4\times1\times2=-7)\). However, you can still factorized over the complex numbers, so a partial fraction decomposition in terms of complexes does exist.
\(x^2+x+2=0\implies x=-\dfrac12\pm\dfrac{\sqrt7}2i\)
\(\implies x^2+x+2=\left(x-\left(-\dfrac12+\dfrac{\sqrt7}2i\right)\right)\left(x-\left(-\dfrac12-\dfrac{\sqrt7}2i\right)\right)\)
\(\implies x^2+x+2=\left(x+\dfrac12-\dfrac{\sqrt7}2i\right)\left(x+\dfrac12+\dfrac{\sqrt7}2i\right)\)
Then you have
\(\dfrac{x+2}{x^2+x+2}=\dfrac a{x+\dfrac12-\dfrac{\sqrt7}2i}+\dfrac b{x+\dfrac12+\dfrac{\sqrt7}2i}\)
\(x+2=a\left(x+\dfrac12+\dfrac{\sqrt7}2i\right)+b\left(x+\dfrac12-\dfrac{\sqrt7}2i\right)\)
When \(x=-\dfrac12-\dfrac{\sqrt7}2i\), you have
\(-\dfrac12-\dfrac{\sqrt7}2i+2=b\left(-\dfrac12-\dfrac{\sqrt7}2i+\dfrac12-\dfrac{\sqrt7}2i\right)\)
\(\dfrac32-\dfrac{\sqrt7}2i=-\sqrt7ib\)
\(b=\dfrac12+\dfrac3{2\sqrt7}i=\dfrac1{14}(7+3\sqrt7i)\)
When \(x=-\dfrac12+\dfrac{\sqrt7}2i\), you have
\(-\dfrac12+\dfrac{\sqrt7}2i+2=a\left(-\dfrac12+\dfrac{\sqrt7}2i+\dfrac12+\dfrac{\sqrt7}2i\right)\)
\(\dfrac32+\dfrac{\sqrt7}2i=\sqrt7ia\)
\(a=\dfrac12-\dfrac3{2\sqrt7}i=\dfrac1{14}(7-3\sqrt7i)\)
So, you could write
\(\dfrac{x^2}{x^2+x+2}=1-\dfrac{x+2}{x^2+x+2}=1-\dfrac {7-3\sqrt7i}{14\left(x+\dfrac12-\dfrac{\sqrt7}2i\right)}-\dfrac {7+3\sqrt7i}{14\left(x+\dfrac12+\dfrac{\sqrt7}2i\right)}\)
but that may or may not be considered acceptable by that webpage.