Items tagged with diff diff Tagged Items Feed

In connection with recent developments for symbolic sequences, a number of improvements were implemented regarding symbolic differentiation, that is the computation of n^th order derivatives were n is a symbol, the simplest example being the n^th derivative of the exponential, which of course is the exponential itself. This post is about these developments, done in collaboration with Katherina von Bülow, and available for download as usual from the Maplesoft R&D web page for Differential Equations and Mathematical functions (the update itself is bundled with the official updates of the Maple Physics package).


It is important to note that Maple is pioneer in having an actual implementation of symbolic differentiation, something that works for real, since several releases.  The development, however, was somewhat stuck because we were unable to compute the symbolic n^th derivative of a composite function f(g(z)). A formula for this problem is actually known, it is the Faà di Bruno formula, but, in order to implement it, first we were missing the incomplete Bell functions , that got implemented in Maple 15, nice, but then we were still missing differentiating symbolic sequences, and functions whose arguments are symbolic sequences (i.e. the number of arguments of the function is n, a symbol, of unknown value at the time of differentiating). All this got implemented now within the new MathematicalFunctions:-Sequence package, opening the door widely to these improvements in n^th differentiation.


The symbolic differentiation code works as mostly all other computer algebra code, by mapping complicated problems into a composition of simpler problems all of which are tractable; what follows is then an illustration of these basic cases.


Among the simplest new case that can now be handled there is that of a power where the exponent is linear in the differentiation variable. This is actually an easy problem

(%diff = diff)(f^(alpha*z+beta), `$`(z, n))

%diff(f^(alpha*z+beta), `$`(z, n)) = alpha^n*f^(alpha*z+beta)*ln(f)^n


More complicated, consider the k^th power of a generic function; the corresponding symbolic derivative can be mapped into a sum of symbolic derivatives of powers of g(z) with lower degree

(%diff = diff)(g(z)^k, `$`(z, n))

%diff(g(z)^k, `$`(z, n)) = k*binomial(n-k, n)*(Sum((-1)^_k1*binomial(n, _k1)*g(z)^(k-_k1)*(Diff(g(z)^_k1, [`$`(z, n)]))/(k-_k1), _k1 = 0 .. n))


In some cases where g(z) is a known function, the computation can be carried on furthermore. For example, for g = ln the result can be expressed using Stirling numbers of the first kind

(%diff = diff)(ln(alpha*z+beta)^k, `$`(z, n))

%diff(ln(alpha*z+beta)^k, `$`(z, n)) = alpha^n*(Sum(pochhammer(k-_k1+1, _k1)*Stirling1(n, _k1)*ln(alpha*z+beta)^(k-_k1), _k1 = 0 .. n))/(alpha*z+beta)^n


The case of sin and cos are relatively simpler, but then assumptions on the exponent are required in order to proceed further ahead from (2), for example

`assuming`([(%diff = diff)(sin(alpha*z+beta)^k, `$`(z, n))], [k::posint])

%diff(sin(alpha*z+beta)^k, `$`(z, n)) = (-1)^k*piecewise(n = 0, (-sin(alpha*z+beta))^k, alpha^n*I^n*(Sum(binomial(k, _k1)*(2*_k1-k)^n*exp(I*(2*_k1-k)*(alpha*z+beta+(1/2)*Pi)), _k1 = 0 .. k))/2^k)


The case of functions of arbitrary number of variables (typical situation where symbolic sequences are required) is now handled properly. This is the pFq hypergeometric function of symbolic order p and q 

(%diff = diff)(hypergeom([`$`(a[i], i = 1 .. p)], [`$`(b[j], j = 1 .. q)], z), `$`(z, n))

%diff(hypergeom([`$`(a[i], i = 1 .. p)], [`$`(b[j], j = 1 .. q)], z), `$`(z, n)) = (product(pochhammer(a[i], n), i = 1 .. p))*hypergeom([`$`(a[i]+n, i = 1 .. p)], [`$`(b[j]+n, j = 1 .. q)], z)/(product(pochhammer(b[j], n), j = 1 .. q))


