Skip to content

Instantly share code, notes, and snippets.

@balthild
Last active November 1, 2018 08:23
Show Gist options
  • Save balthild/87017fb8512865235f41d21707a192ac to your computer and use it in GitHub Desktop.
Save balthild/87017fb8512865235f41d21707a192ac to your computer and use it in GitHub Desktop.
Try implementing Taylor Series in expreduce
(* Higher order derivatives *)
Dn[expr_, {x_, n_}] := Nest[D[#, x]&, expr, n]
(* This function will not work until corywalker/expreduce#183 is fixed *)
TaylorSeries[exp_, {x_, p_, order_}] :=
Sum[(Dn[exp, {x, n}] /. x->p) * (x-p)^n / (n!), {n, 0, order}] + O[x-p]^(l+1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment