4
$\begingroup$

Consider the function f[x_]=x^5. The first-order derivative of this function is given by D[f[x],{x,1}]. More generally, we can compute the $n^{\text{th}}$-order derivative (where $n$ is finite) by writing D[f[x],{x,n}].

My question is, how do we compute the $2n^{\text{th}}$-order derivative? That is, how do we find the zeroth-order derivative (n=0), second-order derivative (n=1), fourth-order derivative (n=2) etc? The command D[f[x],{x,2n}] does not seem to be recognized.

$\endgroup$
3
  • 2
    $\begingroup$ Here is a workaround D[f[x], {x, m}] /. m -> (2*n) $\endgroup$
    – Nasser
    Commented Feb 8 at 3:54
  • $\begingroup$ @Nasser Thanks for your response. What does /. do exactly? $\endgroup$
    – Bell
    Commented Feb 8 at 3:57
  • 1
    $\begingroup$ It just replaces m by 2 n in the result. Mathematica does not like the order of derivative to be something other than length 1. i.e atomic. May be by design. I do not know. $\endgroup$
    – Nasser
    Commented Feb 8 at 3:59

1 Answer 1

2
$\begingroup$

Another way to do this using HoldForm and ReleaseHold:

ReleaseHold@D[f[x], {x, HoldForm[2 m]}]

enter image description here

With f[x_] := x^5:

 ReleaseHold@D[f[x], {x, HoldForm[2 m]}]

 (*x^(5 - 2 m) FactorialPower[5, 2 m]*)

Taking $m=1$ and $m=2$:

% /. m -> # & /@ Range[2]

(*{20 x^3, 120 x}*)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.