I'll use an online LaTeX interpreter/parser o algo (use a non-dark theme to actually see the mostly transparent images I sent ITP).
We start with these 2 equations:
View attachment 87137
The first equation is our 'divisible by $x^{3}$' statement and the second equation is our 'divisible by (x+1)^{3} after adding 3' statement.
Let's rewrite $y(x)$ and $g(x)$ into something more comprehensible (WOAHJAKS) and bring it to its logical conclusion.
View attachment 87144
The degree of $f(x)$ is $5$ and is divisible by $x^{3}$, therefore $f(x)$ must NOT have a constant, linear or quadratic term, thus making the equation look something like the above.
Unfortunately, it gets quite messy after this, bear with me thoughbeit.
We substitute $f(x)$ for its first equation into the second. We expand both equations and try to get the coefficients to equate to one another.
View attachment 87348
Therefore, $f(x)=18x^{2}+45x+30$
Okay, I gotta bounce, see you in an hour or 2.