Example 5.2.1

DSolve[y''[x]-y[x]==0,y[x],x]

Example 5.2.2

DSolve[y''[x]-x y'[x]-y[x]==0,y[x],x]

(∑_(n=0)^∞)((2n!(x^(2n+1)))/((2n+1)!))

Example 5.2.21

L[y_]:=D[y,{x,2}]-2x D[y,{x,1}]+λ y==0

DSolve[L[y[x]],y[x],x]

We see that one of our solutions should be a Hermite poynomial, and the other a Hypergeometric function. This may be your first encounter with the Hypergeoemtric functions and Hermite polynomials.

Check the pattern recognition software (my brain):

f[k_]:=a[2k+2]==(Subscript[c, 1])(1/((2k+2)!))(∏_(i=0)^k)(4i-λ)
Table[f[k],{k,0,4}]//TableForm

g[k_]:=a[2k+3]==(Subscript[c, 2])(1/((2k+3)!))(((∏_(i=1)^(2k+1))(2i-λ))/((∏_(i=1)^k)(4i-λ)))
Table[g[k],{k,0,4}]//TableForm

Here are the solutions we found. Notice that one is the solution Mathematica found!

y1[x_]:=1+(∑_(k=0)^∞)(1/((2k+2)!))(x^(2k+2))((∏_(i=0)^k)(4i-λ))
y2[x_]:=x+(∑_(k=0)^∞)(1/((2k+3)!))(x^(2k+3))(((∏_(i=1)^(2k+1))(2i-λ))/((∏_(i=1)^k)(4i-λ)))

y1[x]
y2[x]

The Hermite polynomials are found from these solutions, and so they are also solutions to the differential equation. They are found by assuming λ=2n, where n is a positive integer.

Notice how the Hermite polynomials leap back and forth between y1 and y2. Also notice that our series solution determines the Hermite polynomials up to an overall constant multiple.

y1[x_,m_]:=1+(∑_(k=0)^(m/2))(1/((2k+2)!))(x^(2k+2))((∏_(i=0)^k)(4i-2m))
y2[x_,m_]:=x+(∑_(k=0)^((m-1)/2))(1/((2k+3)!))(x^(2k+3))(((∏_(i=1)^(2k+1))(2i-2m))/((∏_(i=1)^k)(4i-2m)))

Here are the even Hermite polynomials, up to a mupliplicative constant:

Table[{m,HermiteH[m,x],y1[x,m]},{m,0,8,2}]//TableForm

Here are the odd Hermite polynomials, up to a mupliplicative constant:

Table[{m,HermiteH[m,x],y2[x,m]},{m,1,9,2}]//TableForm

Here is the general solution if λ=2m:

L[y_,m_]:=D[y,{x,2}]-2x D[y,{x,1}]+2m y==0

DSolve[L[y[x],m],y[x],x]

Here is the general solution if m=1:

DSolve[L[y[x],1],y[x],x];
Simplify[%]

Which agrees with the series solution we worked out, where I have made the following replacement to avoid a computational division by zero which wouldn't occur if you did this by hand:

(((∏_(i=1)^(2k+1))(2i-2m))/((∏_(i=1)^k)(4i-2m)))

y1[x_,m_]:=1+(∑_(k=0)^∞)(1/((2k+2)!))(x^(2k+2))((∏_(i=0)^k)(4i-2m))
y2[x_,m_]:=x+(∑_(k=0)^∞)(1/((2k+3)!))(x^(2k+3))((2 Pochhammer[1-m,1+2 k])/(Pochhammer[1-(m/2),k]))

Simplify[y1[x,1]]
Simplify[y2[x,1]]