Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

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

Search the Archive

Re: How to use "Apply" to do differentiation ?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg114469] Re: How to use "Apply" to do differentiation ?
  • From: Bill Rowe <readnews at sbcglobal.net>
  • Date: Sun, 5 Dec 2010 21:51:32 -0500 (EST)

On 12/4/10 at 6:16 AM, alix.zhang at gmail.com (Mayasky) wrote:

>Something simple yet unbelievable occurred when I use:

>Apply[D[#, x] &, x^5]

>The output is invariably 1 whether I use x^5 or x^100.

Given Apply[f, expr] is supposed to replace the head of expr
with f, any function of x and something else will get replaced
with your function. x^n for any n is Power[x,n], So, Apply
strips the head Power as it is supposed to do which results in
taking the derivative of x with respect to x which of course
evaluates to 1. What were you expecting?

Did you intend

D[#, x] & [x^5]

rather than what you did?



  • Prev by Date: Re: Control my MAC using Mathematica
  • Next by Date: Question about Solve and Reduce (mathematica 8)
  • Previous by thread: How to use "Apply" to do differentiation ?
  • Next by thread: Re: How to use "Apply" to do differentiation ?