6.9 Example 10. \(xy^{\prime }+y=3+x\)

\begin{equation} xy^{\prime }+y=3+x\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}\) we 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 above example, but now with \(3+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}=3+x\tag {3A}\end{equation}

Because RHS has more than one term, we have to solve for each term on its own at a time. Looking at first term the above becomes

\begin{equation} \sum _{n=0}^{\infty }\left ( n+r\right ) c_{n}x^{n+r}+\sum _{n=0}^{\infty }c_{n}x^{n+r}=3\tag {3A}\end{equation}

For \(n=0\)

\begin{align*} rc_{0}x^{r}+c_{0}x^{r} & =3\\ \left ( r+1\right ) c_{0}x^{r} & =3 \end{align*}

For balance \(r=0\). And \(\left ( r+1\right ) c_{0}=3\) or \(c_{0}=3\). Hence (3A) becomes

\begin{equation} \sum _{n=0}^{\infty }nc_{n}x^{n}+\sum _{n=0}^{\infty }c_{n}x^{n}=3\tag {3B}\end{equation}

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 for all \(n>0\) then \(\left ( n+1\right ) c_{n}=0\) or \(c_{n}=0\) for all \(n>0\). Hence \(y_{p_{1}}\) that corresponds to \(3\) is

\begin{align*} y_{p_{1}} & =\sum _{n=0}^{\infty }c_{n}x^{n+r}\\ & =\sum _{n=0}^{\infty }c_{n}x^{n}\\ & =3 \end{align*}

Now we go back and process the second term on the right side, (3A) now becomes

\begin{equation} \sum _{n=0}^{\infty }\left ( n+r\right ) c_{n}x^{n+r}+\sum _{n=0}^{\infty }c_{n}x^{n+r}=x\tag {3A}\end{equation}

For \(n=0\)

\begin{align*} rc_{0}x^{r}+c_{0}x^{r} & =x\\ \left ( r+1\right ) c_{0}x^{r} & =x \end{align*}

For balance \(r=1\). And \(\left ( r+1\right ) c_{0}=1\) or \(c_{0}=\frac {1}{2}\). Hence (3A) becomes

\begin{equation} \sum _{n=0}^{\infty }\left ( n+1\right ) c_{n}x^{n+1}+\sum _{n=0}^{\infty }c_{n}x^{n+1}=x\tag {3B}\end{equation}

The recursive relation for \(n>0\) is

\begin{align} \left ( n+1\right ) c_{n}x^{n+1}+c_{n}x^{n+1} & =0\nonumber \\ \left ( n+2\right ) c_{n}x^{n+1} & =0\tag {3C}\end{align}

We see that for all \(n>0\) then \(\left ( n+2\right ) c_{n}=0\) or \(c_{n}=0\) for all \(n>0\). Hence \(y_{p_{2}}\) that corresponds to \(x\) is

\begin{align*} y_{p_{1}} & =\sum _{n=0}^{\infty }c_{n}x^{n+r}\\ & =\sum _{n=0}^{\infty }c_{n}x^{n+1}\\ & =\frac {1}{2}x \end{align*}

Hence the particular solution solution is

\begin{align*} y_{p} & =y_{p_{1}}+y_{p_{2}}\\ & =3+\frac {1}{2}x \end{align*}

And the complete solution is

\begin{align*} y & =y_{h}+y_{p}\\ & =\frac {a_{0}}{x}+3+\frac {1}{2}x \end{align*}