Explanation:
I hope you wrote the equation correctly.
there could be parts missing. and exponents be wrong.
I am concerned, because the missing parts are not just numbers. they are full terms in the variable p.
so, well, the right side is
p³ - 2p + 3p = p³ + p
on the left side we have
a(p² -2) - p(2p³ - b)
ap² - 2a - 2p⁴ - pb
so, the first thing we see : we need to eliminate the p⁴ terms, because there are none on the right side.
so,
a = 2p²
that gives us
2p⁴ - 4p² - 2p⁴ - pb = -4p² - pb
let's see, if we can create the missing items just by "b" (and we have to get rid of -4p²) when we bring left and right sides together again :
-4p² - pb = p³ + p
p³ + p + 4p² = -pb
b = (p³ + p + 4p²)/-p = -p² - 1 - 4p
so,
the equation would look like
2p²(p² - 2) - p(2p³ - (-p² - 1 - 4p)) = p(p² - 2) + 3p
which could be also written as
2p²(p² - 2) - p(2p³ + p² + 1 + 4p) = p(p² - 2) + 3p