0
$\begingroup$

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[1]]*D[Derivative[1, 0][u][x, t]^2, {x, 1 -       K[1]}]*Inactive[Sum][u[x, t]*Derivative[K[1], 0][u][x, t], {K[1], 0, K[1]}], 
 {K[1], 0, 1}] + Inactive[Sum][Binomial[1, K[1]]*D[Derivative[2, 0][u][x, t], {x, 1 - K[1]}]*
 Inactive[Sum][D[u[x, t], {x, -K[2]}]*Multinomial[K[1], -K[2], K[2]]*Derivative[K[1], 0][u][x, t]*Derivative[K[2], 0][u][x, t], {K[1], 0, K[1]}, {K[2], 0, K[1]}], 
{K[1], 0, 1}]))/3

Your help is much appreciated. Thanks

$\endgroup$
1
$\begingroup$
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]) *)
| improve this answer | |
$\endgroup$
  • $\begingroup$ @Bob.Hanon Thanks, it works. $\endgroup$ – qahtah Apr 14 at 14:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.