Preface


This section gives a friendly introduction into calculus with Mathematica.

Return to computing page for the first course APMA0330
Return to computing page for the second course APMA0340
Return to Mathematica tutorial for the first course APMA0330
Return to Mathematica tutorial for the second course APMA0340
Return to the main page for the course APMA0330
Return to the main page for the course APMA0340

Calculus


When numerically evaluating more complex expressions some care is needed, as with all numerical computations, because severe cancelation can result in the numerial accuracy of a computation sometimes being unrelated to the mi,ber of desomal places, except that increasing their number normally improves numerical accuracy.

We calculate the difference of two identical numbers \( \cos \left( 2\,1o^i * \pi + y\right) - \cos (y) \) for y = 2.27. For this particular case, we use 4 decimal places and then repeat calculations with 8 decimal places.

Do[Print["i= ", i, ", x= ", N[2*10^i*Pi + 2.27], " difference= ", N[Cos[2*10^i*Pi + 2.27] - Cos[2.27]]], {i, 1, 7}]
i   x   difference: cos(2π 10i + 2.27) - cos(2.27)
i= 1,   x= 65.1019   difference= 4.996×10-15
i= 2,   x= 630.589   difference= 1.09912×10-14
i= 3,   x= 6286.00   difference= 1.57985×10-13
i= 4,    x= 62834.1    difference= 3.19367× 10-12
i= 5,    x= 628321.0    ddifference= 3.77282× 10-11
i= 6,   x= 6.83781× 106   difference= 6.83781× 10-10
i= 7,    x= 6.28319× 107    difference= -3.36937× 10-9

 

Return to Mathematica page
Return to the main page (APMA0330)
Return to the Part 1 (Plotting)
Return to the Part 2 (First Order ODEs)
Return to the Part 3 (Numerical Methods)
Return to the Part 4 (Second and Higher Order ODEs)
Return to the Part 5 (Series and Recurrences)
Return to the Part 6 (Laplace Transform)
Return to the Part 7 (Boundary Value Problems)