1
$\begingroup$

I would like to generate a table of values by differentiating a function for each entry on the table based off of the previous entry. The purpose is to decrease the number of differentiations as the table increases in size. For the 10th entry, it would only differentiate the 9th entry instead of doing 9 individual differentiations for the 9th entry and 10 individual differentiations for the 10th.

i.e.

{Exp[7x],7Exp[7x],49Exp[7x], etc.}

Initially I tried using recurrence tables:

RecurrenceTable[{a[n] == D[a[n - 1], x], a[1] == Exp[7x]}, a, {n, 10}]

However, the result just returned the input information.

Is there a way to do this? Maybe using memoization?

$\endgroup$

1 Answer 1

3
$\begingroup$

Perhaps

f[x_] := Exp[7 x]
FoldList[D[#, x] &, f[x], Range[10]]

{E^(7 x), 7 E^(7 x), 49 E^(7 x), 343 E^(7 x), 2401 E^(7 x), 16807 E^(7 x), 117649 E^(7 x), 823543 E^(7 x), 5764801 E^(7 x), 40353607 E^(7 x), 282475249 E^(7 x)}

$\endgroup$
1
  • 2
    $\begingroup$ Or slightly shorter NestList[D[#, x] &, f[x], 10] $\endgroup$
    – Bob Hanlon
    Sep 26, 2016 at 14:46

Your Answer

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

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