2 deleted 523 characters in body edited Feb 11 '15 at 22:23 kglr 218k1010 gold badges248248 silver badges499499 bronze badges mysum = a c^2 Cos[2 t ω] (Quantity[-(1/2), "ElectricConstant"]) + a b c Cos[t ω] (Quantity[-I, "ElectricConstant"]) + a b c Cos[t ω] (Quantity[I, "ElectricConstant"]) + a c^2 (Quantity[1/2, "ElectricConstant"]) + a b^2 (Quantity[1, "ElectricConstant"]) + a b c (Quantity[2, "ElectricConstant"]) Sin[t ω] + a c^2 (Quantity[-(I/4), "ElectricConstant"]) Sin[2 t ω] + a c^2 (Quantity[I/4, "ElectricConstant"]) Sin[2 t ω]; DeleteCases[mysum, x_ /; Not[FreeQ[x, t]]]  or DeleteCases[mysum, Except[_?(FreeQ[#, t] &)]]  both give (* a c^2 (Quantity[1/2, "ElectricConstant"]) + a b^2 (Quantity[1, "ElectricConstant"]) *)  mysum = a c^2 Cos[2 t ω] (Quantity[-(1/2), "ElectricConstant"]) + a b c Cos[t ω] (Quantity[-I, "ElectricConstant"]) + a b c Cos[t ω] (Quantity[I, "ElectricConstant"]) + a c^2 (Quantity[1/2, "ElectricConstant"]) + a b^2 (Quantity[1, "ElectricConstant"]) + a b c (Quantity[2, "ElectricConstant"]) Sin[t ω] + a c^2 (Quantity[-(I/4), "ElectricConstant"]) Sin[2 t ω] + a c^2 (Quantity[I/4, "ElectricConstant"]) Sin[2 t ω]; DeleteCases[mysum, x_ /; Not[FreeQ[x, t]]]  or DeleteCases[mysum, Except[_?(FreeQ[#, t] &)]]  both give (* a c^2 (Quantity[1/2, "ElectricConstant"]) + a b^2 (Quantity[1, "ElectricConstant"]) *)  DeleteCases[mysum, x_ /; Not[FreeQ[x, t]]]  or DeleteCases[mysum, Except[_?(FreeQ[#, t] &)]]  both give (* a c^2 (Quantity[1/2, "ElectricConstant"]) + a b^2 (Quantity[1, "ElectricConstant"]) *)  1 answered Feb 11 '15 at 22:10 kglr 218k1010 gold badges248248 silver badges499499 bronze badges mysum = a c^2 Cos[2 t ω] (Quantity[-(1/2), "ElectricConstant"]) + a b c Cos[t ω] (Quantity[-I, "ElectricConstant"]) + a b c Cos[t ω] (Quantity[I, "ElectricConstant"]) + a c^2 (Quantity[1/2, "ElectricConstant"]) + a b^2 (Quantity[1, "ElectricConstant"]) + a b c (Quantity[2, "ElectricConstant"]) Sin[t ω] + a c^2 (Quantity[-(I/4), "ElectricConstant"]) Sin[2 t ω] + a c^2 (Quantity[I/4, "ElectricConstant"]) Sin[2 t ω]; DeleteCases[mysum, x_ /; Not[FreeQ[x, t]]]  or DeleteCases[mysum, Except[_?(FreeQ[#, t] &)]]  both give (* a c^2 (Quantity[1/2, "ElectricConstant"]) + a b^2 (Quantity[1, "ElectricConstant"]) *)