Here, the function \( g(x) \) to solve for follows the equation
$$ -g''(x) = f(x),\qquad x \in (0,1) $$where \( f(x) \) is a given function, along with the chosen conditions
$$ \begin{aligned} g(0) = g(1) = 0 \end{aligned}\tag{14} $$In this example, we consider the case when \( f(x) = (3x + x^2)\exp(x) \).
For this case, a possible trial solution satisfying the conditions could be
$$ g_t(x) = x \cdot (1-x) \cdot N(P,x) $$The analytical solution for this problem is
$$ g(x) = x(1 - x)\exp(x) $$