-- you have earned Featured Contributor Badge Your exceptional post has been selected for our editorial column Staff Picks http://wolfr.am/StaffPicks and Your Profile is now distinguished by a Featured Contributor Badge and is displayed on the Featured Contributor Board. Thank you!
Thanks for your work. This looks wonderful.
I think there's a misplaced parenthesis in the code for the tangent line. I think the corrected formulation would be
(D[expr, x] /. x -> x0)*(x - x0) + (expr /. x -> x0)