I am attempting to solve the non-homogeneous differential equation $(1-x^2)y'' + y' + y = xe^x$ via power series solution, but am running into an issue once I have expanded all the necessary terms and combined all series with like powers of $x$ into a common series. Please allow me to elaborate further.
The differential equation $(1-x^2)y'' + y' + y = xe^x$ can be represented in the following power series form:
$$\sum_{n=2}^{\infty}c_nn(n-1)x^{n-2} - \sum_{n=2}^{\infty}c_nn(n-1)x^{n}+ \sum_{n=1}^{\infty}c_nnx^{n-1}+\sum_{n=0}^{\infty}c_nx^{n} = x\sum_{n=0}^{\infty}\frac{x^n}{n!}$$
These terms will hereafter be referred to as terms 1, 2, 3, 4, and sum, respectively.
My aim was to convert all powers of $x$ to the like power of $x^n$, however I feel this may be the decision that resulted in issues further down the road. Note that the highest index of a $x^n$ term is found in term 2, therefore all other terms will be expanded to put their summations in a form with an index of 2.
To convert term 1 to a like power of $x$, the substitution $n = n+2$ was made. The series was then expanded to an index of 2. The resulting series is as follows:
$$\sum_{n=2}^{\infty}c_nn(n-1)x^{n-2} = \sum_{n=0}^{\infty}c_{n+2}(n+2)(n+1)x^{n} = 2c_2 + 6c_3x + \sum_{n=2}^{\infty}c_{n+2}(n+2)(n+1)x^{n}$$
Term 2 is already in the form of a like power of $x$ with a common index of 2.
To convert term 3 to a like power of $x$, the substitution $n = n+1$ was made. The series was then expanded to an index of 2. The resulting series is as follows:
$$\sum_{n=1}^{\infty}c_nnx^{n-1} = \sum_{n=0}^{\infty}c_{n+1}(n+1)x^{n} = c_1 + 2c_2x + \sum_{n=2}^{\infty}c_{n+1}(n+1)x^{n}$$
Term 4 is already in the form of a like power of $x$, however does not share a common index. The series was expanded to an index of 2. The resulting series is as follows:
$$\sum_{n=0}^{\infty}c_nx^{n} = c_0 + c_1x + \sum_{n=2}^{\infty}c_nx^{n}$$
The sum term is already in the form of a like power of $x$, however it does not share the common index of 2. The series was expanded to an index of 2. The resulting series is as follows:
$$x\sum_{n=0}^{\infty}\frac{x^n}{n!} = x + x^2 + x\sum_{n=2}^{\infty}\frac{x^n}{n!}$$
Combining all of these terms and like power series, the result is as follows:
$$c_0 + c_1 + 2c_2 + x(c_1 + 2c_2 + 6c_3) + \sum_{n=2}^{\infty}(c_{n+2}(n+2)(n+1) + c_{n+1}(n+1) + c_n(2-n))x^{n} = x + x^2 + x\sum_{n=2}^{\infty}\frac{x^n}{n!}$$
This is where the issue is found. The $0$th order constant terms can be equated to $0$, and the $1$st order constant terms can be equated to $1$. However, there are no terms on the left hand side of the equation that will equal the $x^2$ term on the right hand side, unless the series is expanded, resulting in a loss of common indices between the two series. The series is also problematic, as the internal constant expression on the left hand side can be evaluated to $\frac{1}{n!}$, but the series will never be equal due to the $x$ multiplier on the right hand side. In summary, I appear to be missing a power of $x$ on the left hand side of my equation.
As stated earlier, I have an inclination that my choice to set the common power of $x$ to $x^n$ may have been a mistake. If the $x$ is factored into the series expression for $e^x$, the power of $x$ would be $x^{n+1}$, which could potentially resolve my issue if I restate my terms in the form of that power. However, I figured I would pass it by Stack Exchange and hopefully gain some insights as to what I am doing wrong here.
Thank you for your time! It is much appreciated, many thanks!
If I may suggest, do not shift the indices (this is what I learnt $65$ years ago).
So, the lhs is $$\sum_{n=0}^{\infty}c_nn(n-1)x^{n-2} - \sum_{n=0}^{\infty}c_nn(n-1)x^{n}+ \sum_{n=0}^{\infty}c_nnx^{n-1}+\sum_{n=0}^{\infty}c_nx^{n} $$ Now consider what you need to have degree $m$.
So $$c_{m+2}(m+2)(m+1)-c_m m(m-1)+c_{m+1} (m+1)+c_m$$ Simplify alittle bit (what you could have done from the start with the second and fourth terms.