I assume [itex]N_i[/itex] are test functions with [itex]T[/itex] approximated by [itex]T_1N_1(x) + T_2N_2(x)[/itex]. If so, then [tex]\frac{d^2T}{dx^2} + kT(x) = -f(x)[/tex] where [itex]f[/itex] is a known source term gives [tex]
\begin{multline*}<br />
\int_{x_1}^{x_2} N_i(x)\frac{d^2T}{dx^2} + kN_i(x)T(x) + N_i(x)f(x)\,dx \\=<br />
\left[ N_i(x)\frac{dT}{dx}\right]_{x_1}^{x_2} <br />
+\int_{x_1}^{x_2} -\frac{dN_i}{dx}\frac{dT}{dx} + kN_i(x)T(x) + N_i(x)f(x)\,dx<br />
\end{multline*}[/tex] which results in [tex]
\begin{multline*}<br />
\begin{pmatrix}<br />
\int_{x_1}^{x_2} \left(\frac{dN_1}{dx}\right)^2\,dx & \int_{x_1}^{x_2} \frac{dN_1}{dx}\frac{dN_2}{dx} \,dx \\<br />
\int_{x_1}^{x_2} \frac{dN_1}{dx}\frac{dN_2}{dx} \,dx & \int_{x_1}^{x_2} \left(\frac{dN_2}{dx}\right)^2\,dx<br />
\end{pmatrix}<br />
\begin{pmatrix} T_1 \\ T_2 \end{pmatrix} \\<br />
- k\begin{pmatrix} \int_{x_1}^{x_2} N_1^2(x)\,dx & \int_{x_1}^{x_2} N_1(x)N_2(x)\,dx \\<br />
\int_{x_1}^{x_2} N_1(x)N_2(x)\,dx & \int_{x_1}^{x_2} N_2^2(x)\,dx \end{pmatrix}<br />
\begin{pmatrix} T_1 \\ T_2 \end{pmatrix} \\<br />
= <br />
\begin{pmatrix}<br />
N_1(x_2) \frac{dT}{dx}(x_2) - N_1(x_1) \frac{dT}{dx}(x_1) \\<br />
N_2(x_2) \frac{dT}{dx}(x_2) - N_2(x_1) \frac{dT}{dx}(x_1) \end{pmatrix} +<br />
\begin{pmatrix}<br />
\int_{x_1}^{x_2} N_1(x)f(x)\,dx \\ <br />
\int_{x_1}^{x_2} N_2(x)f(x)\,dx<br />
\end{pmatrix}.\end{multline*}[/tex] I'm sure the authors will give an example of this at some point.
The wave equation is actually a PDE, so [itex]T_1[/itex] and [itex]T_2[/itex] are not constants but functions of time. You therefore end up with the system of ODEs [tex]
A\begin{pmatrix} \frac{d^2T_1}{dt^2} \\ \frac{d^2T_2}{dt^2} \end{pmatrix} = -c^2 B \begin{pmatrix} T_1 \\ T_2 \end{pmatrix} + (\mbox{boundary terms})[/tex] where [itex]B[/itex] is the stiffness matrix and [tex]
A = \begin{pmatrix} \int_{x_1}^{x_2} N_1^2(x)\,dx & \int_{x_1}^{x_2} N_1(x)N_2(x)\,dx \\<br />
\int_{x_1}^{x_2} N_1(x)N_2(x)\,dx & \int_{x_1}^{x_2} N_2^2(x)\,dx \end{pmatrix}.[/tex]