Lane-Emden Differential Equation

Author

Eric W. Weisstein
October 17, 2008

This notebook downloaded from http://mathworld.wolfram.com/notebooks/DifferentialEquations/Lane-EmdenDifferentialEquation.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/Lane-EmdenDifferentialEquation.html.

©2008 Wolfram Research, Inc. except for portions noted otherwise

Code

LaneEmden[n_,{θ_,ξ_}]:=1/ξ^2 D[ξ^2 θ'[ξ],ξ]+θ[ξ]^n

Equation

Simplify[LaneEmden[n,{θ,ξ}]]

Simplify[(D[x^2 y'[x],x]+x^2 y[x]^n)/x^2]

DSolve[{LaneEmden[n,{θ,ξ}]==0,θ[0]==1,θ'[0]==0},θ[ξ],ξ]

Plot

LaneEmdenSolution[n_]:=Module[{x,y,eps=$MachineEpsilon},
NDSolve[{x ((y[x])^n)+2 y'[x]+x y''[x]==0,y[eps]==1,y'[eps]==0},y,{x,eps,15}][[1,1,2]]
]

Plot[Evaluate[LaneEmdenSolution[2][x]],{x,0,12.4}]

soln=LaneEmdenSolution[#][x]&/@Range[0,5];

Plot[soln,{x,0,10},Method->Evaluated->True,PlotStyle->{Black,Red,Yellow,Green,Blue,Purple},PlotRange->{-1,1},AxesLabel->{ξ,θ[ξ]}]

NDSolve[{x y[x]+2 y'[x]+x y''[x]==0,y[0]==1,y'[0]==0},y,{x,0,10}]

Block[{eps=$MachineEpsilon},NDSolve[{x y[x]+2 y'[x]+x y''[x]==0,y[eps]==1,y'[eps]==0},y,{x,eps,10}]]

Exact Solutions

n==0

DSolve[LaneEmden[0,{θ,ξ}]==0,θ[ξ],ξ]

DSolve[{LaneEmden[0,{θ,ξ}]==0,θ[0]==1,θ'[0]==0},θ[ξ],ξ]//Simplify

n==1

DSolve[LaneEmden[1,{θ,ξ}]==0,θ[ξ],ξ]

DSolve[{LaneEmden[1,{θ,ξ}]==0,θ[0]==1,θ'[0]==0},θ[ξ],ξ]//FullSimplify

n==2

DSolve[{LaneEmden[2,{θ,ξ}]==0,θ[0]==1,θ'[0]==0},θ[ξ],ξ]//Timing

n==3

DSolve[{LaneEmden[3,{θ,ξ}]==0,θ[0]==1,θ'[0]==0},θ[ξ],ξ]//Timing

n==4

DSolve[{LaneEmden[4,{θ,ξ}]==0,θ[0]==1,θ'[0]==0},θ[ξ],ξ]//Timing

n==5

LaneEmden[5,{θ,ξ}]

DSolve[{LaneEmden[5,{θ,ξ}]==0,θ[0]==1,θ'[0]==0},θ[ξ],ξ]

LaneEmden[5,{y,x}]

DSolve[{((y[x])^5)+((2 x y'[x]+(x^2) y''[x])/(x^2))==0,y[0]==1,y'[0]==0},y[x],x]

Simplify[((y[x])^5)+((2 x y'[x]+(x^2) y''[x])/(x^2))/.y:>Function[x,(((1+(1/3)(x^2)))^(-1/2))]]

Function[x,x(((1+(1/3)(x^2)))^(-1/2))][0]

Derivative[1][Function[x,x(((1+(1/3)(x^2)))^(-1/2))]][0]