Example 1. Using the Green's function, solve the boundary value problem

$$
\begin{gathered}
y^{\prime \prime}(x)-y(x)=x \\
y(0)=y(1)=0 .
\end{gathered}
$$
Solution. a) First, let's determine whether the Green's function exists for the corresponding homogeneous boundary value problem

$$
\begin{gathered}
r y^{\prime \prime}(x)-y(x)=0 \\
y(0)=y(1)=0
\end{gathered}
$$

Obviously, $y_{1}(x)=e^{x}, y_{2}(x)=e^{-x}$ is a fundamental system of solutions for equation (6). Therefore, the general solution of this equation is

$$
y(x)=A e^{x}+B e^{-x}
$$

The boundary conditions (5) are satisfied if and only if $\boldsymbol{A}=\boldsymbol{B}=0$, i.e., $y(x) \equiv 0$. Thus, the Green's function exists.

b) It is easy to verify that

$$
G(x, \xi)= \begin{cases}\frac{\operatorname{sh} x \operatorname{sh}(\xi-1)}{\operatorname{sh} 1}, & 0 \leqslant x \leqslant \xi \\ \frac{\operatorname{sh} \xi \operatorname{sh}(x-1)}{\operatorname{sh} 1}, & \xi \leqslant x \leqslant 1\end{cases}
$$

is the Green's function for the boundary value problem (6)-(7).

c) The solution to the boundary value problem (4)-(5) is written as

$$
y(x)=\int_{0}^{1} G(x, \xi) \xi d \xi
$$

where $G(x, \xi)$ is defined by formula (8).

By splitting the integration interval into two and substituting the expression for the Green's function from (8) into (9), we get

$$
\begin{aligned}
& y(x)=\int_{0}^{x} \frac{\xi \operatorname{sh} \xi \operatorname{sh}(x-1)}{\operatorname{sh} 1} d \xi+\int_{x}^{1} \frac{\xi \operatorname{sh} x \operatorname{sh}(\xi-1)}{\operatorname{sh} 1} d \xi= \\
&=\frac{\operatorname{sh}(x-1)}{\operatorname{sh} 1} \int_{0}^{x} \xi \operatorname{sh} \xi d \xi+\frac{\operatorname{sh} x}{\operatorname{sh} 1} \int_{x}^{1} \xi \operatorname{sh}(\xi-1) d \xi
\end{aligned}
$$

However,

$$
\int_{0}^{x} \xi \operatorname{sh} \xi d \xi=x \operatorname{ch} x-\operatorname{sh} x, \quad \int_{x}^{1} \xi \operatorname{sh}(\xi-1) d \xi=1-x \operatorname{ch}(x-1)+\operatorname{sh}(x-1)
$$

therefore,

$y(x)=\frac{1}{\operatorname{sh} 1}\{\operatorname{sh}(x-1)[x \operatorname{ch} x-\operatorname{sh} x]+\operatorname{sh} x[1-x \operatorname{ch}(x-1)+\operatorname{sh}(x-1)]\}=\frac{\operatorname{sh} x}{\operatorname{sh} 1}-x$. Here we used the formula

$$
\operatorname{sh}(\alpha \pm \beta)=\operatorname{sh} \alpha \operatorname{ch} \beta \pm \operatorname{ch} \alpha \operatorname{sh} \beta
$$

as well as the oddness of the function $\operatorname{sh} x$.

By direct verification, we can see that the function

$$
y(x)=\frac{\operatorname{sh} x}{\operatorname{sh} 1}-x
$$

satisfies equation (4) and the boundary conditions (5).