Expand and collect like terms:
Recognise the nested (Horner) shape. Each half has the form , which is a quadratic written to minimise multiplications: the first with , the second with . Unfolding one layer at a time is safer than expanding everything at once.
Unfold each half into a quadratic in its own variable.
so the numerator is .
Expand the square and the linear bracket. Using :
Every term of the bracket gets the coefficient, including the middle term that is easiest to lose.
Collect like terms across the two halves. Only the and the terms can merge:
The numerator becomes
Divide term by term if a fully split form is wanted. With ,
Only the terms containing simplify; the and terms keep an in the denominator, so this form is not a polynomial.
Check with numbers. Take . Original numerator: . Collected form: ✓. Dividing by gives either way.
Need to solve a different problem like this? Open the solver →