0.
1 Integration
0.1.1 Trapesoid rule
I
i
= [f(x
i
) + f(x
i+1
)]
h
2
I =
n1
i=1
I
i
= [f(x
1
) + 2f(x
2
) + 2f(x
3
) + + 2f(x
n1
) + f(x
n
)]
h
2
Truncation error E = O(h
2
)
0.1.2 Simpsons 1/3 rule
f
n
i
f(x
i
)l
i
(x) P
n1
(x)
I =
_
b
a
f(x)dx
n
i=1
_
f(x
i
)
_
b
a
l
i
(x)dx
_
=
n
i=1
A
i
f(x
i
)
A
i
=
_
b
a
l
i
(x)dx, i = 1, 2, , n
l
1
(x) =
(xx
2
)(xx
3
)
(x
1
x
2
)(x
1
x
3
)
l
2
(x) =
(xx
1
)(xx
3
)
(x
2
x
1
)(x
2
x
3
)
l
3
(x) =
(xx
1
)(xx
2
)
(x
3
x
1
)(x
3
x
2
)
For each interval b a = 2h, we can get
A
1
=
h
3
, A
2
=
4h
3
, A
3
=
h
3
Therefore, for each interval
I
i
=
3
i=1
A
i
f(x
i
) =
_
f(a) + 4f(
a + b
2
) + f(b)
_
h
3
The total integration
I =
_
b
a
f(x)dx [f(x
1
) + 4f(x
2
) + 2f(x
3
) + 4f(x
4
) + + 2f(x
n2
) + 4f(x
n1
+ f(x
n
)]
h
3
A total error of O(h
4
)
0.1.3 Gaussian Quadrature
I =
_
1
1
F(t)dt =
n
i=1
C
i
F(t
i
)
1
Table 1: Gaussian Quadrature Parameters
n t
i
c
i
order
2
3 1 3
3 1
3
0.6 5/9 5
0 8/9
0.6 5/9
0.2 Finite Element
0.2.1 Schr odinger Equation
Let | = a
n
| and H
mn
m
| H |
n
, and then from H = E we
can get
n
a
n
m
| H |
n
. .
H
mn
= Ea
n
nm
= Ea
m
The matrix form is as follows
_
_
H
11
H
12
H
13
H
21
H
22
H
23
.
.
.
.
.
.
.
.
.
.
.
.
_
_
= E
_
_
a
1
a
2
.
.
.
_
_
= E, where
_
_
a
1
a
2
.
.
.
_
_
Fourier basis
basis :
n
=
_
2
L
sin(
nx
L
) =
_
2
L
sin(k
n
x) dened within the range 0 L,
where k
n
n
L
, satisfying
m
|
n
=
mn
For T
2
2m
2
, we can get
m
| T |
n
=
2
n
2
2m
mn
0.3 Finite Dierence
x
2
i
=
1
a
2
[
i+1
2
i
+
i1
]
0.3.1 Schr odinger Equation
t
0
2
2ma
2
and U
n
U(x
n
)
i
n
dt
= [H]
x=x
n
= (U
n
+ 2t
0
)
n
t
0
n1
t
0
n+1
2
For sin(k
x), it is straightforward to show that
2
2m
_
x
2
_
x=x
n
= t
0
(k
a)
2
(x
n
)
while
t
0
[(x
n+1
) 2(x
n
) +
x
n1
] = 2t
0
(1 cos k
a)(x
n
)
Normalization
Analytical
_
dx|
(x)|
2
= 1
Numerical
N
n=1
|
(x
n
)|
2
= 1
Therefore,
|
(x
n
)|
2
. .
Numerical
= |
(x)|
2
a
2
. .
Analytical
0.4 ODE solving
0.4.1 Runge-Kutta method
y
n+1
= y
n
+
1
6
[k
1
+ 2k
2
+ 2k
3
+ k
4
] + O(h
5
)
where
k
1
= hf(x
n
, y
n
)
k
2
= hf(x
n
+
1
2
h, y
n
+
1
2
k
1
)
k
3
= hf(x
n
+
1
2
h, y
n
+
1
2
k
2
)
k
4
= hf(x
n
+ h, y
n
+ k
3
)
0.4.2 Gills method
y
n+1
= y
n
+
1
6
[k
1
+ (2
2)k
2
+ (2 +
2)k
3
+ k
4
] + O(h
5
)
where
k
1
= hf(x
n
, y
n
)
k
2
= hf(x
n
+
1
2
h, y
n
+
1
2
k
1
)
k
3
= hf(x
n
+
1
2
h, y
n
+
1
2
(1 +
2)k
1
+ (1
1
2
2)k
2
)
k
4
= hf(x
n
+ h, y
n
1
2
2k
2
+ (1 +
1
2
2)k
3
)
3