Consider the boundary value problem -u"(x) + u(x) = -2 on(-1, 1) with u(-1) = 0 and u(1) = 0.
1. What is the weak formulation of the equation?
2. Divide (-1, 1) into two subintervals of equal size and apply the method of finite elements to find the explicit formula for the piecewise linear approximation.