Search code examples
maple

substitute variable in différential equation in maple


I use this code in Maple:

Ur := unapply(simplify(subs(r = r/a^(1/2), z = z/a, ur0(r, z))/a^(1/2)), r, z)

I obtain this result:

equation

Is there a way for Maple to understand that diff(p(r/sqrt(a)),r/sqrt(a)) = 1/sqrt(a)*diff(p(r),r)?


Solution

  • To be able to differentiate with regards to an algebraic expression you can use the algsubs command together with the inert Diff command and then subs back the expression if the function is differentiable.

    Diff(p(r/sqrt(a)),r/sqrt(a));  # Equation
    algsubs(r/sqrt(a) = x,%);      # Substitute derivative variable       (1)
    p:=x -> x^2;                   # Define function to differentiate
    value(%%);                     # Evaluate the differential (1)
    subs(x=r/sqrt(a),%);           # Substitute back in again