Re: Differentiation problem/bug?

*To*: mathgroup at smc.vnet.net*Subject*: [mg69789] Re: Differentiation problem/bug?*From*: dimmechan at yahoo.com*Date*: Sat, 23 Sep 2006 04:44:23 -0400 (EDT)*References*: <eevrea$gfd$1@smc.vnet.net>

Hi. I cannot explain you why D[inp, r, NonConstants -> {F}] fails. I suppose because in the definition of inp there is no explicit presence of r. This idea came considering the example from the Mathematica book D[x^2 + y^2, x, NonConstants -> {y}] 2*x + 2*y*D[y, x, NonConstants -> {y}] I guess someone more experienced than me will give a better explanation or maybe he will succeed in applying the option NonConstants -> {F}. Options[D] (Information[Evaluate[#1[[1]]]] & ) /@ %; {NonConstants -> {}} "NonConstants is an option for D which gives a list of objects to be taken to depend implicitly on the differentiation variables." Attributes[NonConstants] = {Protected} Anyway you can work as follows: inp = 1/4 + 3/(8*E^((2*I)*F)) + (3*E^((2*I)*F))/8 - E^((-2*I)*F - I*Î¸)/4 + E^((2*I)*F - I*Î¸)/4 - E^((-2*I)*F + I*Î¸)/4 + E^((2*I)*F + I*Î¸)/4 + E^((-2*I)*F - (2*I)*Î¸)/16 + E^((2*I)*F - (2*I)*Î¸)/16 + E^((-2*I)*F + (2*I)*Î¸)/16 + E^((2*I)*F + (2*I)*Î¸)/16 - 1/(8*E^((2*I)*Î¸)) - E^((2*I)*Î¸)/8; g[r_] := inp /. F -> F[r] Here is the derivative you are looking for FullSimplify[D[g[r], r]] ((-(1/8))*I*((-1 + E^(I*Î¸))^4 - E^(4*I*F[r])*(1 + E^(I*Î¸))^4)*Derivative[1][F][r])/E^(2*I*(Î¸ + F[r])) And here is the antiderivative of the last result Integrate[%, r] (1/16)*E^(2*I*(Î¸ - F[r]))*((-1 + E^((-I)*Î¸))^4 + E^(4*I*F[r])*(1 + E^((-I)*Î¸))^4) Finally, here is the verification FullSimplify[g[r] - %] Sin[Î¸]^2/2 The function and the indefinite integral w.r.t. r of its derivative w.r.t. r differ a constant w.r.t. r function as it should be. Regards Dimitrios Anagnostou