1.3.9 Example 9. \(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 will use the balance equation, EQ (*) found in the first example when finding \(y_{h}\). We just need to rename \(a_{0}\) to \(c_{0}\) and add the \(x\) on the right side of the balance equation.

\[ \left ( r+1\right ) c_{0}x^{r}=3+x \]

For each term on the right side, there is different balance equation. Hence we have

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

Each one equation above, gives different \(y_{p}\) then at the end we will add them all. Starting with (2)

\[ \left ( r+1\right ) c_{0}x^{r}=3 \]

Hence \(r=0\), therefore \(\left ( r+1\right ) c_{0}=3\) or \(c_{0}=3\). Hence the first particular solution is \(y_{p_{1}}=3\). Now we will look at (3)

\[ \left ( r+1\right ) c_{0}x^{r}=x \]

Hence \(r=1\), therefore \(\left ( r+1\right ) c_{0}=1\) or \(c_{0}=\frac {1}{2}\). Hence the second particular solution is \(y_{p_{2}}=\frac {1}{2}x\). Adding all the particular solutions gives

\[ y_{p}=2+\frac {1}{2}x \]

The complete solution is

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