Construct the green's function for the following boundary value problem and use it to find the solution of $$y''-y=t^2,\quad y(0)=0,y(1)=0$$
I got the complementary solution as: $$y_c=c_1e^t+c_2e^{-t}$$ Following this answer, let $y_1=e^t$ and $y_2=e^{-t}$. Then $$\textrm{Wronskian}=W(y_1,y_2)=-2$$
$$G(t,u)=\frac{y_1(u)y_2(t)-y_1(t)y_2(u)}{W(y_1,y_2)}=\frac{e^ue^{-t}-e^te^{-u}}{-2}$$ Thus, $$ \begin{align} y_p&=\int_0^tG(t,u)f(u)\:du\\ &=\int _0^t\:\left(\frac{e^ue^{-t}-e^te^{-u}}{-2}\cdot \:u^2\right)\:du\\ &=e^{-t}\left(-2e^t-t^2e^t+e^{2t}+1\right) \end{align} $$
But the solution mentioned in the book was, $$-\frac{\sinh (1-t)}{\sinh 1}\left[t^2\cosh t-2t\sinh t+2\cosh t-2\right]-\frac{\sinh t}{\sinh 1}\left[t^2\cosh(1-t)+2t\sinh (1-t)+2\cosh(1-t)-3\right]$$
Did I do anything wrong when following that answer? Any help will be appreciated.