8.5 The Galerkin Method
473
y
2 = −2a 1 + (2 − 6x)a 2
y
2 + y 2 − 2x = (−2 + x − x
2
)a 1 + (2 − 6x + x
2
− x
3
)a 2 − 2x
The Galerkin equations are
⎧
⎪ ⎪ ⎪ ⎨
⎪ ⎪ ⎪ ⎩
1
0
[(−2 + x − x
2
)a 1 + (2 − 6x + x
2
− x
3
)a 2 − 2x](x − x
2
)dx = 0
1
0
[(−2 + x − x
2
)a 1 + (2 − 6x + x
2
− x
3
)a 2 − 2x](x
2
− x
3
)dx = 0
Integrating the above equations, to yield
−
3
10
a 1 −
3
20
a 2 =
1
6
−
3
20
a 1 −
13
105
a 2 =
1
10
Solving the above equations, we obtain
a 1 = −
142
369
, a 2 = −
14
41
Therefore, the found approximate solution is
y 2 = −2x(1 − x)
71
369
+
7
41
x
Example 8.5.2 Using Galerkin method to solve the boundary value problem x
2 y
+
x y
+ (x
2
− 1)y = 0, y(1) = 1, y(2) = 2.
Solution Because the boundary conditions are homogeneous, first making variable
substitution, the boundary conditions are converted into the homogeneous boundary
condition. For this reason, putting y = z + x, then the above mentioned boundary
problem is transformed into
x
2 z
+ xz
+ (x
2
− 1)z + x
3
= 0
( 1 )
z(1) = z(2) = 0
( 2 )
Choosing the coordinates function satisfying the boundary conditions (2)
ϕ 1 (x) = (x − 1)(2 − x)
(3)
473
y
2 = −2a 1 + (2 − 6x)a 2
y
2 + y 2 − 2x = (−2 + x − x
2
)a 1 + (2 − 6x + x
2
− x
3
)a 2 − 2x
The Galerkin equations are
⎧
⎪ ⎪ ⎪ ⎨
⎪ ⎪ ⎪ ⎩
1
0
[(−2 + x − x
2
)a 1 + (2 − 6x + x
2
− x
3
)a 2 − 2x](x − x
2
)dx = 0
1
0
[(−2 + x − x
2
)a 1 + (2 − 6x + x
2
− x
3
)a 2 − 2x](x
2
− x
3
)dx = 0
Integrating the above equations, to yield
−
3
10
a 1 −
3
20
a 2 =
1
6
−
3
20
a 1 −
13
105
a 2 =
1
10
Solving the above equations, we obtain
a 1 = −
142
369
, a 2 = −
14
41
Therefore, the found approximate solution is
y 2 = −2x(1 − x)
71
369
+
7
41
x
Example 8.5.2 Using Galerkin method to solve the boundary value problem x
2 y
+
x y
+ (x
2
− 1)y = 0, y(1) = 1, y(2) = 2.
Solution Because the boundary conditions are homogeneous, first making variable
substitution, the boundary conditions are converted into the homogeneous boundary
condition. For this reason, putting y = z + x, then the above mentioned boundary
problem is transformed into
x
2 z
+ xz
+ (x
2
− 1)z + x
3
= 0
( 1 )
z(1) = z(2) = 0
( 2 )
Choosing the coordinates function satisfying the boundary conditions (2)
ϕ 1 (x) = (x − 1)(2 − x)
(3)
