Suppose I have terms which are symbolic derivatives of an undefined function:
f'[x]
(* Derivative[1][f][x] *)
If I later find out that this function can be described better by another function such as:
$$ f(x) = x^4 F(x) $$
I would want to be able to make the following substitution (left abstracted in case there were more terms):
func[x] = x^4 F[x]^4
f'[x] /. Derivative[a_][f][x] -> D[func[x], {x, a}]
(*
Inactive[Sum][x^(4 - K[1])*Binomial[1, K[1]]*
D[F[x]^4, {x, 1 - K[1]}]*FactorialPower[4, K[1]],
{K[1], 0, 1}]
*)
but we see that this gives a very strange term that includes a summation over a variable $K(1)$. This feels like a very strange behaviour that I can't make sense of expecially considering the following behaviour:
D[func[x], {x, 1}]
(* 4 x^3 F[x]^4 + 4 x^4 F[x]^3 Derivative[1][F][x] *)
Any advice on this would be appreciated.
f'[x] /. f -> Function[#^4 F[#]^4]
$\endgroup$