Let y(x)=a0+a1(x-2)+a2(x-2)2+∑3an(x-2)n, then:
y'(x)=a1+2a2(x-2)+∑3nan(x-2)n-1, y"(x)=2a2+∑3n(n-1)an(x-2)n-2, where ∑3 means summation for integer n≥3. From these we can see that y(2)=a0=4, y'(2)=a1=6, from the given initial conditions, because all x-2 terms are zero.
(x2-1)y"+3xy'+xy=0 (for all x). Now let x=2, so 3y"+6y'+2y=0, and all ∑3 terms are zero.
So 6a2+6a1+2a0=0, 3a2+3a1+a0=0, a2=-(3a1+a0)/3=-(18+4)/3=-22/3.
Although we now have numerical values for some coefficients, we'll continue to use algebraic notation so as to see how other coefficients are derived. The numerical values can be inserted later after a formula has been derived which relates coefficients.
Now redefine y(X)=a0+a1X+a2X2+∑3anXn,
y'(X)=a1+2a2X+∑3nanXn-1, y"(X)=2a2+∑3n(n-1)anXn-2, where X=x-2. Substitute x=X+2 in the DE:
(X2+4X+3)y"+3(X+2)y'+(X+2)y=0, so replacing y and its derivatives:
(X2+4X+3)(2a2+∑3n(n-1)anXn-2)+
(3X+6)(a1+2a2X+∑3nanXn-1)+
(X+2)(a0+a1X+a2X2+∑3anXn)=0.
When we expand this we get (colour-coding for like powers of X) :
2a2X2+∑3n(n-1)anXn+8a2X+∑34n(n-1)anXn-1+6a2+∑33n(n-1)anXn-2+
3a1X+6a2X2+∑33nanXn+
a0X+a1X2+a2X3+∑3anXn+1+2a0+2a1X+2a2X2+∑32anXn=0.
6a2+2a0+(8a2+5a1+a0)X+(10a2+a1)X2+a2X3+
∑3(n(n-1)an+3nan+2an)Xn+∑34n(n-1)anXn-1+∑33n(n-1)anXn-2+∑3anXn+1=0,
∑3(n2+2n+2)anXn+∑34n(n-1)anXn-1+∑33n(n-1)anXn-2+∑3anXn+1=0.
Note the mixture of coefficients. Note also that for the summation terms we will have X and X2 terms for n=3 or 4.
We can bring the summation terms under one umbrella by adjusting n appropriately (for example, replace n with n+1 for Xn-1, making n(n-1)Xn-1 into (n+1)nXn=(n2+n)Xn):
∑3[(n2+2n+2)an+4(n2+n)an+1+3(n2+3n+2)an+2+an-1]Xn, which combines all the coefficients of Xn.
For general n, the coefficient expression must be zero because the DE has to be true for all X.
an-1+(n2+2n+2)an+4(n2+n)an+1+3(n2+3n+2)an+2=0, from which succeeding coefficients can be calculated from its 3 predecessors.
For example, a0+5a1+8a2+18a3=0, a3=-(a0+5a1+8a2)/18. The first 3 coefficients were derived earlier.
The series is y(x)=a0+a1(x-2)+a2(x-2)2+a3(x-2)3+... using the formula to find higher coefficients.