If a= 2 that is a quadratic equation in y and you can use the quadratic formula. If a= 3 or 4, it is a cubic or quartic equation, respectively, and there are formulas for solving for y (butmuchmore complicated than the quadratic equation!). If a= 1/2, you can let z= y^(1/2) then you get z^2= P- Ax+ Bx^2 z, a quadratic equation in z. You can use the quadratic formula to solve for z and then take the square root find y. If a= 1/3 or 1/4, similarly, let z= y^(1/3) or z= y^(1/4) respectively to get polynomial equations that can be solved for z.

If a not one of those numbers, there are no general formulas for solving such an equation.