MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Differentiation problem/bug?


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}.

(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 +

Finally, here is the verification

FullSimplify[g[r] - %]

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.

Dimitrios Anagnostou

  • Prev by Date: Re: Differentiation problem/bug?
  • Next by Date: Re: Differentiation problem/bug?
  • Previous by thread: Re: Re: Differentiation problem/bug?
  • Next by thread: Re: Differentiation problem/bug?