First, expand the squared term using this rule:
(color(red)(a) + color(blue)(b))^2 = color(red)(a)^2 + 2color(red)(a)color(blue)(b) + color(blue)(b)^2
Substituting color(red)(3x) for color(red)(a) and color(blue)(5) for color(blue)(b) gives:
f(x) = x(color(red)(3x) + color(blue)(5))^2
f(x) = x((color(red)(3x))^2 + (2 * color(red)(3x) * color(blue)(5)) + color(blue)(5)^2)
f(x) = x(9x^2 + 30x + 25)
Now, we can multiply the x by each term within the parenthesis:
f(x) = (x * 9x^2) + (x * 30x) + (x * 25)
f(x) = 9x^3 + 30x^2 + 25x