6.3 Example 3. \(xy^{\prime }+y=1\)
\begin{equation} xy^{\prime }+y=1\tag {1}\end{equation}
This is same as example 1, but with nonzero on RHS. The solution is \(y=y_{h}+y_{p}\). Where \(y_{h}\) was found above as
\[ y_{h}=\frac {a_{0}}{x}\]
To find \(y_{p}\) assume it has power series
\[ y_{p}=\sum _{n=0}^{\infty }c_{n}x^{n+r}\]
Substituting the above into the ode and simplifying as we did in first example gives EQ. (3) in the first example, but now with \(x\) on RHS
\begin{equation} \sum _{n=0}^{\infty }\left ( n+r\right ) c_{n}x^{n+r}+\sum _{n=0}^{\infty }c_{n}x^{n+r}=1\tag {3A}\end{equation}
For \(n=0\)
\begin{align*} rc_{0}x^{r}+c_{0}x^{r} & =x^{0}\\ \left ( rc_{0}+c_{0}\right ) x^{r} & =x^{0}\end{align*}
For balance \(r=0\). And \(rc_{0}+c_{0}=1\) or \(c_{0}=1\). Hence (3A) becomes
\begin{equation} \sum _{n=0}^{\infty }nc_{n}x^{n}+\sum _{n=0}^{\infty }c_{n}x^{n}=1\tag {3B}\end{equation}
Now that we used \(n=0\) to find \(r\) by matching against the RHS which is \(1\), from now on, for all \(n>0\) we will use (3B) to solve for all other \(c_{n}\). From now on, we just need to solve with RHS zero, since there can be no more matches for any \(x^{n}\) on the right. The recursive relation for \(n>0\) is
\begin{align} nc_{n}x^{n}+c_{n}x^{n} & =0\nonumber \\ \left ( n+1\right ) c_{n}x^{n} & =0\tag {3C}\end{align}
We see that this implies \(\left ( n+1\right ) c_{n}=0\) for all \(n>0\), or \(c_{n}=0\). Therefore
\begin{align*} y_{p} & =\sum _{n=0}^{\infty }c_{n}x^{n+r}\\ & =\sum _{n=0}^{\infty }c_{n}x^{n}\\ & =c_{0}\\ & =1 \end{align*}
Therefore
\begin{align*} y & =y_{h}+y_{p}\\ & =\frac {a_{0}}{x}+1 \end{align*}