Appendix: All Solutions to the Problems
893
y = Y + y
∗
= c 1 cos x + c 2 sin x + x
2
− 2
From the boundary conditions y(0) = 0, y
(1) = 1, we get c 1 = 2, c 2 =
2 sin 1−1
cos 1
.
Substituting them into the general solution, the analytic solution is
y =
2 cos(1 − x) − sin x
cos 1
+ x
2
− 2
Choosing the trial functions ϕ 0 = x, ϕ 1 = x(2 − x), ϕ 2 = x
2
1 −
2
3
x
, ϕ n =
x
n
1 −
n
n+1
x
, (n ≥ 2).
Let the first approximate solution be
y 1 = x + a 1 x(2 − x)
y 1
= −2a 1
−y 1
− y 1 + x
2
= (2 − 2x + x
2
)a 1 + x
2
− x
The Galerkin equation is
1
0
[(2 − 2x + x
2
)a 1 − x + x
2
](2x − x
2
)dx = 0
Integrating, we get
1
0
[(2 − 2x + x
2
)a 1 − x + x
2
](2x − x
2
)dx =
4
5
a 1 −
7
60
= 0
Solve for a 1
a 1 =
7
48
Thus, the first approximate solution is
y 1 = x +
7
48
x(2 − x)
Let the second approximate solution be
y 2 = x + a 1 x(2 − x) + a 2 x
2
1 −
2
3
x
, y 2
= −2a 1 + (2 − 4x)a 2
− y 2
− y 2 + x
2
= (2 − 2x + x
2
)a 1 +
−2 + 4x − x
2
+
2
3
x
3
a 2 + x
2
− x
The Galerkin equations are
893
y = Y + y
∗
= c 1 cos x + c 2 sin x + x
2
− 2
From the boundary conditions y(0) = 0, y
(1) = 1, we get c 1 = 2, c 2 =
2 sin 1−1
cos 1
.
Substituting them into the general solution, the analytic solution is
y =
2 cos(1 − x) − sin x
cos 1
+ x
2
− 2
Choosing the trial functions ϕ 0 = x, ϕ 1 = x(2 − x), ϕ 2 = x
2
1 −
2
3
x
, ϕ n =
x
n
1 −
n
n+1
x
, (n ≥ 2).
Let the first approximate solution be
y 1 = x + a 1 x(2 − x)
y 1
= −2a 1
−y 1
− y 1 + x
2
= (2 − 2x + x
2
)a 1 + x
2
− x
The Galerkin equation is
1
0
[(2 − 2x + x
2
)a 1 − x + x
2
](2x − x
2
)dx = 0
Integrating, we get
1
0
[(2 − 2x + x
2
)a 1 − x + x
2
](2x − x
2
)dx =
4
5
a 1 −
7
60
= 0
Solve for a 1
a 1 =
7
48
Thus, the first approximate solution is
y 1 = x +
7
48
x(2 − x)
Let the second approximate solution be
y 2 = x + a 1 x(2 − x) + a 2 x
2
1 −
2
3
x
, y 2
= −2a 1 + (2 − 4x)a 2
− y 2
− y 2 + x
2
= (2 − 2x + x
2
)a 1 +
−2 + 4x − x
2
+
2
3
x
3
a 2 + x
2
− x
The Galerkin equations are
