I am doing some self studying on J.N. Reddy's book, An Introduction to the finite element method, 1st edition. (This was the only one available at the local library).
In exercise 2.12, one reads
Compute the coefficient matrix and the right size of the N-parameter Ritz system of the equation
\begin{aligned} \frac{d}{dx} \left((1+x) \frac{du}{dx}\right) & = 0 \\ 0<x<1 \end{aligned} with conditions
$u(0)$ = 1 and $u(1)=1$.
In the answer, it says that the right-size N parameter is
\begin{aligned} l_i = \frac{1}{(i+1)(i+2)} \end{aligned}
However, I always find $l_i = 0$.
My procedure was the following.
Using Ritz method,
\begin{aligned} 0 = -\int_0^1 v\frac{d}{dx}\left((1+x)\frac{du}{dx}\right)dx \end{aligned}
Integrating by parts,
\begin{aligned} 0 = -\int_0^1 v\frac{d}{dx}\left((1+x)\frac{du}{dx}\right)dx = -v(1+x)\frac{du}{dx} |_0^1 + \int^1_0 (1+x)\frac{dv}{dx}\frac{du}{dx}dx \end{aligned}
As $u$ is specified at $x=0$ and $x=1$, $v(0) = v(1) = 0$. Therefore
\begin{aligned} -v(1+x)\frac{du}{dx} |_0^1 = 0 \end{aligned}
And we are left with
\begin{aligned} 0 = -\int_0^1 v\frac{d}{dx}\left((1+x)\frac{du}{dx}\right)dx = \int^1_0 (1+x)\frac{dv}{dx}\frac{du}{dx}dx \end{aligned}
Thus the Bilinear form is
\begin{aligned} B(u,v) = \int^1_0 (1+x)\frac{dv}{dx}\frac{du}{dx}dx \end{aligned}
and
\begin{aligned} l(v) = 0 \end{aligned}
Could any one tell me what I got wrong?
I understood my mistake, and it was caused by misunderstanding the notation.
Given an approximate answer
\begin{align} u_N = \phi_0 + \sum_{i=1}^N c_i\phi_i \end{align}
We cannot say that $l_i = l(\phi_i)$, but
\begin{align} l_i = l(\phi_i) - B(\phi_i, \phi_0) \end{align}
That way, choosing $\phi_0 = x$ and $\phi_i = x^i(1-x)$, we find
\begin{align} l_i =-B(\phi_i, \phi_0) = -\int_0^1 x (1-x) x^i dx = -\int_0^1 x^{i+1}-x^{i+2} dx = -\frac{1}{i+1} + \frac{1}{i+2} = \frac{1}{(i+1)(i+2)} \end{align}