a = Product[((((x + k)*(x - k)))^k), {k, 1, 5, 2}]

a = Expand[a]

b = FactorSquareFree[a]

c = b /.  {3 -> 1, 5 -> 1}

Expand[c]

Together[(a/PolynomialGCD)[a, D[a, x]]]