Galerkin Method:
order of d.e = 2
Degree of polynomial = 3
Let approximate solution be y
$y = C_0 + C_1x + C_2x^2 + C_3x^3\\
y' = C_1x + 2 C_2x + 3C_3x^2$
From boundary condition 1: y(0) = 1
$C_0 = 1$
From boundary condition 2 : y'(1) = 0.1
$0.1 = C_1 + 2C_2 + 3C_3\\
'\therefore C_1 = 0.1 - 2C_2 - 3C_3$
Approximate solution be,
$y = 1 + (0.1 - 2C_2 - 3C_3x) + C_2x^2 + C_3x^3\\
\therefore y = 1 + 0.1x + C_2 (x^2 - 2x) + C_3(x^3 - 3x)\\
\frac{dy}{dx} = 0.1 + C_2(2x - 2) + C_3(3x^2 - 3)\\
\frac{d^2y}{dx^2} = 2C_2 + 6x C_3$
Residue,
$R = \frac{d^2y}{dx^2} + 3x \frac{dy}{dx}-6y\\
= 2C_2 + 6xC_3+3x [0.1 + C_2(2x + 2)+C_3(3x^2 - 3)] - 6 [1 + 0.1x + C_2(x^2 - 2x)+C_3(x^3 - 3x)]\\
= C_2[2 + 3x(2x - 2)+ 12x - 6x^2] + C_3[6x + 3x(sx^2 - 3)+18x - 6x^3] + 0.3x - 6 - -.6x\\
C_2(6x+2) + C_3(3x^2 + 15x) - 0.3x - 6$
Weighted Integral form
$\int\limits_0^1 WiR dx = 0 \hspace{1cm} ------ (1)$
For Galerkin method,
wi = coefficients of $C_i$ in y
$W_1 = (x^2 - 2x)$ and $w_2 = (x^3 - 3x)$
Equation 1, i=1
$\int\limits_0^1(x^2 - 2x)[C_2 (6x+2)+ C_3(3x^3 + 15x) - 0.3x - 6]dx = 0\\
- 3.883C_2 - 6.95C_3 + 4.125 = 0\\
3.883C_2 + 6.95C_3 = 4.125 \hspace{1cm} ------ (2)$
Equation 1: i = 2
$\int\limits_0^1(x^3 - 3x) [C_2 (6x + 2) + C_3 (3x^3 + 15x) - 0.3x - 6]dx = 0\\
-7.3C_2 - 13.371C_3 + 7.74 = 0\\
7.3C_2 + 13.371C_3 = 7.74 \hspace{1cm} ------ (3)$
Solving equations (2) and (3),
$C_2 = 2.64$ and $C_3 = -0.862\\
\therefore y = 1 + 0.1x + 2.64 (x^2 - 2x) - 0.862 (x^3 - 3x)\\
y(0.2) = 0.58$