I am trying work with a general operator z[] and later plug in candidate forms for z[]. But pattern matching turns the inside z[] into a constant and can no longer perform operations on it:
r = z[(x + 2)^2];
r /. z[a_] -> Expand[a]
r /. z[a_] -> Integrate[a, {x, 0, 10}]
Results in:
(* (2 + x)^2 *)
(* 10 (2 + x)^2 *)
I would like it to return:
4 + 4x + x^2
1720/3
What's going wrong here?
Rule
(->
) toRuleDelayed
(:>
). $\endgroup$