The case of the MeijerG function is more complicated, but in practice, for the computer, once it knows how to handle symbolic sequences, the more involved problem becomes computable

(%diff = diff)(MeijerG([[`$`(a[i], i = 1 .. n)], [`$`(b[i], i = n+1 .. p)]], [[`$`(b[i], i = 1 .. m)], [`$`(b[i], i = m+1 .. q)]], z), `$`(z, k))

%diff(MeijerG([[`$`(a[i], i = 1 .. n)], [`$`(b[i], i = n+1 .. p)]], [[`$`(b[i], i = 1 .. m)], [`$`(b[i], i = m+1 .. q)]], z), `$`(z, k)) = MeijerG([[-k, `$`(a[i]-k, i = 1 .. n)], [`$`(b[i]-k, i = n+1 .. p)]], [[`$`(b[i]-k, i = 1 .. m)], [0, `$`(b[i]-k, i = m+1 .. q)]], z)


Not only the mathematics of this result is correct: the object returned is actually computable to the end (if you provide the values of n, p, m and q), and the typesetting is actually fully readable, as in textbooks, including copy and paste working properly; all this is new.

The n^th derivative of a number of mathematical functions that were not implemented before, are now also implemented, covering the gaps, for example:

(%diff = diff)(BellB(a, z), `$`(z, n))

%diff(BellB(a, z), `$`(z, n)) = Sum(Stirling2(a, _k1)*pochhammer(_k1-n+1, n)*z^(_k1-n), _k1 = 0 .. a)


(%diff = diff)(bernoulli(z), `$`(z, n))

%diff(bernoulli(z), `$`(z, n)) = pochhammer(nu-n+1, n)*bernoulli(nu-n, z)


(%diff = diff)(binomial(z, m), `$`(z, n))

%diff(binomial(z, m), `$`(z, n)) = (Sum((-1)^(_k1+m)*Stirling1(m, _k1)*pochhammer(_k1-n+1, n)*(z-m+1)^(_k1-n), _k1 = 1 .. m))/factorial(m)


(%diff = diff)(euler(a, z), `$`(z, n))

%diff(euler(a, z), `$`(z, n)) = pochhammer(a-n+1, n)*euler(a-n, z)


In the same way the fundamental formulas for the n^th derivative of all the 12 elliptic Jacobi functions  as well as the four elliptic JacobiTheta functions,  the LambertW , LegendreP  and some others are now all implemented.

Finally there is the "holy grail" of this problem: the n^th derivative of a composite function f(g(z)) - this always-unreachable implementation of Faa di Bruno formula. We now have it :)

(%diff = diff)(f(g(z)), `$`(z, n))

%diff(f(g(z)), `$`(z, n)) = Sum(((D@@k)(f))(g(z))*IncompleteBellB(n, k, `$`(diff(g(z), [`$`(z, j)]), j = 1 .. n-k+1)), k = 0 .. n)


Note the symbolic sequence of symbolic order derivatives of lower degree, both of of f and g, also within the arguments of the IncompleteBellB function. This is a very abstract formula ... And does this really works? Of course it does :). Consider, for instance, a case where the n^th derivatives of f(z) and g(z) can both be computed by the system:




This is the n^th derivative expressed using Faa di Bruno's formula, in turn expressed using symbolic sequences within the IncompleteBellB  function

(%diff = diff)(sin(cos(alpha*z+beta)), `$`(z, n))

%diff(sin(cos(alpha*z+beta)), `$`(z, n)) = Sum(sin(cos(alpha*z+beta)+(1/2)*k*Pi)*IncompleteBellB(n, k, `$`(cos(alpha*z+beta+(1/2)*j*Pi)*alpha^j, j = 1 .. n-k+1)), k = 0 .. n)


These results can all be verified. Take for instance n = 3

