Exercise 1.3 Solutions

1a

Clear[x, xhat]

x = 2.71828182

xhat = 2.7182

abserror = Abs[x - xhat]

relerror = abserror/Abs[x]

Table[{d, relerror < (10^(1 - d))/2}, {d, 1, 10}]

2

1/3

1/3.

Clear[x]

Normal[Series[Exp[(x^2)], {x, 0, 6}]]

(∫_0^(1/4))(E^((x^2))) \[DifferentialD]x

N[%, 10]

(∫_0^0.25) (E^((x^2))) \[DifferentialD]x

(∫_0^(1/4))(1 + (x^2) + ((x^4)/2) + 
            ((x^6)/6)) \[DifferentialD]x

N[%, 10]

(∫_0^0.25) (E^((x^2))) \[DifferentialD]x - (∫_0^0.25)(1 + (x^2) + ((x^4)/2) + 
              ((x^6)/6)) \[DifferentialD]x

3b

p1 = 31.415

p2 = 0.027182

p1 + p2

p1 p2

4a

((Sin[(π/4) + 0.00001] - Sin[(π/4)])/0.00001)

N[Cos[Pi/4]]

0.7071138522 - 0.70710678119

%/0.00001

5a

Do Algebraically

5b

Do Algebraically

6a

p[x_] := (x^3) - 3  (x^2) + 3  x - 1

q[x_] := ((x - 3) x + 3) x - 1

r[x_] := (((x - 1))^3)

p[2.72]

20.12 - (3 7.398)  +  (3 2.72)  - 1

q[2.72]

((2.72 - 3) 2.72 + 3) 2.72 - 1

r[2.72]

8

Done Algebraically

9

s1 = Series[(1/(1 - h)), {h, 0, 3}]

s2 = Series[Cos[h], {h, 0, 5}]

s1 + s2

s1 s2

10

s1 = Series[(E^h), {h, 0, 4}]

s2 = Series[Sin[h], {h, 0, 4}]

s1 + s2

s1 s2

13c

a = 1; b = -100000.00001; c = 1;

x1 = ((-b + (Sqrt[(b^2) - 4  a c]))/(2  a))

x2 = ((-2 c)/(b - (Sqrt[(b^2) - 4  a c])))

Mathematica's solution:

Solve[(x^2) - 100000.0001  x + 1 == 0, x]