Consider the following expression:
expr = a[x]*da[x,t]*db[x,t]c[x] + db[x,z]^2*a[x]^2*d[x] +d[x]^2*da[x,t]db[x,t]+ dc[x,z]^2 + c[x]*dc[x,z]^2*db[x,t]^6
Is there any way in Mathematica to leave only the terms with the total power of objects #[x] and d#[x,#] being $\leq 4$? The final expression should be
exprfinal = a[x]*da[x,t]*db[x,t]c[x] + d[x]^2*da[x,t]db[x,t] + dc[x,z]^2
Normal@Series[expr /. {factor : _[x] | _[x, t] | _[x, z] :> factor*$T}, {$T, 0, 4}] /. $T -> 1? – Michael E2 Aug 05 '23 at 13:18