eval(%diff(sin(cos(alpha*z+beta)), `$`(z, n)) = Sum(sin(cos(alpha*z+beta)+(1/2)*k*Pi)*IncompleteBellB(n, k, `$`(cos(alpha*z+beta+(1/2)*j*Pi)*alpha^j, j = 1 .. n-k+1)), k = 0 .. n), n = 3)

%diff(sin(cos(alpha*z+beta)), z, z, z) = Sum(sin(cos(alpha*z+beta)+(1/2)*k*Pi)*IncompleteBellB(3, k, `$`(cos(alpha*z+beta+(1/2)*j*Pi)*alpha^j, j = 1 .. 4-k)), k = 0 .. 3)


Compute now the inert functions: on the left-hand side this is just the (now explicit) 3rd order derivative, while on the right-hand side we have a sum of IncompleteBellB  functions, where the number of arguments, expressed in (13) using symbolic sequences that depend on the summation index k and the differentiation order n, now in (14) depend only on k, and get transformed into explicit sequences of arguments when the summation is performed and k assumes integer values

value(%diff(sin(cos(alpha*z+beta)), z, z, z) = Sum(sin(cos(alpha*z+beta)+(1/2)*k*Pi)*IncompleteBellB(3, k, `$`(cos(alpha*z+beta+(1/2)*j*Pi)*alpha^j, j = 1 .. 4-k)), k = 0 .. 3))

alpha^3*sin(alpha*z+beta)*cos(cos(alpha*z+beta))-3*alpha^3*cos(alpha*z+beta)*sin(alpha*z+beta)*sin(cos(alpha*z+beta))+alpha^3*sin(alpha*z+beta)^3*cos(cos(alpha*z+beta)) = alpha^3*sin(alpha*z+beta)*cos(cos(alpha*z+beta))-3*alpha^3*cos(alpha*z+beta)*sin(alpha*z+beta)*sin(cos(alpha*z+beta))+alpha^3*sin(alpha*z+beta)^3*cos(cos(alpha*z+beta))


Take left-hand side minus right-hand side

simplify((lhs-rhs)(alpha^3*sin(alpha*z+beta)*cos(cos(alpha*z+beta))-3*alpha^3*cos(alpha*z+beta)*sin(alpha*z+beta)*sin(cos(alpha*z+beta))+alpha^3*sin(alpha*z+beta)^3*cos(cos(alpha*z+beta)) = alpha^3*sin(alpha*z+beta)*cos(cos(alpha*z+beta))-3*alpha^3*cos(alpha*z+beta)*sin(alpha*z+beta)*sin(cos(alpha*z+beta))+alpha^3*sin(alpha*z+beta)^3*cos(cos(alpha*z+beta))))






Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

how to show chain rules result when diff this

Eq1 := f(x,g(x,t)) + f(x,y);
diff(Eq1, x);



This question is related to and , however I have not been able to apply the solutions given there to my problem.

I have a set of points given by

and certain function value points given by

where e1 is the function I am approximating.


I come up with my piecewise function.

When I do diff(e4,x), however, the points at the nodes show "float(undefined) x=0.2..."(the node).

As it turns out, the value of the derivative on the left of the node is not equal to that of the right side by a factor of 10^(-7), in other words, numerically unimportant but high enough for maple to realise it is not the same number. How could I tell Maple that I am happy choosing, for example, the value given by the function on right side of the node?

I welcome any suggestions.

Many thanks in advance.


     I'm computing a simple covariant derivative of a tensor field W[a,b] in 3 spacetime dimensions. Unfortuntly, my result in Maple 2015 is disagreeing with those obtained in GRTensorII. I think this could be a bug in D_.

Looking at the first result, W[r t ; t] = mu/r in GRTensor II  but D_[t] W[r t] = -mu/r*(cos(theta)^2 - 2). Some ones are correct (diagonals), and some are off by a factor of 2. Some are completely off though.



I would like to plot E2(t) , but It gives errors. How can I avoid the singularity and solve this problem?

