Recall that a square is just a rectangle with all sides equal.
and the area of a rectangle is just length * width.
Assuming your solving for y:
py+7=6y+q
-6y -7 -6y -7
(p-6)y = q-7
divide both sides by p-6
y=(q-7)/(p-6)
-x^3 + x^2/3 + 5 - 13/x
I don't know if this is correct