I have a sum of terms where each is a multiplication of several factors. For example my expression in FullForm
is
expr = Plus[Times[Derivative[1][a][x], Derivative[0, 1][z][t, x]],
Times[R, z[t, x], Derivative[1][a][x], Derivative[0, 1][\[Sigma]][t, x]],
Times[2, R, a[x], Derivative[0, 1][z][t, x], Derivative[0, 1][\[Sigma]][t, x]],
Times[Power[R, 2], a[x], z[t, x], Power[Derivative[0, 1][\[Sigma]][t, x], 2]],
Times[a[x], Derivative[0, 2][z][t, x]], Times[R, a[x], z[t, x], Derivative[0, 2][\[Sigma]][t, x]], Derivative[1, 0][z][t, x],
Times[R, z[t, x], Derivative[1, 0][\[Sigma]][t, x]]]
I want to know if in any of the terms I have a multiplication of the form
Times[z[t, x],Derivative[1][a][x]]
and replace it with another expression in that case.
I am stuck even trying to find my particular multiplication. I have tried with
Cases[expr, Times[z[t, x],Derivative[1][a][x]],\[Infinite]]
But since the exact expression I am looking for does not appear in the full form I only get
out = {}
As a start I would be happy if I could only find if my desired factor appears in any term. Then once I can do that it would be even better to replace it, but let us go one step at a time.