restart: with(plots):


g3:=(x,t) -> (diff(g2(x,t),t)):

g4:=(x,t) -> (diff(g2(x,t),x,x)):

g5:=(x,t) -> ((1/2)*(g3(x,t)^2+g4(x,t)^2)):


Error, (in g1) numeric exception: division by zero
Error, (in g3) invalid input: diff received 1, which is not valid for its 2nd argument

Best regards,


I wish to evaluate the expression

knowing that

where a is a constant.  It is not hard to see, assuming enough differentiability,  that the expression evaluates to

I know how to do this when all the derivatives are expressed in terms of the diff() operator.  Here it is:

eq := diff(u(x,t),t) = a^2*diff(u(x,t),x,x);
expr := diff(u(x,t),t,t);

However, I would prefer to do the computations when all derivatives are expressed in terms of the D operator but cannot get that to work.  What is the trick?

I googled everywhere for this and most results just tell me what diff and D does...


Basically I have a function, let's say


f:= x -> x^2

How do I turn the derivative of f into a function?


I tried


fprime := x -> diff(x^2,x)


But tihs just shows me diff(x^2,x), instead of x -> 2x

How to find the determining equation for a system of fractional differential equation using Maple 15?

I input:

solve({My(x, -(1/2)*b) = 0, My(x, (1/2)*b) = 0, w(x, -(1/2)*b) = 0, w(x, (1/2)*b) = 0}, {Am, Bm, Cm, Dm});

and recieved: 

Error, (in My) invalid input: diff received -1, which is not valid for its 2nd argument


My is 

