Solve the differential equation using power series method Solve the differential equation using power series method.
$$y^{''}-y=x$$
The given equation can be written as:
$y^{''} - y - x=0$.
I don't know how to use power series method when $x$ is standalone i.e. without $y$.
 A: Let the coefficients of the power series of $y$ be denoted by $(y_0, y_1, \ldots)$.
Remembering that the derivative shifts the coefficients of the power sequence one to the left, we know that the coefficients of $y''$ must be $(y_2, y_3, \ldots)$.
The coefficients of $x$ are of course $(0,1,0,\ldots)$.
Therefore, $y''-y-x=0$ translates to $$
  (y_2-y_0,\, y_3-y_1-1,\, y_4-y_2,\, y_5-y_3,\, \ldots) = (0,0,0,0,\ldots).
$$
This gives us the constraints $y_{2k}=y_0$ and $y_{2k+1}=y_1+1$ whenever $k\geq 1$.
Splitting up the coefficients of $y$ in the even and the odd part, we get that
\begin{align*}
  (y_i)_i &= (y_0,0,y_0,0,\ldots) + (0,y_1,0,y_1+1,0,y_1+1,\ldots)\\
  &= y_0(1,0,1,0,\ldots) - (0,1,0,0,\ldots) + (y_1+1)(0,1,0,1,\ldots).
\end{align*}
We now recall that the function corresponding to the taylor series of even exponents $(1,0,1,\ldots)$ is $\cosh(x)$ and that of $(0,1,0,\ldots)$ is $\sinh x$.  Therefore, our solution must be of the form $y(x)=y_0\cosh x-x+(y_1+1)\sinh x$, or, since $y_1+1$ ranges over all real numbers, $$
y(x) = A\sinh x + B\cosh x - x
$$ for all real numbers $A, B$. Since the second derivatives of $\sinh$ and $\cosh$ are the same, every function of this form is indeed a solution.
In terms of initial conditions $y'(0) = u$ and $y(0) = v$, we have $u = A\cosh 0 + B\sinh 0 - 1 = A - 1$, hence $A = u+1$, and $v = A\sinh 0 + B\cosh 0 - 0 = B$. Our solution now reads
$$
y(x) = (u+1)\sinh x + v\cosh x - x, \qquad u = y'(0),\: v=y(0).
$$
