I am new to Mathematica, but not so new to programming. What I'd like to do in Mathematica (not using an API) is to display on each line, the nth derivative of a function, e.g. for n = 1..10. Is there a way to accomplish this in Mathematica? (without explicitly typing the command for each derivative of course. e.g. does Mathematica have iterative constructs to do this).
Avoiding cleverness as much as possible, you can just use a Do
loop:
Do[Print[D[Exp[-a*x], {x, n}]], {n, 0, 10}]
Or for example
Grid@(List@D[Exp[-a*x], {x, #}] & /@ Range[0, 10])
etc
"Iteratively differentiate" cries out Nest[]
to me,....
Print /@ NestList[D[#, x] &, Exp[-a*x], 10];
Or substitute CellPrint@ExpressionCell[#, "Output"] &
for Print
for different styling.
Column[D[Sin[x] Log[x], {x, #}] & /@ Range[10]]
? $\endgroup$ – b.gates.you.know.what Aug 18 '12 at 16:49Print@D[Sin[x] Log[x], {x, #}] & ~Array~ 10;
? $\endgroup$ – Mr.Wizard Aug 18 '12 at 16:51Scan[Print[D[Sin[x] Log[x], {x, #}]] &, Range[10]]
orDo[Print[D[Sin[x] Log[x], {x, k}]], {k, 10}]
. $\endgroup$ – J. M.'s ennui♦ Aug 18 '12 at 16:56