Clear["Global`*"]

  
order = 
        0;
x0 = 0;
q[
        x_] := (((1/4) - (m^2))/(x^2)) - (1/4)

Q[x_] := 
      Normal[Series[(((x - x0))^2) q[x], {x, x0, order}]]
Print["Q[x]=", Q[x]]

\( (*\ Eq . \ 2.7  .5\ *) 

    U[x_] := \(\(\((x - 
                x0)\)\^α\)\(\ \ \)\((1 + ∑\+\(n = 1\)\%order u[
                  n]\ \((x - x0)\)\^n)\)\(\ \)\)\)
Print["U[x]=", U[x]]

\( (*\ Differential\ Equation\ 2.7  .1\ *) 
\(\(eq = \ \(\((x - 
                    x0)\)\^\(\(2\)\(\ \)\)\) \(U''\)[x] + Q[x]\ U[x] == 
        0\)\(
\)
    \)\)
sol1 = Flatten[Solve[eq, α]]

order = 
        1;
Q[x_] := 
      Normal[Series[(((x - x0))^2) q[x], {x, x0, 
            order}]]
Print["Q[x]=", Q[x]]
U[x_] := (((x - 
                x0))^α)  (1 + (∑_(n = 1)^order) u[
                  n] (((x - x0))^n)) 
Print["U[x]=", U[x]]

    
eq =  (((x - x0))^(2 )) U''[x] + 
          Q[x] U[x] == 0
FullSimplify[eq /. sol1[[1]] ]

    
sol2[1] = 
      Flatten[FullSimplify[Solve[eq /. sol1[[1]], u[1]]]] /. 
        x -> x0
sol2[2] = 
      Flatten[FullSimplify[Solve[eq /. sol1[[2]], u[1]]]] /. 
        x -> x0

order = 
        2;
Q[x_] := 
      Normal[Series[(((x - x0))^2) q[x], {x, x0, 
            order}]]
Print["Q[x]=", Q[x]]
U[x_] := (((x - 
                x0))^α)  (1 + (∑_(n = 1)^order) u[
                  n] (((x - x0))^n)) 
Print["U[x]=", U[x]]
eq =  (((x - x0))^(2 )) U''[x] + 
          Q[x] U[x] == 0
FullSimplify[eq /. sol1[[1]] /. 
        sol2[1]]

    
sol3[1] = 
      Flatten[FullSimplify[Solve[eq /. sol1[[1]] /. sol2[1], u[2]]]] /. 
        x -> x0
sol3[2] = 
      Flatten[FullSimplify[Solve[eq /. sol1[[2]] /. sol2[2], u[2]]]] /. 
        x -> x0
U[x]  /. sol1[[1]] /. sol2[1] /. sol3[1]

order = 
        3;
Q[x_] := 
      Normal[Series[(((x - x0))^2) q[x], {x, x0, 
            order}]]
Print["Q[x]=", Q[x]]
U[x_] := (((x - 
                x0))^α)  (1 + (∑_(n = 1)^order) u[
                  n] (((x - x0))^n)) 
FullSimplify[U[x] /. sol1[[1]] /. sol2[1] /. 
        sol3[1]]
Print["U[x]=", U[x]]
eq =  (((x - x0))^(2 )) U''[x] + 
          Q[x] U[x] == 0
FullSimplify[eq /. sol1[[1]] /. sol2[1] /. 
        sol3[1]]

    
sol4[1] = 
      Flatten[FullSimplify[
            Solve[eq /. sol1[[1]] /. sol2[1] /. sol3[1], 
              u[3] ]]] /. x -> x0
sol4[2] = 
      Flatten[FullSimplify[
            Solve[eq /. sol1[[2]] /. sol2[2] /. sol3[2], 
              u[3] ]]] /. x -> x0

order = 
        4;
Q[x_] := 
      Normal[Series[(((x - x0))^2) q[x], {x, x0, 
            order}]]
