2.11 HW 10

  2.11.1 Problem 1
  2.11.2 Problem 2
  2.11.3 Problem 3
  2.11.4 Problem 4
PDF (letter size)
PDF (legal size)

pict

2.11.1 Problem 1

version 040417

\[ \frac{d^{2}u}{dx^{2}}=f\left ( x\right ) ;0<x<L;u\left ( 0\right ) =A;\frac{du}{dx}\left ( 1\right ) =B \] Note: I used \(L\) for the length instead of one. Will replace \(L\) by one at the very end. This makes it more clear. Compare the above to the standard form (Sturm-Liouville)\[ -\frac{d}{dx}\left ( p\frac{du}{dx}\right ) +qu=f\left ( x\right ) \] Therefore it becomes

\[ -\frac{d}{dx}\left ( p\frac{du}{dx}\right ) =-f\left ( x\right ) \]

\[ p\left ( x\right ) =1 \] Green function is \(G\left ( x,x_{0}\right ) \) (will use \(x_{0}\) which is what the book uses, instead of \(a\), as \(x_{0}\) is more clear). Green function is the solution to\begin{align*} \frac{d^{2}G\left ( x,x_{0}\right ) }{dx^{2}} & =\delta \left ( x-x_{0}\right ) \\ G\left ( 0,x_{0}\right ) & =0\\ \frac{dG\left ( L,x_{0}\right ) }{dx} & =0 \end{align*}

