Expanding the product of two trinomials like these involves the repeated application of the distributive property which, as you might remember, states in its simplest form that, given three real numbers #a#, #b#, and #c#, #a(b+c)=ab+ac#. This extends beyond two-number groupings, though. We could have just as easily selected a fourth real number, #d#, and #a(b+c+d)=ab+ac+ad# would be an equally valid statement.
Here, we can treat the trinomial #2a^2+4a+1# as the #a# term, and the terms #a^2#, #-6a#, and #5# from the second trinomial as the #b#, #c#, and #d# terms. When we distribute that first trinomial across those three terms, we get:
#(2a^2+4a+1)a^2+(2a^2+4a+1)(-6a)+(2a^2+4a+1)5#
Here, we can distribute again to obtain
#2a^2(a^2)+4a(a^2)+a^2+2a^2(-6a)+4a(-6a)-6a+2a^2(5)+4a(5)+5=#
#=2a^4+4a^3+a^2-12a^3-24a^2-6a+10a^2+20a+5#
Collecting and grouping like terms:
#color(indigo)(2a^4)color(tomato)(+4a^3)color(dodgerblue)(+a^2)color(tomato)(-12a^3)color(dodgerblue)(-24a^2)color(forestgreen)(-6a)color(dodgerblue)(+10a^2)color(forestgreen)(+20a)color(sandybrown)(+5)#
#color(indigo)(2a^4)color(tomato)(+4a^3)color(tomato)(-12a^3)color(dodgerblue)(+a^2)color(dodgerblue)(-24a^2)color(dodgerblue)(+10a^2)color(forestgreen)(-6a)color(forestgreen)color(forestgreen)(+20a)color(sandybrown)(+5)#
And finally, simplifying:
#2a^4-8a^3-13a^2+14a+5#