# Series solution of the Lane-Emden equation

I have the following problem:

I'd like to show how the Lane-Emden equation would look like if someone would solve it as a series.

Here's the code:

θGrad = 4
θReihe[z_] = 1 + Plus @@ Table[Subscript[a, i] z^i, {i, 2,

θn[z_] = Series[θ[z], {z, 0, 7}]

LEGL = 1/z^2 D[z^2 D[θReihe[z], z]] + θReihe[z]^n

Unbek = Table[Subscript[a, i], {i, 2, θGrad}]

KoeffList = CoefficientList[Normal[LEGL], z]

Lösung = Solve[Thread[KoeffList == 0][[2 ;; 4]], Unbek]


The problem here is that no solution was found, when it should look like what I found on this site.

It would be very nice if somebody could find my mistake and tell me what I need to do to get it right.

• Many many (15?) years ago I wrote this, which may be of help. – David Reiss Nov 5 '15 at 16:08
• Ah, I just noticed that the OP's link was to my old work. I haven't taken a look at it in years. – David Reiss Nov 5 '15 at 16:13
• @DavidReiss I converted your answer to a comment, hope you don't mind. It fits here better. – Kuba Mar 25 '18 at 10:11

Here's a starting point (borrowing the notation from here):

With[{n = 5, m = 10},
(θ = 1 + Sum[C[k] ξ^k, {k, 2, m}] + O[ξ]^(m + 1)) /.
First[SolveAlways[ξ D[θ, {ξ, 2}] + 2 D[θ, ξ] + ξ θ^n == 0, ξ]]]
1 - ξ^2/6 + ξ^4/24 - 5 ξ^6/432 + 35 ξ^8/10368 - 7 ξ^10/6912 + O[ξ]^11


Compare:

Series[1/Sqrt[1 + ξ^2/3], {ξ, 0, 10}]
1 - ξ^2/6 + ξ^4/24 - 5 ξ^6/432 + 35 ξ^8/10368 - 7 ξ^10/6912 + O[ξ]^11


On MMA 11.3:

AsymptoticDSolveValue[ξ*θ''[ξ] + 2*θ'[ξ] + ξ*θ[ξ]^n == 0, θ[ξ], {ξ, 0, 7}]

(* C[1] - 1/6 ξ^2 C[1]^n + 1/120 n ξ^4 C[1]^(-1 + 2 n) - (
n (-5 + 8 n) ξ^6 C[1]^(-2 + 3 n))/15120 + ξ C[2] *)