[tex]y''-y=0\implies r^2-1=0\implies r=\pm1[/tex]
[tex]\implies y_c=C_1e^x+C_2e^{-x}={C^*}_1\underbrace{\cosh x}_{y_1}+{C^*}_2\underbrace{\sinh x}_{y_2}[/tex]
For the nonhomogeneous ODE
[tex]y''-y=\underbrace{\cosh x}_{f(x)}[/tex]
we're looking for a particular solution of the form
[tex]y_p=u_1y_1+u_2y_2[/tex]
where
[tex]u_1=-\displaystyle\int\frac{y_2(x)f(x)}{W(y_1(x),y_2(x))}\,\mathrm dx[/tex]
[tex]u_2=\displaystyle\int\frac{y_1(x)f(x)}{W(y_1(x),y_2(x))}\,\mathrm dx[/tex]
and [tex]W(y_1,y_2)[/tex] is the Wronskian of the two fundamental solutions.
We have
[tex]W(y_1,y_2)=\begin{vmatrix}\cosh x&\sinh x\\\sinh x&\cosh x\end{vmatrix}=\cosh^2x-\sinh^2x=1[/tex]
so we're left with
[tex]u_1=-\displaystyle\int\sinh x\cosh x\,\mathrm dx=-\dfrac12\cosh^2x[/tex]
[tex]u_2=\displaystyle\int\cosh^2x\,\mathrm dx=\dfrac12x+\dfrac14\sinh2x[/tex]
so that the particular solution is
[tex]y_p=-\dfrac12\cosh^3x+\dfrac12x\sinh x+\dfrac14\sinh x\sinh2x[/tex]
[tex]y_p=-\dfrac12\cosh x+\dfrac12x\sinh x[/tex]
As [tex]y_1[/tex] already accounts for the [tex]\cosh x[/tex] term in [tex]y_p[/tex], we're left with the general solution
[tex]y=C_1\cosh x+C_2\sinh x+\dfrac12x\sinh x[/tex]