My := proc (x, y) options operator, arrow; -((1/2)*I)*Bm*(exp((2*I)*Pi*x/a)-1)*Pi^2*exp(Pi*(I*x-y)/a)/((exp(Pi*(I*x+y)/a)-1)*(-1+exp(Pi*(I*x-y)/a))^2*a^2)+I*Dm*y*(exp((2*I)*Pi*x/a)-1)*Pi^2*(exp(Pi*(I*x-y)/a))^2/((exp(Pi*(I*x+y)/a)-1)*(-1+exp(Pi*(I*x-y)/a))^3*a^2)+I*Dm*y*(exp((2*I)*Pi*x/a)-1)*Pi^2*(exp(Pi*(I*x+y)/a))^2/((exp(Pi*(I*x+y)/a)-1)^3*(-1+exp(Pi*(I*x-y)/a))*a^2)-I*Bm*(exp((2*I)*Pi*x/a)-1)*Pi^2*exp(Pi*(I*x+y)/a)*exp(Pi*(I*x-y)/a)/((exp(Pi*(I*x+y)/a)-1)^2*(-1+exp(Pi*(I*x-y)/a))^2*a^2)+I*Bm*(exp((2*I)*Pi*x/a)-1)*Pi^2*(exp(Pi*(I*x+y)/a))^2/((exp(Pi*(I*x+y)/a)-1)^3*(-1+exp(Pi*(I*x-y)/a))*a^2)-I*Dm*y*(exp((2*I)*Pi*x/a)-1)*Pi^2*exp(Pi*(I*x+y)/a)*exp(Pi*(I*x-y)/a)/((exp(Pi*(I*x+y)/a)-1)^2*(-1+exp(Pi*(I*x-y)/a))^2*a^2)-((1/2)*I)*Bm*(exp((2*I)*Pi*x/a)-1)*Pi^2*exp(Pi*(I*x+y)/a)/((exp(Pi*(I*x+y)/a)-1)^2*(-1+exp(Pi*(I*x-y)/a))*a^2)-((1/2)*I)*Dm*y*(exp((2*I)*Pi*x/a)-1)*Pi^2*exp(Pi*(I*x+y)/a)/((exp(Pi*(I*x+y)/a)-1)^2*(-1+exp(Pi*(I*x-y)/a))*a^2)-I*Dm*(exp((2*I)*Pi*x/a)-1)*Pi*exp(Pi*(I*x+y)/a)/((exp(Pi*(I*x+y)/a)-1)^2*(-1+exp(Pi*(I*x-y)/a))*a)+I*Bm*(exp((2*I)*Pi*x/a)-1)*Pi^2*(exp(Pi*(I*x-y)/a))^2/((exp(Pi*(I*x+y)/a)-1)*(-1+exp(Pi*(I*x-y)/a))^3*a^2)+I*Dm*(exp((2*I)*Pi*x/a)-1)*Pi*exp(Pi*(I*x-y)/a)/((exp(Pi*(I*x+y)/a)-1)*(-1+exp(Pi*(I*x-y)/a))^2*a)-((1/2)*I)*Dm*y*(exp((2*I)*Pi*x/a)-1)*Pi^2*exp(Pi*(I*x-y)/a)/((exp(Pi*(I*x+y)/a)-1)*(-1+exp(Pi*(I*x-y)/a))^2*a^2)+sum(-4*po(y)*a(y)^4*(Pi(y)^2*m(y)^2*y(y)^2+4*a(y)^2)*sin(m*Pi*x/a)*(diff(diff(d(y), y), y))/(Pi(y)^7*m(y)^7*d(y)^2)+32*(diff(po(y), y))*a(y)^3*(Pi(y)^2*m(y)^2*y(y)^2+4*a(y)^2)*sin(m*Pi*x/a)*(diff(a(y), y))/(Pi(y)^7*m(y)^7*d(y))-56*(diff(po(y), y))*a(y)^4*(Pi(y)^2*m(y)^2*y(y)^2+4*a(y)^2)*sin(m*Pi*x/a)*(diff(Pi(y), y))/(Pi(y)^8*m(y)^7*d(y))-56*(diff(po(y), y))*a(y)^4*(Pi(y)^2*m(y)^2*y(y)^2+4*a(y)^2)*sin(m*Pi*x/a)*(diff(m(y), y))/(Pi(y)^7*m(y)^8*d(y))-8*(diff(po(y), y))*a(y)^4*(Pi(y)^2*m(y)^2*y(y)^2+4*a(y)^2)*sin(m*Pi*x/a)*(diff(d(y), y))/(Pi(y)^7*m(y)^7*d(y)^2)+32*po(y)*a(y)^3*(2*Pi(y)*m(y)^2*y(y)^2*(diff(Pi(y), y))+2*Pi(y)^2*m(y)*y(y)^2*(diff(m(y), y))+2*Pi(y)^2*m(y)^2*y(y)*(diff(y(y), y))+8*a(y)*(diff(a(y), y)))*sin(m*Pi*x/a)*(diff(a(y), y))/(Pi(y)^7*m(y)^7*d(y))+16*po(y)*a(y)^3*(Pi(y)^2*m(y)^2*y(y)^2+4*a(y)^2)*sin(m*Pi*x/a)*(diff(diff(a(y), y), y))/(Pi(y)^7*m(y)^7*d(y))-56*po(y)*a(y)^4*(2*Pi(y)*m(y)^2*y(y)^2*(diff(Pi(y), y))+2*Pi(y)^2*m(y)*y(y)^2*(diff(m(y), y))+2*Pi(y)^2*m(y)^2*y(y)*(diff(y(y), y))+8*a(y)*(diff(a(y), y)))*sin(m*Pi*x/a)*(diff(Pi(y), y))/(Pi(y)^8*m(y)^7*d(y))-56*po(y)*a(y)^4*(2*Pi(y)*m(y)^2*y(y)^2*(diff(Pi(y), y))+2*Pi(y)^2*m(y)*y(y)^2*(diff(m(y), y))+2*Pi(y)^2*m(y)^2*y(y)*(diff(y(y), y))+8*a(y)*(diff(a(y), y)))*sin(m*Pi*x/a)*(diff(m(y), y))/(Pi(y)^7*m(y)^8*d(y))-8*po(y)*a(y)^4*(2*Pi(y)*m(y)^2*y(y)^2*(diff(Pi(y), y))+2*Pi(y)^2*m(y)*y(y)^2*(diff(m(y), y))+2*Pi(y)^2*m(y)^2*y(y)*(diff(y(y), y))+8*a(y)*(diff(a(y), y)))*sin(m*Pi*x/a)*(diff(d(y), y))/(Pi(y)^7*m(y)^7*d(y)^2)-224*po(y)*a(y)^3*(Pi(y)^2*m(y)^2*y(y)^2+4*a(y)^2)*sin(m*Pi*x/a)*(diff(a(y), y))*(diff(Pi(y), y))/(Pi(y)^8*m(y)^7*d(y))-224*po(y)*a(y)^3*(Pi(y)^2*m(y)^2*y(y)^2+4*a(y)^2)*sin(m*Pi*x/a)*(diff(a(y), y))*(diff(m(y), y))/(Pi(y)^7*m(y)^8*d(y))-32*po(y)*a(y)^3*(Pi(y)^2*m(y)^2*y(y)^2+4*a(y)^2)*sin(m*Pi*x/a)*(diff(a(y), y))*(diff(d(y), y))/(Pi(y)^7*m(y)^7*d(y)^2)+392*po(y)*a(y)^4*(Pi(y)^2*m(y)^2*y(y)^2+4*a(y)^2)*sin(m*Pi*x/a)*(diff(Pi(y), y))*(diff(m(y), y))/(Pi(y)^8*m(y)^8*d(y))+56*po(y)*a(y)^4*(Pi(y)^2*m(y)^2*y(y)^2+4*a(y)^2)*sin(m*Pi*x/a)*(diff(Pi(y), y))*(diff(d(y), y))/(Pi(y)^8*m(y)^7*d(y)^2)+56*po(y)*a(y)^4*(Pi(y)^2*m(y)^2*y(y)^2+4*a(y)^2)*sin(m*Pi*x/a)*(diff(m(y), y))*(diff(d(y), y))/(Pi(y)^7*m(y)^8*d(y)^2)+4*(diff(diff(po(y), y), y))*a(y)^4*(Pi(y)^2*m(y)^2*y(y)^2+4*a(y)^2)*sin(m*Pi*x/a)/(Pi(y)^7*m(y)^7*d(y))+8*(diff(po(y), y))*a(y)^4*(2*Pi(y)*m(y)^2*y(y)^2*(diff(Pi(y), y))+2*Pi(y)^2*m(y)*y(y)^2*(diff(m(y), y))+2*Pi(y)^2*m(y)^2*y(y)*(diff(y(y), y))+8*a(y)*(diff(a(y), y)))*sin(m*Pi*x/a)/(Pi(y)^7*m(y)^7*d(y))+4*po(y)*a(y)^4*(2*(diff(Pi(y), y))^2*m(y)^2*y(y)^2+8*Pi(y)*m(y)*y(y)^2*(diff(Pi(y), y))*(diff(m(y), y))+8*Pi(y)*m(y)^2*y(y)*(diff(Pi(y), y))*(diff(y(y), y))+2*Pi(y)*m(y)^2*y(y)^2*(diff(diff(Pi(y), y), y))+2*Pi(y)^2*(diff(m(y), y))^2*y(y)^2+8*Pi(y)^2*m(y)*y(y)*(diff(m(y), y))*(diff(y(y), y))+2*Pi(y)^2*m(y)*y(y)^2*(diff(diff(m(y), y), y))+2*Pi(y)^2*m(y)^2*(diff(y(y), y))^2+2*Pi(y)^2*m(y)^2*y(y)*(diff(diff(y(y), y), y))+8*(diff(a(y), y))^2+8*a(y)*(diff(diff(a(y), y), y)))*sin(m*Pi*x/a)/(Pi(y)^7*m(y)^7*d(y))-28*po(y)*a(y)^4*(Pi(y)^2*m(y)^2*y(y)^2+4*a(y)^2)*sin(m*Pi*x/a)*(diff(diff(m(y), y), y))/(Pi(y)^7*m(y)^8*d(y))+48*po(y)*a(y)^2*(Pi(y)^2*m(y)^2*y(y)^2+4*a(y)^2)*sin(m*Pi*x/a)*(diff(a(y), y))^2/(Pi(y)^7*m(y)^7*d(y))+224*po(y)*a(y)^4*(Pi(y)^2*m(y)^2*y(y)^2+4*a(y)^2)*sin(m*Pi*x/a)*(diff(Pi(y), y))^2/(Pi(y)^9*m(y)^7*d(y))+224*po(y)*a(y)^4*(Pi(y)^2*m(y)^2*y(y)^2+4*a(y)^2)*sin(m*Pi*x/a)*(diff(m(y), y))^2/(Pi(y)^7*m(y)^9*d(y))+8*po(y)*a(y)^4*(Pi(y)^2*m(y)^2*y(y)^2+4*a(y)^2)*sin(m*Pi*x/a)*(diff(d(y), y))^2/(Pi(y)^7*m(y)^7*d(y)^3)-28*po(y)*a(y)^4*(Pi(y)^2*m(y)^2*y(y)^2+4*a(y)^2)*sin(m*Pi*x/a)*(diff(diff(Pi(y), y), y))/(Pi(y)^8*m(y)^7*d(y)), m = 1 .. infinity) end proc;

