Answers 9
Answers 9
2. i) !
⇡ sin 1 ⇡ sin 1 ⇡ sin 3 ⇡
I⇡ 1+4 1 4 +2 1 2 +4 3 4 +0
12 4
⇡ 2
⇡ 4
⇡
p p ! p
⇡ 8 2 4 8 2 ⇡ 1 8 2
= 1+ + + = + + ⇡ 1.852.
12 ⇡ ⇡ 3⇡ 12 3 9
ii) See appended printouts generated using Wolfram alpha.
f (xn ) e xn ln xn
xn+1 = xn = xn =
f 0 (xn ) e xn + 1/xn
1
Newton-Raphson method
f (xn ) e xn
2x2n 12
xn+1 = xn = xn .
f 0 (xn ) e xn 4xn
Applying one iteration to each of the three ‘guesses’ in turn gives -2.746,
-1.160, 0.331.
dy
= f (x, y) = y
dx
subject to y(0) = 1, choosing h = 0.5. Compare your answer with the
exact solution. Repeat the calculation with h = 0.25. Work to three
decimal places.
k1 = yn , k2 = yn + hk1 = (1 + h)yn .
h 1
yn+1 = yn + (k1 + k2 ) = yn (1 + h + h2 ).
2 2
13
h = 0.5. yn+1 = 8 n
y . y2 = 169 y =
64 0
2.640.
41 41 4
h = 0.25, yn+1 = 32 yn , y4 = ( 32 ) y0 = 2.695
x
Exact result y(x) = e . y(0) = e = 2.718...
dy
= f (x, y) = 10x2 + y
dx
2
subject to y(0) = 2, choosing the interval h = 0.1. Work to 4 decimal
places. Compare your answer with the exact solution.
k1 = 10x2n + yn = 10h2 n2 + yn , k2 = 10h2 x2n+1 + yn + hk1 = 10h2 (n +
1)2 + yn + hk1
h
yn+1 = yn + (k1 + k2 )
2
y0 = 2
1 1 1
y1 = 2 + 20 (k1 + k2 ) with k1 = 2, k2 = 10
+2+ 10
· 2 = 2.3 so that
1
y1 = 2 + 20 (2 + 2.3) = 2.215
1 1 1
y2 = 2.215+ 20 (k1 +k2 ) with k1 = 10 +y1 = 2.315, k2 = 0.4+y1 + 10 k1 =
1
0.4 + 2.215 + 0.2315 = 2.8465 so that y2 = 2.215 + 20 (2.315 + 2.8465) =
2.473.
Exact solution y(x) = 22ex 10(x2 + 2x + 2) so that y(0.2) = 2.471.
x + 2y z = 4
2x + y + z = 5
2x y + 2z = 2.
Answer x = 1, y = 2, z = 1.
ii) Use the Gauss-Jordan technique to find the inverse of the matrix
0 1
1 2 1
B
A=@ 2 1 1 C
A.
2 1 2
Answer
0 1
3 3 3
1B
A 1
= @ 2 4 3 C
A.
3
4 5 3
3
8 step trapezoidal rule exp(-x^2) on [0,1] - Wolfram|Alpha 18/05/2015 23:31
PRO MOBILE APPS PRODUCTS EXAMPLES BLOG ABOUT WOLFRAM SITES Sign in »
Examples Random
Input interpretation:
Result:
Plot:
Enable interactivity
Method comparisons:
Mathematica input:
https://www.wolframalpha.com/input/?i=8+step+trapezoidal+rule+exp%28-x%5E2%29+on+%5B0%2C1%5D Page 1 of 2
8 step trapezoidal rule 1/(1+x^4) on [0,1] - Wolfram|Alpha 18/05/2015 23:34
PRO MOBILE APPS PRODUCTS EXAMPLES BLOG ABOUT WOLFRAM SITES Sign in »
Examples Random
Input interpretation:
Result:
Plot:
Enable interactivity
Method comparisons:
Mathematica input:
https://www.wolframalpha.com/input/?i=8+step+trapezoidal+rule+1%2F%281%2Bx%5E4%29+on+%5B0%2C1%5D Page 1 of 2
2 step simpson x^2/(1+x^2) on [0,1] - Wolfram|Alpha 19/05/2015 00:33
PRO MOBILE APPS PRODUCTS EXAMPLES BLOG ABOUT WOLFRAM SITES Sign in »
Examples Random
Input interpretation:
Result:
Plot:
Enable interactivity
Method comparisons:
Mathematica input:
https://www.wolframalpha.com/input/?i=2+step+simpson+x%5E2%2F%281%2Bx%5E2%29+on+%5B0%2C1%5D Page 1 of 2