5.119 Change the summation index letter

I noticed that Maple returns the summation index variable using leading underscore as in _n or _m which makes the latex looks not as good. Here is an example

restart; 
dsolve(diff(y(x),x$2)+diff(y(x),x)+y(x)=0,y(x),'formal_series'); 
 
y(x) = _C1*Sum((-1/2 - sqrt(3)*I/2)^_n*x^_n/_n!, _n = 0 .. infinity) + 
       _C2*Sum((-1/2 + sqrt(3)*I/2)^_n*x^_n/_n!, _n = 0 .. infinity)
 

The latex of the above is

\[ y \left (x \right ) = \textit {\_C1} \left (\sum _{\textit {\_n} =0}^{\infty }\frac {\left (-\frac {1}{2}-\frac {i \sqrt {3}}{2}\right )^{\textit {\_n}} x^{\textit {\_n}}}{\textit {\_n} !}\right )+\textit {\_C2} \left (\sum _{\textit {\_n} =0}^{\infty }\frac {\left (-\frac {1}{2}+\frac {i \sqrt {3}}{2}\right )^{\textit {\_n}} x^{\textit {\_n}}}{\textit {\_n} !}\right ) \]

Not seeing an option to change _n to n, I wrote the following function which takes in the solution, use subsindets and remove the leading underscore.

This is the above example showing how to use the function

restart; 
 
fix_summation_index:=proc(expr) 
local fix_it:=proc(the_sum) 
  local the_letter::symbol,the_new_letter::symbol,the_letter_as_string::string; 
  the_letter:= op([2,1],the_sum); 
  the_letter_as_string:=String(the_letter); 
  if the_letter_as_string[1]="_" then 
     the_new_letter:=parse(the_letter_as_string[2..]); 
     RETURN(subs(the_letter=the_new_letter,the_sum)); 
  else 
     RETURN(the_sum); 
  fi; 
end proc; 
 
if not(has(expr,Sum)) then 
   RETURN(expr); 
else 
   RETURN(subsindets( expr, 'specfunc( anything, Sum )', f->fix_it(f))); 
fi; 
 
end proc; 
 
sol:=dsolve(diff(y(x),x$2)+diff(y(x),x)+y(x)=0,y(x),'formal_series'): 
sol:=fix_summation_index(sol); 
 
y(x) = _C1*Sum((-1/2 - sqrt(3)*I/2)^n*x^n/n!, n = 0 .. infinity) + 
       _C2*Sum((-1/2 + sqrt(3)*I/2)^n*x^n/n!, n = 0 .. infinity)
 

The latex now is

\[ y \left (x \right ) = \textit {\_C1} \left (\sum _{n =0}^{\infty }\frac {\left (-\frac {1}{2}+\frac {i \sqrt {3}}{2}\right )^{n} x^{n}}{n !}\right )+\textit {\_C2} \left (\sum _{n =0}^{\infty }\frac {\left (-\frac {1}{2}-\frac {i \sqrt {3}}{2}\right )^{n} x^{n}}{n !}\right ) \]