\documentclass[a4paper,12pt]{article}
\newcommand{\ds}{\displaystyle}
\newcommand{\pl}{\partial}
\newcommand{\ud}{\underline}
\newcommand{\lin}{\int_0^\infty}
\parindent=0pt
\begin{document}


{\bf Question}

Find the Green's function for the following boundary value problem
$$y''+y=f(x); \quad y(0)=0, \quad y(b)=0$$ What happens in the
case $b=n\pi$ where $n$ is an integer?

Use the Green's function to obtain the solution to
 $$y''+y=x; \quad y(0)=0, \quad y\left(\frac{\pi}{2}\right)=0$$



\vspace{.5in}

{\bf Answer}

$$y'' + y = 0 \hspace{.2in} y(0)= 0; \hspace{.2in} y(b)=0.$$

Solution is $y = A\sin x + B\cos x$

We want solutions $\begin{array}{c}y_1(x) \\ y_2(x) \end{array}$
which vanishes when $\begin{array}{c} x = b \\ x = 0 \end{array}$

$y_2$ is given by $y_2(x) = \sin x$

For $y_1$ we choose A and B so that \begin{eqnarray*} 0 & = & A
\sin b+ B \cos b \\ {\rm Let\ \ \ } A = \cos b & {\rm and} & B =
-\sin b \\ {\rm Then\ \ \ } y_2(x)  & = & \sin x \cos b - \cos x
\sin b \\  & =  & \sin(x - b) \\ \\ {\rm so \ \ \ }y_1 & = & \sin
(x - b) \\ y_2 & = & \sin x \end{eqnarray*}

\begin{eqnarray*} W = \left| \begin{array}{cc} y_1 & y_ 2 \\ y_1'
& y_2' \end{array} \right| & = & \left| \begin{array}{cc}\sin (x -
b) & \sin x \\ \cos (x - b) & \cos x \end{array} \right| \\ & = &
\sin(x - b)\cos x - \cos (x - b)\sin x \\ & =& \sin(x - b - x) \\
& = & \sin (-b) \\ & = & -\sin b\end{eqnarray*}

Now $\tilde{G}(x,s) = \left\{ \begin{array}{cc}
\ds\frac{y_1(s)y_2(x)}{W(s)} & 0 \leq x \leq s \leq b \\
\ds\frac{y_1(x)y_2(s)}{W(s)} & 0 \leq s \leq x \leq b \end{array}
\right.$

So in this case: $\tilde{G}(x,s) = \left\{ \begin{array}{cc}
\ds\frac{\sin (s - b)\sin(x)}{-\sin(b)} & 0 \leq x \leq s \leq b
\\ \ds\frac{\sin(x-b)\sin(s)}{-\sin(b)} & 0 \leq s \leq x \leq b
\end{array} \right.$

If $b = n\pi$ then $\sin b = 0$ and $\tilde{G}(x,s)$ is not well
defined by the above.

This is because there is no non-trivial solution to the boundary
value problem $y'' + y = 0$ subject to $y(0) = 0 $ and $y(n\pi) =
0$

If $b = \frac{\pi}{2}$ then $\sin( \frac{\pi}{2}) = 1$ and $
\sin(x - \frac{\pi}{2}) = -\cos x$

\begin{eqnarray*} {\rm So\ \ \ } \tilde{G}(x,s)&  = & \left\{ \begin{array}{cc} \cos s
\sin(x) & x \leq s \\ \cos x \sin s & s \leq x \end{array} \right.
\\ {\rm so\ that\ \ } y(x) & = & \int_0^x \cos x \sin s \cdot s \,
ds + \int_x^\frac{\pi}{2}(\sin x)(\cos s)s \, ds
\end{eqnarray*}

Now we integrate by parts: \begin{eqnarray*} \int_0^x(\sin s)s \,
ds & = & [-\cos s \cdot s]_0^x + \int_0^x \cos s \, ds \\ & = & -x
\cos x + \sin x \\ \int_x^\frac{\pi}{2}(\cos s)s \, ds  & = &
[\sin \cdot s]_x^\frac{\pi}{2} - \int_x^\frac{\pi}{2}\sin s \, ds
\\ & = & \frac{\pi}{2} - x \sin x - \cos x \end{eqnarray*}

\begin{eqnarray*} y & =& -x \cos^2 x + \sin x \cos x +
\frac{\pi}{2} \sin x - x \sin^2 x - \cos x \sin x \\ & = & -x +
\frac{\pi}{2} \sin x \end{eqnarray*}

NOTE: there is a sign error in this answer, but not sure where.



\end{document}
