Resolver \( u(0 < x < 1) \) para $$ \begin{align*} \frac{d^{2} u(x)}{d x^{2}} + x^{2} &= 0 \\ u(0) &= 0 \\ u(1) &= 0 \\ \end{align*} $$
Se utilizaran tres términos en la aproximación $$ \begin{equation*} u(x) \approx \hat u(x) = \sum_{i=0}^{2} a_{i} x^{i} = a_{0} + a_{1} x + a_{2} x^{2} \end{equation*} $$
reemplazando las condiciones de contorno $$ \begin{align*} \require{cancel} \hat u(0) &= a_{0} + a_{1} (0) + a_{2} (0)^{2} = 0 \\ \hat u(1) &= \cancel{a_{0}} + a_{1} (1) + a_{2} (1)^{2} = 0 \end{align*} $$
resolviendo el sistema $$ \begin{align*} a_{0} &= 0 \\ a_{1} &= -a_{2} \end{align*} $$
reemplazando las constantes $$ \begin{equation*} \hat u(x) = -a_{2} x + a_{2} x^{2} = a_{2} (x^{2} - x) \end{equation*} $$
\( \hat u_{x} \) es $$ \begin{equation*} \frac{d \hat u(x)}{d x} = -a_{1} + 2 a_{2} x \end{equation*} $$
\( \hat u_{xx} \) es $$ \begin{equation*} \frac{d^{2} \hat u(x)}{d x^{2}} = 2 a_{2} \end{equation*} $$
la función residual es $$ \begin{equation*} R(x) = \frac{d^{2} \hat u(x)}{d x^{2}} + x^{2} = 2 a_{2} + x^{2} \end{equation*} $$
la función ponderada es $$ \begin{equation*} W(x) = \frac{d \hat u(x)}{d a_{2}} = (x^{2} - x) \end{equation*} $$
la forma débil de la ecuación diferencial es $$ \begin{equation*} \int_{0}^{1} R(x) W(x) \ dx = \int_{0}^{1} (2 a_{2} + x^{2}) (x^{2} - x) \ dx = 0 \end{equation*} $$
multiplicando y ordenando $$ \begin{equation*} \int_{0}^{1} - 2 a_{2} x + 2 a_{2} x^{2} - x^{3} + x^{4} \ dx = 0 \end{equation*} $$
integrando $$ \begin{equation*} \bigg(- a_{2} x^{2} + \frac{2}{3} a_{2} x^{3} - \frac{1}{4} x^{4} + \frac{1}{5} x^{5} \bigg) \bigg|_{0}^{1} = 0 \end{equation*} $$
reemplazando límites de integración y simplificando $$ \begin{equation*} -\frac{1}{3} a_{2} = \frac{1}{20} \end{equation*} $$
despejando $$ \begin{equation*} a_{2} = -\frac{3}{20} \end{equation*} $$
reemplazando en la solución aproximada $$ \begin{equation*} \hat u(x) = - \frac{3}{20} (x^{2} - x) = \frac{3}{20} x - \frac{3}{20} x^{2} \end{equation*} $$