Where \(x_{0}\) is the location of the impulse. Since \(\frac{d^{2}G\left ( x,x_{0}\right ) }{dx^{2}}=0\) for \(x\neq x_{0}\), then the solution to \(\frac{d^{2}G\left ( x,x_{0}\right ) }{dx^{2}}=0\), which is a linear function in this case, is broken into two regions\[ G\left ( x,x_{0}\right ) =\left \{ \begin{array} [c]{ccc}A_{1}x+A_{2} & & 0<x<x_{0}\\ B_{1}x+B_{2} & & x_{0}<x<L \end{array} \right . \] The first solution, using \(G\left ( 0,x_{0}\right ) =0\) gives \(A_{2}=0\) and the second solution using \(\frac{dG\left ( 1,x_{0}\right ) }{dx}=0\) gives \(B_{1}=0\), hence the above reduces to\begin{equation} G\left ( x,x_{0}\right ) =\left \{ \begin{array} [c]{ccc}A_{1}x & & x<x_{0}\\ B_{2} & & x_{0}<x \end{array} \right . \tag{1} \end{equation} We are left with constants to \(A_{1},B_{2}\) to find. The continuity condition at \(x=x_{0}\) gives\begin{equation} A_{1}x_{0}=B_{2}\tag{2} \end{equation} The jump discontinuity of the derivative of \(G\left ( x,x_{0}\right ) \) at \(x=x_{0}\), gives the final equation\begin{equation} \left ( \frac{d}{dx}G\left ( x,x_{0}\right ) \right ) _{x_{0}<x}-\left ( \frac{d}{dx}G\left ( x,x_{0}\right ) \right ) _{x<x_{0}}=\frac{-1}{p\left ( x_{0}\right ) }=-1\tag{2A} \end{equation}

Since \(p\left ( x\right ) =1\) in this problem. But \begin{equation} \frac{dG\left ( x,x_{0}\right ) }{dx}=\left \{ \begin{array} [c]{ccc}A_{1} & & x<x_{0}\\ 0 & & x_{0}<x \end{array} \right . \tag{3} \end{equation} Hence (2A) becomes\[ 0-\left ( A_{1}\right ) =-1 \] Therefore \begin{equation} A_{1}=1\tag{4} \end{equation} Solving (2,4) gives \(B_{2}=x_{0}\). Hence the Green function is, from (1) \[ G\left ( x,x_{0}\right ) =\left \{ \begin{array} [c]{ccc}x & & x<x_{0}\\ x_{0} & & x_{0}<x \end{array} \right . \]

pict

And \(\frac{dG\left ( x,x_{0}\right ) }{dx_{0}}\) where now derivative is w.r.t. \(x_{0}\), is \[ \frac{dG\left ( x,x_{0}\right ) }{dx_{0}}=\left \{ \begin{array} [c]{ccc}0 & & x<x_{0}\\ 1 & & x_{0}<x \end{array} \right . \]

We now have all the information needed to evaluate the solution to the original ODE.\[ u\left ( x\right ) =\overset{\text{particular solution}}{\overbrace{\int _{0}^{x}G\left ( x,x_{0}\right ) f\left ( x_{0}\right ) dx_{0}}}+\overset{\text{boundary terms}}{\overbrace{\left [ p\left ( x_{0}\right ) G\left ( x,x_{0}\right ) \frac{du\left ( x_{0}\right ) }{dx_{0}}-p\left ( x_{0}\right ) u\left ( x_{0}\right ) \frac{dG\left ( x,x_{0}\right ) }{dx_{0}}\right ] _{x_{0}=0}^{x_{0}=L}}}\] Since \(p\left ( x_{0}\right ) =1\) then\[ y\left ( x\right ) =\int _{0}^{x}G\left ( x,x_{0}\right ) f\left ( x_{0}\right ) dx_{0}+\left [ G\left ( x,x_{0}\right ) \frac{du\left ( x_{0}\right ) }{dx_{0}}-u\left ( x_{0}\right ) \frac{dG\left ( x,x_{0}\right ) }{dx_{0}}\right ] _{x_{0}=0}^{x_{0}=L}\] Let \(u_{h}=\left [ G\left ( x,x_{0}\right ) \frac{du\left ( x_{0}\right ) }{dx_{0}}-u\left ( x_{0}\right ) \frac{dG\left ( x,x_{0}\right ) }{dx_{0}}\right ] _{x_{0}=0}^{x_{0}=L}\), hence\[ u_{h}=G\left ( x,L\right ) \frac{du\left ( x_{0}\right ) }{dx_{0}}\left ( L\right ) -u\left ( L\right ) \frac{dG\left ( x,x_{0}\right ) }{dx_{0}}\left ( L\right ) -G\left ( x,0\right ) \frac{du\left ( x_{0}\right ) }{dx_{0}}\left ( 0\right ) +u\left ( 0\right ) \frac{dG\left ( x,x_{0}\right ) }{dx_{0}}\left ( 0\right ) \] But\begin{align*} G\left ( x,L\right ) & =x\\ \frac{du\left ( x_{0}\right ) }{dx_{0}}\left ( L\right ) & =B\\ \frac{dG\left ( x,x_{0}\right ) }{dx_{0}}\left ( L\right ) & =0\\ G\left ( x,0\right ) & =0\\ \frac{dG\left ( x,x_{0}\right ) }{dx_{0}}\left ( 0\right ) & =1\\ u\left ( 0\right ) & =A \end{align*}

Then\[ u_{h}=xB+A \] We see that the boundary terms are linear in \(x\), which is expected as the fundamental solutions for the homogenous solution as linear. The complete solution is\begin{align*} y\left ( x\right ) & =\int _{0}^{L}G\left ( x,x_{0}\right ) f\left ( x_{0}\right ) dx_{0}+\left ( xB+A\right ) \\ & =\int _{0}^{L}G\left ( x,x_{0}\right ) f\left ( x_{0}\right ) dx_{0}+xB+A\\ & =\int _{0}^{x}x_{0}f\left ( x_{0}\right ) dx_{0}+\int _{x}^{L}xf\left ( x_{0}\right ) dx_{0}+xB+A \end{align*}

For example, if \(f\left ( x\right ) =x\), or \(f\left ( x_{0}\right ) =x_{0}\) then (but remeber, we have to use \(-f\left ( x\right ) \) since we are using S-L form) \begin{align*} y\left ( x\right ) & ==\int _{0}^{x}G\left ( x,x_{0}\right ) (-f\left ( x_{0}\right ) )dx_{0}+\int _{x}^{1}G\left ( x,x_{0}\right ) (-f\left ( x_{0}\right ) )dx_{0}+\left ( xB+A\right ) \\ & =-\int _{0}^{x}x_{0}x_{0}dx_{0}-\int _{x}^{1}xx_{0}dx_{0}+xB+A\\ & =-\left ( \frac{x_{0}^{3}}{3}\right ) _{0}^{x}-x\left ( \frac{x_{0}^{2}}{2}\right ) _{x}^{1}+xB+A\\ & =-\left ( \frac{x^{3}}{3}\right ) -x\left ( \frac{1}{2}-\frac{x^{2}}{2}\right ) +xB+A\\ & =A-\frac{1}{2}x+Bx+\frac{1}{6}x^{3} \end{align*}

To verify the result, this was solved directly, with \(f\left ( x\right ) =x\), giving same answer as above.

pict

And if \(f\left ( x\right ) =x^{2},\) or \(f\left ( x_{0}\right ) =x_{0}^{2}\), then\begin{align*} y\left ( x\right ) & =\int _{0}^{x}x_{0}\left ( -f\left ( x_{0}\right ) \right ) dx_{0}+\int _{x}^{L}x\left ( -f\left ( x_{0}\right ) \right ) dx_{0}+xB+A\\ & =-\int _{0}^{x}x_{0}x_{0}^{2}dx_{0}-x\int _{x}^{1}x_{0}^{2}dx_{0}+xB+A\\ & =-\left ( \frac{x_{0}^{4}}{4}\right ) _{0}^{x}-x\left ( \frac{x_{0}^{3}}{3}\right ) _{x}^{1}+xB+A\\ & =-\left ( \frac{x^{4}}{4}\right ) -x\left ( \frac{1}{3}-\frac{x^{3}}{3}\right ) +xB+A\\ & =A-\frac{1}{3}x+Bx+\frac{1}{12}x^{4} \end{align*}

To verify the result, this was solved directly, with \(f\left ( x\right ) =x^{2}\), giving same answer as above.

pict

This shows the benefit of Green function. Once we know \(G\left ( x,x_{0}\right ) \), then changing the source term, requires only convolution to find the new solution, instead of solving the ODE again as normally done.

2.11.2 Problem 2

\[ \frac{d^{2}u}{dx^{2}}+u=f\left ( x\right ) ;0<x<L;u\left ( 0\right ) =A;u\left ( L\right ) =B;L\neq n\pi \] Solution

Compare the above to the standard form\begin{align*} -\frac{d}{dx}\left ( p\frac{du}{dx}\right ) +qu & =f\left ( x\right ) \\ -pu^{\prime \prime }+qu & =f\left ( x\right ) \end{align*}

Therefore\[ p\left ( x\right ) =-1 \] Green function is the solution to\begin{align*} \frac{d^{2}G\left ( x,x_{0}\right ) }{dx^{2}}+G\left ( x,x_{0}\right ) & =\delta \left ( x-x_{0}\right ) \\ G\left ( 0,x_{0}\right ) & =0\\ G\left ( L,x_{0}\right ) & =0 \end{align*}

Where \(x_{0}\) is the location of the impulse. Since \(\frac{d^{2}G\left ( x,x_{0}\right ) }{dx^{2}}=0\) for \(x\neq x_{0}\), then the solution to \(\frac{d^{2}G\left ( x,x_{0}\right ) }{dx^{2}}+G\left ( x,x0\right ) =0\), is broken into two regions\[ G\left ( x,x_{0}\right ) =\left \{ \begin{array} [c]{ccc}A_{1}\cos x+A_{2}\sin x & & x<x_{0}\\ B_{1}\cos x+B_{2}\sin x & & x_{0}<x \end{array} \right . \] The first boundary condition on the left gives \(A_{1}=0\). Second boundary conditions on the right gives\begin{align*} B_{1}\cos L+B_{2}\sin L & =0\\ B_{1} & =-B_{2}\frac{\sin L}{\cos L} \end{align*}

Hence the solution now looks like\[ G\left ( x,x_{0}\right ) =\left \{ \begin{array} [c]{ccc}A_{2}\sin x & & x<x_{0}\\ -B_{2}\frac{\sin L}{\cos L}\cos x+B_{2}\sin x & & x_{0}<x \end{array} \right . \] But \[ -B_{2}\frac{\sin L}{\cos L}\cos x+B_{2}\sin x=\frac{B_{2}}{\cos L}\left ( \sin x\cos L-\cos x\sin L\right ) \] Using trig identity \(\sin \left ( a-b\right ) =\sin a\cos b-\cos a\sin b\), the above can be written as \(\frac{B_{2}}{\cos L}\sin \left ( x-L\right ) \), hence the solution becomes\begin{equation} G\left ( x,x_{0}\right ) =\left \{ \begin{array} [c]{ccc}A_{2}\sin x & & x<x_{0}\\ \frac{B_{2}}{\cos L}\sin \left ( x-L\right ) & & x_{0}<x \end{array} \right . \tag{1} \end{equation} Continuity at \(x_{0}\) gives\begin{equation} A_{2}\sin x_{0}=\frac{B_{2}}{\cos L}\sin \left ( x_{0}-L\right ) \tag{2} \end{equation} And jump discontinuity on derivative of \(G\) gives\begin{align} \frac{B_{2}}{\cos L}\cos \left ( x_{0}-L\right ) -A_{2}\cos x_{0} & =-\frac{1}{p\left ( x\right ) }=1\nonumber \\ \frac{B_{2}}{\cos L}\cos \left ( x_{0}-L\right ) -A_{2}\cos x_{0} & =1 \tag{3} \end{align}

Now we need to solve (2,3) for \(A_{2},B_{2}\) to obtain the final solution for \(G\left ( x,x_{0}\right ) \).  From (2), \begin{equation} A_{2}=\frac{B_{2}}{\cos L\sin x_{0}}\sin \left ( x_{0}-L\right ) \tag{4} \end{equation} Plug into (3)\begin{align*} \frac{B_{2}}{\cos L}\cos \left ( x_{0}-L\right ) -\frac{B_{2}}{\cos L\sin x_{0}}\sin \left ( x_{0}-L\right ) \cos x_{0} & =1\\ \frac{B_{2}}{\cos L}\cos \left ( x_{0}-L\right ) -\frac{B_{2}}{\cos L}\sin \left ( x_{0}-L\right ) \frac{\cos x_{0}}{\sin x_{0}} & =1\\ B_{2}\cos \left ( x_{0}-L\right ) -B_{2}\sin \left ( x_{0}-L\right ) \frac{\cos x_{0}}{\sin x_{0}} & =\cos L\\ B_{2}\left ( \cos \left ( x_{0}-L\right ) -\sin \left ( x_{0}-L\right ) \frac{\cos x_{0}}{\sin x_{0}}\right ) & =\cos L\\ B_{2}\left ( \sin x_{0}\cos \left ( x_{0}-L\right ) -\cos x_{0}\sin \left ( x_{0}-L\right ) \right ) & =\cos L\sin x_{0} \end{align*}

But using trig identity \(\sin \left ( a-b\right ) =\sin a\cos b-\cos a\sin b\) we can write above as\begin{align*} B_{2}\left ( \sin \left ( x_{0}-\left ( x_{0}-L\right ) \right ) \right ) & =\cos L\sin x_{0}\\ B_{2}\sin L & =\cos L\sin x_{0}\\ B_{2} & =\frac{\cos L\sin x_{0}}{\sin L} \end{align*}

Now that we found \(B_{2}\), we go back and find \(A_{2}\) from (4)\begin{align*} A_{2} & =\frac{\cos L\sin x_{0}}{\sin L}\frac{1}{\cos L\sin x_{0}}\sin \left ( x_{0}-L\right ) \\ & =\frac{\sin \left ( x_{0}-L\right ) }{\sin L} \end{align*}

Therefore Green function is, from (1)\[ G\left ( x,x_{0}\right ) =\left \{ \begin{array} [c]{ccc}\frac{\sin \left ( x_{0}-L\right ) }{\sin L}\sin x & & x<x_{0}\\ \frac{\cos L\sin x_{0}}{\sin L}\frac{1}{\cos L}\sin \left ( x-L\right ) & & x_{0}<x \end{array} \right . \] Or\begin{equation} G\left ( x,x_{0}\right ) =\left \{ \begin{array} [c]{ccc}\frac{\sin \left ( x_{0}-L\right ) }{\sin L}\sin x & & x<x_{0}\\ \frac{\sin x_{0}}{\sin L}\sin \left ( x-L\right ) & & x_{0}<x \end{array} \right . \tag{5} \end{equation} It is symmetrical. Here is a plot of \(G\left ( x,x_{0}\right ) \) for some arbitrary \(x_{0}\) located at \(x=0.75\) for \(L=1\).

pict

Now comes the hard part. We need to find the solution using\begin{equation} y\left ( x\right ) =\overset{\text{particular solution}}{\overbrace{\int _{0}^{x}G\left ( x,x_{0}\right ) f\left ( x_{0}\right ) dx_{0}}}+\overset{\text{boundary terms}}{\overbrace{\left [ p\left ( x_{0}\right ) G\left ( x,x_{0}\right ) \frac{du\left ( x_{0}\right ) }{dx_{0}}-p\left ( x_{0}\right ) u\left ( x_{0}\right ) \frac{dG\left ( x,x_{0}\right ) }{dx_{0}}\right ] _{x_{0}=0}^{x_{0}=L}}} \tag{6} \end{equation} The first step is to find \(\frac{dG\left ( x,x_{0}\right ) }{dx_{0}}\). From (5), we find\begin{equation} \frac{dG\left ( x,x_{0}\right ) }{dx_{0}}=\left \{ \begin{array} [c]{ccc}\frac{\cos \left ( x_{0}-L\right ) }{\sin L}\sin x & & x<x_{0}\\ \frac{\cos x_{0}}{\sin L}\sin \left ( x-L\right ) & & x_{0}<x \end{array} \right . \tag{7} \end{equation} Now we plug everything in (6). But remember that \(G\left ( 0,x_{0}\right ) =0,G\left ( L,x_{0}\right ) =0,u\left ( 0\right ) =A,u\left ( L\right ) =B\,.\) Hence\begin{align*} \Delta & =\left [ p\left ( x_{0}\right ) G\left ( x,x_{0}\right ) \frac{du\left ( x_{0}\right ) }{dx_{0}}-p\left ( x_{0}\right ) u\left ( x_{0}\right ) \frac{dG\left ( x,x_{0}\right ) }{dx_{0}}\right ] _{x_{0}=0}^{x_{0}=L}\\ & =G\left ( x,L\right ) \frac{du\left ( L\right ) }{dx_{0}}-u\left ( L\right ) \frac{dG\left ( x,L\right ) }{dx_{0}}-G\left ( x,0\right ) \frac{du\left ( 0\right ) }{dx_{0}}+u\left ( 0\right ) \frac{dG\left ( x,0\right ) }{dx_{0}}\\ & =0-\left ( B\right ) \left ( \frac{\cos \left ( x_{0}-L\right ) }{\sin L}\sin x\right ) _{x_{0}=L}-0+\left ( A\right ) \left ( \frac{\cos x_{0}}{\sin L}\sin \left ( x-L\right ) \right ) _{x_{0}=0}\\ & =-\left ( B\right ) \left ( \frac{1}{\sin L}\sin x\right ) +\left ( A\right ) \left ( \frac{\sin \left ( x-L\right ) }{\sin L}\right ) \\ & =-B\frac{\sin x}{\sin L}+A\frac{\sin \left ( x-L\right ) }{\sin L} \end{align*}

But \(p=-1\), hence the above becomes\begin{align*} \Delta & =-G\left ( x,L\right ) \frac{du\left ( L\right ) }{dx_{0}}+u\left ( L\right ) \frac{dG\left ( x,L\right ) }{dx_{0}}+G\left ( x,0\right ) \frac{du\left ( 0\right ) }{dx_{0}}-u\left ( 0\right ) \frac{dG\left ( x,0\right ) }{dx_{0}}\\ & =0+\left ( B\right ) \left ( \frac{\cos \left ( x_{0}-L\right ) }{\sin L}\sin x\right ) _{x_{0}=L}+0-\left ( A\right ) \left ( \frac{\cos x_{0}}{\sin L}\sin \left ( x-L\right ) \right ) _{x_{0}=0}\\ & =+\left ( B\right ) \left ( \frac{1}{\sin L}\sin x\right ) -\left ( A\right ) \left ( \frac{\sin \left ( x-L\right ) }{\sin L}\right ) \\ & =B\frac{\sin x}{\sin L}-A\frac{\sin \left ( x-L\right ) }{\sin L} \end{align*}

We see that the boundary terms are linear combination of sin and cosine in \(x\), which is expected as the fundamental solutions for the homogenous solution as linear combination of sin and cosine in \(x\) as was found initially above. Equation (6) becomes\begin{equation} y\left ( x\right ) =\int _{0}^{x}G\left ( x,x_{0}\right ) f\left ( x_{0}\right ) dx_{0}+B\frac{\sin x}{\sin L}-A\frac{\sin \left ( x-L\right ) }{\sin L} \tag{8} \end{equation} Now we can do the integration part. Therefore\[ \int _{0}^{x}G\left ( x,x_{0}\right ) f\left ( x_{0}\right ) dx_{0}=\int _{0}^{x}\left ( \frac{\sin \left ( x-L\right ) }{\sin L}\sin x_{0}\right ) f\left ( x_{0}\right ) dx_{0}+\int _{x}^{L}\left ( \frac{\sin x}{\sin L}\sin \left ( x_{0}-L\right ) \right ) f\left ( x_{0}\right ) dx_{0}\] We can test the solution to see if it correct. Let \(f\left ( x\right ) =x\) or \(f\left ( x_{0}\right ) =x_{0}\), hence\begin{align*} \int _{0}^{x}G\left ( x,x_{0}\right ) f\left ( x_{0}\right ) dx_{0} & =\int _{0}^{x}x_{0}\left ( \frac{\sin \left ( x-L\right ) }{\sin L}\sin x_{0}\right ) dx_{0}+\int _{x}^{L}x_{0}\left ( \frac{\sin x}{\sin L}\sin \left ( x_{0}-L\right ) \right ) dx_{0}\\ & =\frac{\sin \left ( x-L\right ) }{\sin L}\int _{0}^{x}x_{0}\sin x_{0}dx_{0}+\frac{\sin x}{\sin L}\int _{x}^{L}x_{0}\sin \left ( x_{0}-L\right ) dx_{0}\\ & =\frac{\sin \left ( x-L\right ) }{\sin L}\left ( -x\cos x+\sin x\right ) +\frac{\sin x}{\sin L}\left ( -L+x\cos \left ( x-L\right ) -\sin \left ( x-L\right ) \right ) \\ & =\frac{-x\cos x\sin \left ( x-L\right ) }{\sin L}+\frac{\sin x\sin \left ( x-L\right ) }{\sin L}-L\frac{\sin x}{\sin L}+\frac{x\cos \left ( x-L\right ) \sin x}{\sin L}-\frac{\sin x\sin \left ( x-L\right ) }{\sin L}\\ & =\frac{-x\cos x\sin \left ( x-L\right ) }{\sin L}-L\frac{\sin x}{\sin L}+\frac{x\cos \left ( x-L\right ) \sin x}{\sin L}\\ & =\frac{1}{\sin L}\left ( -L\sin x+x\cos \left ( x-L\right ) \sin x-x\cos x\sin \left ( x-L\right ) \right ) \end{align*}

Hence the solution is\begin{align*} u\left ( x\right ) & =\frac{1}{\sin L}\left ( -L\sin x+x\cos \left ( x-L\right ) \sin x-x\cos x\sin \left ( x-L\right ) \right ) +\left ( B\frac{\sin x}{\sin L}-A\frac{\sin \left ( x-L\right ) }{\sin L}\right ) \\ & =\frac{1}{\sin L}\left ( -L\sin x+x\cos \left ( x-L\right ) \sin x-x\cos x\sin \left ( x-L\right ) +B\sin x-A\sin \left ( x-L\right ) \right ) \end{align*}

To verify, the problem is solved directly using CAS, and solution above using Green function was compared, same answer confirmed.

pict

2.11.3 Problem 3

\[ \frac{d^{2}u}{dx^{2}}=f\left ( x\right ) ;0<x<L;u\left ( 0\right ) =A;\frac{du}{dx}\left ( L\right ) +hu\left ( L\right ) =0 \] Solution

Compare the above to the standard form\begin{align*} -\frac{d}{dx}\left ( p\frac{du}{dx}\right ) & =f\left ( x\right ) \\ -pu^{\prime \prime } & =f\left ( x\right ) \end{align*}

Therefore\[ p\left ( x\right ) =-1 \] Green function is the solution to\begin{align*} \frac{d^{2}G\left ( x,x_{0}\right ) }{dx^{2}} & =\delta \left ( x-x_{0}\right ) \\ G\left ( 0,x_{0}\right ) & =0\\ \frac{d}{dx}G\left ( L,x_{0}\right ) +hG\left ( L,x_{0}\right ) & =0 \end{align*}

Where \(x_{0}\) is the location of the impulse. Since \(\frac{d^{2}G\left ( x,x_{0}\right ) }{dx^{2}}=0\) for \(x\neq x_{0}\), then the solution to \(\frac{d^{2}G\left ( x,x_{0}\right ) }{dx^{2}}=0\), is broken into two regions\[ G\left ( x,x_{0}\right ) =\left \{ \begin{array} [c]{ccc}A_{1}x+A_{2} & & x<x_{0}\\ B_{1}x+B_{2} & & x_{0}<x \end{array} \right . \] The first boundary condition on the left gives \(A_{2}=0\). Second boundary conditions on the right gives\begin{align*} B_{1}+h\left ( B_{1}L+B_{2}\right ) & =0\\ B_{1}\left ( 1+hL\right ) & =-hB_{2}\\ B_{1} & =\frac{-hB_{2}}{1+hL} \end{align*}

Hence the solution now looks like\[ G\left ( x,x_{0}\right ) =\left \{ \begin{array} [c]{ccc}A_{1}x & & x<x_{0}\\ \left ( \frac{-hB_{2}}{1+hL}\right ) x+B_{2} & & x_{0}<x \end{array} \right . \] But\begin{align*} \left ( \frac{-hB_{2}}{1+hL}\right ) x+B_{2} & =\left ( \frac{-hB_{2}}{1+hL}\right ) x+\frac{B_{2}\left ( 1+hL\right ) }{1+hL}\\ & =\frac{B_{2}\left ( 1+hL-hx\right ) }{1+hL} \end{align*}

Hence\begin{equation} G\left ( x,x_{0}\right ) =\left \{ \begin{array} [c]{ccc}A_{1}x & & x<x_{0}\\ \frac{B_{2}\left ( 1+hL-hx\right ) }{1+hL} & & x_{0}<x \end{array} \right . \tag{1} \end{equation} Continuity at \(x_{0}\) gives\begin{equation} A_{1}x_{0}=\frac{B_{2}\left ( 1+hL-hx_{0}\right ) }{1+hL} \tag{2} \end{equation} And jump discontinuity on derivative of \(G\) gives\begin{align} \frac{B_{2}}{\cos L}\cos \left ( x_{0}-L\right ) -A_{2}\cos x_{0} & =-\frac{1}{p\left ( x\right ) }=1\nonumber \\ \frac{-hB_{2}}{1+hL}-A_{1} & =-\frac{1}{p\left ( x\right ) }=1 \tag{3} \end{align}

We solve (2,3) for \(A_{1},B_{2}\). From (3)\begin{align*} \frac{-hB_{2}}{1+hL}-A_{1} & =1\\ A_{1} & =\frac{-hB_{2}}{1+hL}-1\\ & =\frac{-hB_{2}}{1+hL}-\frac{\left ( 1+hL\right ) }{1+hL}\\ & =\frac{-hB_{2}-1-hL}{1+hL} \end{align*}

Substituting in (2)\begin{align*} \frac{-hB_{2}-1-hL}{1+hL}x_{0} & =\frac{B_{2}\left ( 1+hL-hx_{0}\right ) }{1+hL}\\ \left ( -hB_{2}-1-hL\right ) x_{0} & =B_{2}\left ( 1+hL-hx_{0}\right ) \\ -hB_{2}x_{0}-x_{0}-hLx_{0} & =B_{2}+hLB_{2}-hx_{0}B_{2}\\ B_{2}\left ( -hx_{0}-1-hL+hx_{0}\right ) & =x_{0}+hLx_{0}\\ B_{2} & =\frac{\left ( 1+hL\right ) x_{0}}{-1-hL}\\ & =\frac{-\left ( 1+hL\right ) }{1+hL}x_{0}\\ & =-x_{0} \end{align*}

Hence \begin{align*} A_{1} & =\frac{-hB_{2}-1-hL}{1+hL}\\ & =\frac{-h\left ( -x_{0}\right ) -1-hL}{1+hL}\\ & =\frac{hx_{0}-1-hL}{1+hL}\\ & =\frac{hx_{0}}{1+hL}-\frac{1+hL}{1+hL}\\ & =\frac{hx_{0}}{1+hL}-1 \end{align*}

Therefore (1) becomes\begin{equation} G\left ( x,x_{0}\right ) =\left \{ \begin{array} [c]{ccc}\left ( \frac{hx_{0}}{1+hL}-1\right ) x & & x<x_{0}\\ \frac{-x_{0}\left ( 1+hL-hx\right ) }{1+hL} & & x_{0}<x \end{array} \right . \tag{1} \end{equation} But \begin{align*} \frac{-x_{0}\left ( 1+hL-hx\right ) }{1+hL} & =x_{0}\frac{\left ( -1-hL+hx\right ) }{1+hL}\\ & =x_{0}\left ( \frac{hx}{1+hL}-\frac{1+hL}{1+hL}\right ) \\ & =x_{0}\left ( \frac{hx}{1+hL}-1\right ) \end{align*}

Hence (1) becomes\begin{equation} G\left ( x,x_{0}\right ) =\left \{ \begin{array} [c]{ccc}\left ( \frac{hx_{0}}{1+hL}-1\right ) x & & x<x_{0}\\ \left ( \frac{hx}{1+hL}-1\right ) x_{0} & & x_{0}<x \end{array} \right . \tag{2} \end{equation} We see they are symmetrical in \(x,x_{0}\). Here is a plot of \(G\left ( x,x_{0}\right ) \) for some arbitrary \(x_{0}\) located at \(x=0.75,h=1,\) for \(L=1\).

pict

We need to find the solution using\begin{equation} y\left ( x\right ) =\int _{0}^{x}G\left ( x,x_{0}\right ) f\left ( x_{0}\right ) dx_{0}+p\left ( x_{0}\right ) \left [ G\left ( x,x_{0}\right ) \frac{du\left ( x_{0}\right ) }{dx_{0}}-u\left ( x_{0}\right ) \frac{dG\left ( x,x_{0}\right ) }{dx_{0}}\right ] _{x_{0}=0}^{x_{0}=L} \tag{3} \end{equation} The first step is to find \(\frac{dG\left ( x,x_{0}\right ) }{dx_{0}}\). From (2), we find\begin{equation} \frac{dG\left ( x,x_{0}\right ) }{dx_{0}}=\left \{ \begin{array} [c]{ccc}\frac{hx}{1+hL} & & x<x_{0}\\ \frac{hx}{1+hL}-1 & & x_{0}<x \end{array} \right . \tag{4} \end{equation} Now we plug everything in (3). But remember that \(G\left ( 0,x_{0}\right ) =0,\frac{dG\left ( L,x_{0}\right ) }{dx}=-hG\left ( L,x_{0}\right ) ,u\left ( 0\right ) =A,\frac{du\left ( L\right ) }{dx}=-hu\left ( L\right ) \,.\) Hence\begin{align*} \Delta & =\left [ G\left ( x,x_{0}\right ) \frac{du\left ( x_{0}\right ) }{dx_{0}}-u\left ( x_{0}\right ) \frac{dG\left ( x,x_{0}\right ) }{dx_{0}}\right ] _{x_{0}=0}^{x_{0}=L}\\ & =G\left ( x,L\right ) \frac{du\left ( L\right ) }{dx_{0}}-u\left ( L\right ) \frac{dG\left ( x,L\right ) }{dx_{0}}-G\left ( x,0\right ) \frac{du\left ( 0\right ) }{dx_{0}}+u\left ( 0\right ) \frac{dG\left ( x,0\right ) }{dx_{0}}\\ & =G\left ( x,L\right ) \left ( -hu\left ( L\right ) \right ) -u\left ( L\right ) \left ( -hG\left ( x_{0},L\right ) \right ) -0+\left ( A\right ) \left ( \frac{dG\left ( x,0\right ) }{dx_{0}}\right ) \\ & =\overset{0}{\overbrace{-G\left ( x,L\right ) hu\left ( L\right ) +u\left ( L\right ) hG\left ( x,L\right ) }}+A\left ( \frac{hx}{1+hL}-1\right ) _{x_{0}=0}\\ & =A\left ( \frac{hx}{1+hL}-1\right ) \end{align*}

Now we do the integration, From (3), and since \(p=-1\) then we obtain\begin{align*} y\left ( x\right ) & =\int _{0}^{x}G\left ( x,x_{0}\right ) f\left ( x_{0}\right ) dx_{0}-A\left ( \frac{hx}{1+hL}-1\right ) \\ & =\overset{\text{particular solution}}{\overbrace{\int _{0}^{x}G\left ( x,x_{0}\right ) f\left ( x_{0}\right ) dx_{0}+\int _{x}^{L}G\left ( x,x_{0}\right ) f\left ( x_{0}\right ) dx_{0}}}-\overset{\text{boundary terms}}{\overbrace{A\left ( \frac{hx}{1+hL}-1\right ) }} \end{align*}

We see that the boundary terms are linear combination \(x\), which is expected as the fundamental solutions for the homogenous solution as linear in \(x\) as was found initially above. Plugging values From (3) for \(G\left ( x,x_{0}\right ) \) for each region into the above gives\[ y\left ( x\right ) =\int _{0}^{x}\left ( \frac{hx}{1+hL}-1\right ) x_{0}f\left ( x_{0}\right ) dx_{0}+\int _{x}^{L}\left ( \frac{hx_{0}}{1+hL}-1\right ) xf\left ( x_{0}\right ) dx_{0}-A\left ( \frac{hx}{1+hL}-1\right ) \] This completes the solution. Now we should test it. Let \(f\left ( x\right ) =x\) or \(f\left ( x_{0}\right ) =x_{0}\) and compare to direction solution. The above becomes

\begin{align*} y\left ( x\right ) & =\left ( \frac{hx}{1+hL}-1\right ) \int _{0}^{x}x_{0}^{2}dx_{0}+x\int _{x}^{L}\left ( \frac{hx_{0}}{1+hL}-1\right ) x_{0}dx_{0}-A\left ( \frac{hx}{1+hL}-1\right ) \\ & =\left ( \frac{hx}{1+hL}-1\right ) \left ( \frac{x_{0}^{3}}{3}\right ) _{0}^{x}+x\int _{x}^{L}\left ( \frac{hx_{0}^{2}}{1+hL}-x_{0}\right ) dx_{0}-A\left ( \frac{hx}{1+hL}-1\right ) \\ & =\left ( \frac{hx}{1+hL}-1\right ) \left ( \frac{x^{3}}{3}\right ) +x\left ( \frac{h}{1+hL}\frac{x_{0}^{3}}{3}-\frac{x_{0}^{2}}{2}\right ) _{x}^{L}-A\left ( \frac{hx}{1+hL}-1\right ) \\ & =\left ( \frac{hx}{1+hL}-1\right ) \left ( \frac{x^{3}}{3}\right ) +x\left ( \frac{h}{1+hL}\frac{L^{3}}{3}-\frac{L^{2}}{2}-\frac{h}{1+hL}\frac{x^{3}}{3}+\frac{x^{2}}{2}\right ) -A\left ( \frac{hx}{1+hL}-1\right ) \\ & =\frac{1}{6\left ( 1+Lh\right ) }\left ( -hL^{3}x-3L^{2}x+hLx^{3}+x^{3}\right ) -A\left ( \frac{hx}{1+hL}-1\right ) \\ & =\frac{1}{6\left ( 1+Lh\right ) }\left ( x^{3}\left ( 1+hL\right ) -x\left ( hL^{3}+3L^{2}\right ) \right ) +A\left ( 1-\frac{hx}{1+hL}\right ) \\ & =\frac{1}{6\left ( 1+Lh\right ) }\left ( x^{3}\left ( 1+hL\right ) -xL^{2}\left ( hL+3\right ) \right ) +A\left ( \frac{1+h\left ( L-x\right ) }{1+hL}\right ) \end{align*}

To verify, the problem is solved directly, and solution above using Green function was compared, same answer confirmed.

pict

2.11.4 Problem 4

\[ u^{\prime \prime }+2u^{\prime }+u=f\left ( x\right ) ;0<x<L;u\left ( 0\right ) =0;u\left ( L\right ) =1 \] Solution

Since the coefficient on \(u^{\prime }\) is \(2\), then the Integrating factor is \(\mu \left ( x\right ) =e^{\int 2dx}=e^{2x}\). Multiplying the ODE by \(\mu \left ( x\right ) \) gives\begin{align*} e^{2x}u^{\prime \prime }+2e^{2x}u^{\prime }+e^{2x}u & =e^{2x}f\left ( x\right ) \\ \frac{d}{dx}\left ( e^{2x}u^{\prime }\right ) +e^{2x}u & =e^{2x}f\left ( x\right ) \end{align*}

To keep the solution consistent with the class notes, we now multiply both sides by \(-1\) in order to obtain the same form as used in class notes. Hence our ODE is\[ -\frac{d}{dx}\left ( e^{2x}u^{\prime }\right ) -e^{2x}u=-e^{2x}f\left ( x\right ) \] We now see from above that \[ p\left ( x\right ) =e^{2x}\] Once we found \(p\left ( x\right ) \), we now find the Green function. The Green function is the solution to\begin{align*} \frac{d^{2}G\left ( x,x_{0}\right ) }{dx^{2}}+2\frac{dG\left ( x,x_{0}\right ) }{dx}+G\left ( x,x_{0}\right ) & =\delta \left ( x-x_{0}\right ) \\ G\left ( 0,x_{0}\right ) & =0\\ G\left ( L,x_{0}\right ) & =0 \end{align*}

Where \(x_{0}\) is the location of the impulse. We first need to find fundamental solutions to the homogeneous ODE. The solution to\(\ u^{\prime \prime }+2u^{\prime }+u=0\) is found by characteristic method. \(r^{2}+2r+1=0\), hence \(\left ( r+1\right ) ^{2}=0\). Therefore the roots are \(r=-1\), double root. Hence the fundamental solutions are \begin{align*} u_{1} & =e^{-x}\\ u_{2} & =xe^{-x} \end{align*}

Therefore\begin{align*} G\left ( x,x_{0}\right ) & =\left \{ \begin{array} [c]{ccc}A_{1}u_{1}+A_{2}u_{2} & & x<x_{0}\\ B_{1}u_{1}+B_{2}u_{2} & & x>x_{0}\end{array} \right . \\ & =\left \{ \begin{array} [c]{ccc}A_{1}e^{-x}+A_{2}xe^{-x} & & x<x_{0}\\ B_{1}e^{-x}+B_{2}xe^{-x} & & x>x_{0}\end{array} \right . \end{align*}

The first boundary condition on the left end gives \(A_{1}=0\) from the first region. The second B.C. on the right end, gives \begin{align*} B_{1}e^{-L}+B_{2}Le^{-L} & =0\\ B_{1} & =-\frac{B_{2}Le^{-L}}{e^{-L}}=-B_{2}L \end{align*}

Hence the above solution now reduces to\[ G\left ( x,x_{0}\right ) =\left \{ \begin{array} [c]{ccc}A_{2}xe^{-x} & & x<x_{0}\\ -B_{2}Le^{-x}+B_{2}xe^{-x} & & x>x_{0}\end{array} \right . \] Simplifying \(-B_{2}Le^{-x}+B_{2}xe^{-x}=B_{2}\left ( x-L\right ) e^{-x}\), the above can be written as\begin{equation} G\left ( x,x_{0}\right ) =\left \{ \begin{array} [c]{ccc}A_{2}xe^{-x} & & x<x_{0}\\ B_{2}\left ( x-L\right ) e^{-x} & & x>x_{0}\end{array} \right . \tag{1} \end{equation} Continuity at \(x_{0}\) gives\begin{align} A_{2}x_{0}e^{-x_{0}} & =B_{2}\left ( x_{0}-L\right ) e^{-x_{0}}\nonumber \\ A_{2}x_{0} & =B_{2}\left ( x_{0}-L\right ) \tag{2} \end{align}

And jump discontinuity on derivative of \(G\) gives\[ \frac{d}{dx}G\left ( x,x_{0}\right ) =\left \{ \begin{array} [c]{ccc}A_{2}\left ( e^{-x}-xe^{-x}\right ) & & x<x_{0}\\ B_{2}\left ( 1-x+L\right ) e^{-x} & & x>x_{0}\end{array} \right . \] Hence (important note: we use\(\ \frac{-1}{p\left ( x_{0}\right ) }\) below and not \(\frac{1}{p\left ( x_{0}\right ) }\) because we started with \(\frac{-d}{dx}\left ( p\frac{dy}{dx}\right ) +\cdots \) instead of \(+\frac{d}{dx}\left ( p\frac{dy}{dx}\right ) +\cdots \) )\[ B_{2}\left ( 1-x_{0}+L\right ) e^{-x_{0}}-A_{2}\left ( e^{-x_{0}}-x_{0}e^{-x_{0}}\right ) =\frac{-1}{p\left ( x_{0}\right ) }=\frac{-1}{e^{2x_{0}}}=-e^{-2x_{0}}\] Dividing by \(e^{-x_{0}}\) to simplify gives\begin{equation} B_{2}\left ( 1-x_{0}+L\right ) -A_{2}\left ( 1-x_{0}\right ) =-e^{-x_{0}} \tag{3} \end{equation} We solve (2,3) for \(A_{1},B_{2}\). From (3)\begin{equation} B_{2}=\frac{-e^{-x_{0}}+A_{2}\left ( 1-x_{0}\right ) }{1-x_{0}+L} \tag{4} \end{equation} Substituting in (2)\begin{align*} A_{2}x_{0} & =\frac{-e^{-x_{0}}+A_{2}\left ( 1-x_{0}\right ) }{1-x_{0}+L}\left ( x_{0}-L\right ) \\ A_{2}x_{0}\left ( 1-x_{0}+L\right ) & =-e^{-x_{0}}\left ( x_{0}-L\right ) +A_{2}\left ( 1-x_{0}\right ) \left ( x_{0}-L\right ) \\ A_{2}\left ( x_{0}\left ( 1-x_{0}+L\right ) -\left ( 1-x_{0}\right ) \left ( x_{0}-L\right ) \right ) & =-e^{-x_{0}}\left ( x_{0}-L\right ) \\ A_{2} & =\frac{-e^{-x_{0}}\left ( x_{0}-L\right ) }{x_{0}\left ( 1-x_{0}+L\right ) -\left ( 1-x_{0}\right ) \left ( x_{0}-L\right ) }\\ & =\frac{1}{L}e^{-x_{0}}\left ( L-x_{0}\right ) \end{align*}

Hence, from (4)\begin{align*} B_{2} & =\frac{-e^{-x_{0}}+\left ( \frac{1}{L}e^{-x_{0}}\left ( L-x_{0}\right ) \right ) \left ( 1-x_{0}\right ) }{1-x_{0}+L}\\ & =-\frac{1}{L}x_{0}e^{-x_{0}} \end{align*}

Therefore the solution (1) becomes

\begin{equation} G\left ( x,x_{0}\right ) =\left \{ \begin{array} [c]{ccc}\frac{1}{L}e^{-x_{0}}\left ( L-x_{0}\right ) xe^{-x} & & x<x_{0}\\ \frac{1}{L}x_{0}e^{-x_{0}}\left ( L-x\right ) e^{-x} & & x>x_{0}\end{array} \right . \tag{5} \end{equation} Or\begin{equation} G\left ( x,x_{0}\right ) =\left \{ \begin{array} [c]{ccc}\frac{\left ( L-x_{0}\right ) }{L}xe^{-x_{0}-x} & & x<x_{0}\\ \frac{\left ( L-x\right ) }{L}x_{0}e^{-x_{0}-x} & & x>x_{0}\end{array} \right . \tag{5} \end{equation} We see they are symmetrical in \(x,x_{0}\).  Here is a plot of \(G\left ( x,x_{0}\right ) \) for some arbitrary \(x_{0}\) located at \(x=0.75\ \)for \(L=1\).

pict

We now need to find the solution using\begin{equation} y\left ( x\right ) =\overset{\text{particular solution}}{\overbrace{\int _{0}^{x}G\left ( x,x_{0}\right ) f\left ( x_{0}\right ) dx_{0}}}+\overset{\text{homogeneous solution/boundary terms}}{\overbrace{\left [ p\left ( x_{0}\right ) G\left ( x,x_{0}\right ) \frac{du\left ( x_{0}\right ) }{dx_{0}}-p\left ( x_{0}\right ) u\left ( x_{0}\right ) \frac{dG\left ( x,x_{0}\right ) }{dx_{0}}\right ] _{x_{0}=0}^{x_{0}=L}}} \tag{6} \end{equation} The first step is to find \(\frac{dG\left ( x,x_{0}\right ) }{dx_{0}}\). From (5), we find\begin{equation} \frac{dG\left ( x,x_{0}\right ) }{dx_{0}}=\left \{ \begin{array} [c]{ccc}-\frac{xe^{-x-x_{0}}}{L}-\frac{xe^{-x-x_{0}}\left ( L-x_{0}\right ) }{L} & & x<x_{0}\\ \frac{e^{-x-x_{0}}\left ( L-x\right ) }{L}-\frac{\left ( L-x\right ) x_{0}e^{-x-x_{0}}}{L} & & x>x_{0}\end{array} \right . \tag{7} \end{equation} Now we plug everything in (3). But remember that \(G\left ( x,0\right ) =0,G\left ( x,L\right ) =0,u\left ( 0\right ) =0,u\left ( L\right ) =1,p\left ( x\right ) =e^{2x}\,.\) The following is the result of the homogeneous part \begin{align*} \Delta & =\left [ p\left ( x_{0}\right ) G\left ( x,x_{0}\right ) \frac{du\left ( x_{0}\right ) }{dx_{0}}-p\left ( x_{0}\right ) u\left ( x_{0}\right ) \frac{dG\left ( x,x_{0}\right ) }{dx_{0}}\right ] _{x_{0}=0}^{x_{0}=L}\\ & =\left ( e^{2L}\right ) G\left ( x,L\right ) \frac{du\left ( L\right ) }{dx_{0}}-\left ( e^{2L}\right ) u\left ( L\right ) \frac{dG\left ( x,L\right ) }{dx_{0}}-\left ( e^{2\left ( 0\right ) }\right ) G\left ( x,0\right ) \frac{du\left ( 0\right ) }{dx_{0}}+\left ( e^{2\left ( 0\right ) }\right ) u\left ( 0\right ) \frac{dG\left ( x,0\right ) }{dx_{0}}\\ & =0-e^{2L}\left ( 1\right ) \overset{x<x_{0}\text{ branch from (7)}}{\overbrace{\left ( -\frac{xe^{-x-x_{0}}}{L}-\frac{xe^{-x-x_{0}}\left ( L-x_{0}\right ) }{L}\right ) }}_{x_{0}=L}-0+\left ( 0\right ) \\ & =-e^{2L}\left ( -\frac{xe^{-x-L}}{L}-\frac{xe^{-x-L}\left ( L-L\right ) }{L}\right ) \\ & =e^{2L}\left ( \frac{xe^{-x-L}}{L}\right ) \\ & =\frac{xe^{L-x}}{L} \end{align*}

Now we complete the integration, From (3) \begin{align*} u\left ( x\right ) & =\overset{\text{particular}}{\overbrace{\int _{0}^{x}G\left ( x,x_{0}\right ) f\left ( x_{0}\right ) dx_{0}}}+\overset{\text{homogeneous}}{\overbrace{\left ( \frac{xe^{L-x}}{L}\right ) }}\\ & =\int _{0}^{x}G\left ( x,x_{0}\right ) f\left ( x_{0}\right ) dx_{0}+\int _{x}^{L}G\left ( x,x_{0}\right ) f\left ( x_{0}\right ) dx_{0}+\frac{xe^{L-x}}{L} \end{align*}

Plug-in in values From (5)\(\ G\left ( x,x_{0}\right ) \) for each region, \[ u\left ( x\right ) =\int _{0}^{x}\overset{\text{from }x>x_{0}\text{ branch in (5)}}{\overbrace{\left ( \frac{\left ( L-x\right ) }{L}x_{0}e^{-x_{0}-x}\right ) }}g\left ( x_{0}\right ) dx_{0}+\int _{x}^{L}\overset{\text{from }x<x_{0}\text{ branch in (5)}}{\overbrace{\left ( \frac{\left ( L-x_{0}\right ) }{L}xe^{-x_{0}-x}\right ) }}g\left ( x_{0}\right ) dx_{0}+\frac{1}{L}xe^{-x+L}\] This completes the solution. Now we should test it. Let \(f\left ( x\right ) =x\) or \(f\left ( x_{0}\right ) =x_{0}\). But since we multiplied by \(-e^{2x}\) (integrating factor) at start, we should now use \(g\left ( x_{0}\right ) =-e^{2x_{0}}x_{0}\) as \(f\left ( x_{0}\right ) \) below.The above becomes\begin{align} u\left ( x\right ) & =\int _{0}^{x}\left ( \frac{\left ( L-x\right ) }{L}x_{0}e^{-x_{0}-x}\right ) \left ( -e^{2x_{0}}x_{0}\right ) dx_{0}+\int _{x}^{L}\left ( \frac{\left ( L-x_{0}\right ) }{L}xe^{-x_{0}-x}\right ) \left ( -e^{2x_{0}}x_{0}\right ) dx_{0}+\frac{xe^{L-x}}{L}\nonumber \\ & =-\frac{\left ( L-x\right ) e^{-x}}{L}\int _{0}^{x}x_{0}^{2}e^{x_{0}}dx_{0}-\frac{xe^{-x}}{L}\int _{x}^{L}\left ( L-x_{0}\right ) x_{0}e^{x_{0}}dx_{0}+\frac{xe^{L-x}}{L} \tag{8} \end{align}

But \begin{align*} \int _{0}^{x}x_{0}^{2}e^{x_{0}}dx_{0} & =-2+e^{x}\left ( 2+x^{2}-2x\right ) \\ \int _{x}^{L}e^{x_{0}}\left ( L-x_{0}\right ) x_{0}dx_{0} & =e^{L}\left ( L-2\right ) +e^{x}\left ( 2+L-2x-Lx+x^{2}\right ) \end{align*}

Hence  (8) becomes\[ u\left ( x\right ) =-\frac{\left ( L-x\right ) e^{-x}}{L}\left ( -2+e^{x}\left ( 2+x^{2}-2x\right ) \right ) -\frac{xe^{-x}}{L}\left ( e^{L}\left ( L-2\right ) +e^{x}\left ( 2+L-2x-Lx+x^{2}\right ) \right ) +\frac{xe^{L-x}}{L}\] Which can be simplified to\[ u\left ( x\right ) =\frac{1}{L}e^{-x}\left ( \left ( 3e^{L}-2\right ) x+L\left ( 2+e^{x}\left ( x-2\right ) -xe^{L}\right ) \right ) \]

For \(L=1\), the above becomes

\[ u\left ( x\right ) =x-2\frac{x}{e^{x}}+\frac{2}{e^{x}}+2x\frac{e}{e^{x}}-2 \]

Verification

To verify the above, a plot of the solution was compare to Mathematica result. Here is plot of the result. My solution gives exact plot as Mathematica.

pict

pict