# Replacing derivative of a function

I want to replace the time derivative (only time derivative part) of a function with another function. If the term has also a derivative with x (space), how can I do it? I tried the following but that results in Binomial function:

If I have:

{Derivative[0, 1][u][x, t] -> (\[Lambda]*(3*u[x, t]^2*Derivative[1, 0][u][x, t]^2 + u[x, t]^3*Derivative[2, 0][u][x, t]))/3}


All what I want is to take the nx- derivative of the right hand side of the rule, I tried the following but it resulted in Binomial function:

   repRule={Derivative[nx_, 1][u][x, t] -> D[(\[Lambda]*(3*u[x, t]^2*Derivative[1, 0][u][x, t]^2 + u[x, t]^3*Derivative[2, 0][u][x, t]))/3, {x, nx}]}


And when I apply it to a simple expression like:

ss=\!$$\*SuperscriptBox[\(u$$,
TagBox[
RowBox[{"(",
RowBox[{"1", ",", "1"}], ")"}],
Derivative],
MultilineFunction->None]\)[x, t]


I get from ss/.repRule:

     (\[Lambda]*(3*Inactive[Sum][Binomial[1, K]*D[Derivative[1, 0][u][x, t]^2, {x, 1 -       K}]*Inactive[Sum][u[x, t]*Derivative[K, 0][u][x, t], {K, 0, K}],
{K, 0, 1}] + Inactive[Sum][Binomial[1, K]*D[Derivative[2, 0][u][x, t], {x, 1 - K}]*
Inactive[Sum][D[u[x, t], {x, -K}]*Multinomial[K, -K, K]*Derivative[K, 0][u][x, t]*Derivative[K, 0][u][x, t], {K, 0, K}, {K, 0, K}],
{K, 0, 1}]))/3


Your help is much appreciated. Thanks

Clear["Global*"]


Use RuleDelayed in the definition of repRule

repRule = {(Derivative[nx_, 1][u][x, t]) :>
D[(λ*(3*u[x, t]^2*Derivative[1, 0][u][x, t]^2 +
u[x, t]^3*Derivative[2, 0][u][x, t]))/3, {x, nx}]};

ss = Derivative[1, 1][u][x, t];

ss /. repRule

(* (1/3)*λ*(6*u[x, t]*Derivative[1, 0][u][x, t]^3 +
9*u[x, t]^2*Derivative[1, 0][u][x, t]*
Derivative[2, 0][u][x, t] + u[x, t]^3*
Derivative[3, 0][u][x, t]) *)
`
• @Bob.Hanon Thanks, it works. – qahtah Apr 14 at 14:12