[Lengthy, poorly formatted, and very-difficult-to-read plaintext prettyprint of the above procedure removed by a moderator.--Carl Love]


     I've been playing around with the Physics package, and I'm confused on evaluaing derivatives of explicit funcitons of the coordinates. This code below doesnt behave as I would think. I'm trying to define z as a function of X[mu]*X[mu], and take diff(z, X[mu]). You can see that each method d_, diff,  disagree and none are satisfactory ansers. (Maple 2015, Windows 8.1 64-bit, Intel i5 Haswell) 

# Declare coordinates for 2 dimensions, flat space

Setup(mathematicalnotation = true, dimension = 2):

# Method 1: Using Define and various differential operators
z :=sqrt(R^2-X[mu]*X[mu]);
diff(z, x1);  #This one is correct
diff(z, X[mu]); # off by 2

# Method #2: Using functions
# Off by a factor of 2
z2 := mu -> sqrt(R^2-X[mu]*X[mu]);
diff(z2(mu), X[mu]); # off by 2

In the following, the diff operator calcuates the derivative correctly, but the D operator doesn't.  A bug?


f := x -> a[1][2]*x;    # the double index on a[][] is intended

proc (x) options operator, arrow; a[1][2]*x end proc


diff(f(x), x);






Here is a worksheet containing the commands above in case you want to try it yourself:

Hi all,


It's been a while since I have used Maple. To be honest I haven't used it for over six years.


I am trying to solve simple differential equations, however I have many issues.


I am trying to simulate what author of this paper did 06421188.pdf


My file looks like this (


Can someone help me to simulate this system? I simply can't remember how to do it.




I have the following :


for which the  transformed power series

is : 1 -(1/6)y*(x^3)

and pow_soln(_k) returns 0. What does this mean?



****** My question *****

for k from 0 to n do    # n is any integer.

func := f(x):             # func is any funciton of x.

D := diff(func, x$k);   # The maple don't allow to uses k but I want to diff k-th order in each k-loop.

end do;                    # How to diff func for k-th times in each k-loop.

I have a nice family of functions of the form:

W:=(p,n,mu,w)->sum(w[k] * (n-k)* mu(n-k),k=1..n)

which can be evaluated for different p's using the operator mu*diff(...,mu)

The recursion begins with p=0 and proceeds using mu*diff(W(p,n,mu,w),mu) = W(p+1,n,mu,w).

Can anybody implement this procedure in Maple

Thank you 

1 2 3 4 5 6 7 Last Page 1 of 11