Print["Q[x]=", Q[x]]
U[x_] := (((x - 
                x0))^α)  (1 + (∑_(n = 1)^order) u[
                  n] (((x - x0))^n)) 
Print["U[x]=", U[x]]
eq =  (((x - x0))^(2 )) U''[x] + 
          Q[x] U[x] == 0
FullSimplify[eq /. sol1[[1]] /. sol2[1] /. sol3[1] /. 
        sol4[1]]

    
sol5[1] = 
      Flatten[FullSimplify[
            Solve[eq /. sol1[[1]] /. sol2[1] /. sol3[1] /. 
                sol4[1], u[4]]]] /. x -> x0
sol5[2] = 
      Flatten[FullSimplify[
            Solve[eq /. sol1[[2]] /. sol2[2] /. sol3[2] /. 
                sol4[2], u[4]]]] /. x -> x0

order = 
        5;
Q[x_] := 
      Normal[Series[(((x - x0))^2) q[x], {x, x0, 
            order}]]
Print["Q[x]=", Q[x]]
U[x_] := (((x - 
                x0))^α)  (1 + (∑_(n = 1)^order) u[
                  n] (((x - x0))^n)) 
Print["U[x]=", U[x]]
eq =  (((x - x0))^(2 )) U''[x] + 
          Q[x] U[x] == 0
FullSimplify[eq /. sol1[[1]] /. sol2[1] /. 
            sol3[1] /. sol4[1] /. sol5[1]]

    
sol6[1] = 
      Flatten[FullSimplify[
            Solve[eq /. sol1[[1]] /. sol2[1] /. sol3[1] /. 
                  sol4[1] /. sol5[1], u[5]]]] /. 
        x -> x0
sol6[2] = 
      Flatten[FullSimplify[
            Solve[eq /. sol1[[2]] /. sol2[2] /. sol3[2] /. 
                  sol4[2] /. sol5[2], u[5]]]] /. x -> x0

order = 
        6;
Q[x_] := 
      Normal[Series[(((x - x0))^2) q[x], {x, x0, 
            order}]]
Print["Q[x]=", Q[x]]
U[x_] := (((x - x0))^α)  (1 + (∑_(n = 1)^order) u[
                  n] (((x - x0))^n)) 
Print["U[x]=", U[x]]
eq =  (((x - x0))^(2 )) U''[x] + 
          Q[x] U[x] == 0
FullSimplify[eq /. sol1[[1]] /. sol2[1] /. sol3[1] /. 
            sol4[1] /. sol5[1] /. 
        sol6[1]]

sol7[1] = 
      Flatten[FullSimplify[
            Solve[eq /. sol1[[1]] /. sol2[1] /. sol3[1] /. 
                    sol4[1] /. sol5[1] /. sol6[1], u[6]]]] /. 
        x -> x0
sol7[2] = 
      Flatten[FullSimplify[
            Solve[eq /. sol1[[2]] /. sol2[2] /. sol3[2] /. 
                    sol4[2] /. sol5[2] /. sol6[2], u[6]]]] /. 
        x -> x0

\( (*\ 
      Print\ Solution\ *) 
Print[\*""(Subscript[U, 1])[x]="", \(\(\(\(\(\(U[x] /. 
                    sol1[\([1]\)]\) /. sol2[1]\) /. sol3[1]\) /. sol4[1]\) /. 
            sol5[1]\) /. sol6[1]\) /. sol7[1]]\)
\(Print[\*""\!\(U\_2\)[x]="", \(\(\(\(\(\(U[x] /. sol1[\([2]\)]\) /. 
                  sol2[2]\) /. sol3[2]\) /. sol4[2]\) /. sol5[2]\) /. 
          sol6[2]\) /. sol7[2]]\)

(* 
      Find analytical solution with Mathematica *) 
DSolve[u''[
            x] + ((((1/4) - (m^2))/(x^2)) - (1/4))  u[x] == 0, u[x], 
      x]