# Solving ODE in power series about infinity

I want to solve a particular ODE in power series of 1/x. I can obtain the power series solution about x=0. Can any one suggest how to obtain a series solution in 1/x for the following ODE?

I tried the following which did not work. (Mainly the LogicalExpand doesn't seem to work.)

Changed variable : w =1/x

F := Sum[p[i] (a L w)^i, {i, 0, 4}]

DE = 1/16 ((
16 (a^2) (
L^2) ((1 + a L w)^4) (W^2) )/((1 +
2 a L w)^2 (1 + 2 a L w (1 + a L w))^2) - (
a^2 L^2 W (4 I + W))/(1 +
a L w)^2 + (
8 (-1 - 2 a L w + 2 a^3 L^3 w^3) (I a L W ))/(
w (1 + a L w) (1 + 2 a L w) (1 +
2 a L w (1 + a L w)))) D[F, { w, 0}] +
1/16  ((8 I a L W)/(1 + a L w) + (
8 (-1 - 2 a L w + 2 a^3 L^3 w^3) (4 (1 + a L w)))/(
w (1 + a L w) (1 + 2 a L w) (1 +
2 a L w (1 + a L w)))) D[F, {w, 1}] +
D[F, {w, 2}] == 0

coeffeqns = LogicalExpand[DE]

solvedcoeffs = Solve[coeffeqns, Reverse[Table[p[i], {i, 0, 4}]]]

F = F /. solvedcoeffs

• Reference(s) to smarter code for power series solution will also be appreciated. – Physics Moron Nov 13 '15 at 17:16

I think there are two issues here. The first is that LogicalExpand is for expanding logical expressions, like so:

In[1]:= LogicalExpand[(a || b) && (b || c)]
Out[1]= (a || b) && (b || c)


Second, you can actually work directly with power series and expand them about $\infty$, as follows:

In[2]:= series = Series[f[(a L /x)], {x, Infinity, 4}];


In Mathematica, this is a SeriesData object that represents the series in a compact way, but you can do many normal operations on it. Using TeXForm to get nice output for SE yields:

$$f(0)+\frac{a L f'(0)}{x}+\frac{a^2 L^2 f''(0)}{2 x^2}+\frac{a^3 f^{(3)}(0) L^3}{6 x^3}+\frac{a^4 f^{(4)}(0) L^4}{24 x^4}+O\left(\left(\frac{1}{x}\right)^5\right)$$

However, for the rest of the problem, I'll use your definition in terms of $w = \frac{1}{x}$. Let's use your DE definition and substitute in the series for f[a L w] before taking the derivatives using Block:

ode = Block[{F = Series[f[a*L*w], {w, 0, 4}]},
Simplify[(1/16)*((16*a^2*L^2*(1 + a*L*w)^4*W^2)/((1 + 2*a*L*w)^2*
(1 + 2*a*L*w*(1 + a*L*w))^2) - (a^2*L^2*W*(4*I + W))/
(1 + a*L*w)^2 + (8*(-1 - 2*a*L*w + 2*a^3*L^3*w^3)*(I*a*L*W))/
(w*(1 + a*L*w)*(1 + 2*a*L*w)*(1 + 2*a*L*w*(1 + a*L*w))))*
D[F, {w, 0}] + (1/16)*((8*I*a*L*W)/(1 + a*L*w) +
(8*(-1 - 2*a*L*w + 2*a^3*L^3*w^3)*(4*(1 + a*L*w)))/
(w*(1 + a*L*w)*(1 + 2*a*L*w)*(1 + 2*a*L*w*(1 + a*L*w))))*
D[F, {w, 1}] + D[F, {w, 2}] == 0]];


The Mathematica output is kinda gross, so I'll TeXForm it again:

$$\frac{a L \left(-2 f'(0)-\frac{1}{2} i f(0) W\right)}{w}+\frac{1}{16} a^2 L^2 \left(-16 f''(0)+64 f'(0)+15 f(0) W^2+20 i f(0) W\right)+\frac{1}{16} a^3 L^3 w \left(W^2 \left(15 f'(0)-62 f(0)\right)-4 i W \left(-f''(0)-3 f'(0)+8 f(0)\right)+64 \left(f''(0)-f'(0)\right)\right)+\frac{1}{96} a^4 L^4 w^2 \left(W^2 \left(45 f''(0)-372 f'(0)+942 f(0)\right)+4 i W \left(4 f^{(3)}(0)+3 f''(0)-36 f'(0)+66 f(0)\right)+16 \left(f^{(4)}(0)+12 f^{(3)}(0)-24 f''(0)+24 f'(0)\right)\right)+O\left(w^3\right)=0$$

As you can see, this equation is given in terms of $\left\{f(0),f'(0),f''(0),f^{(3)}(0),f^{(4)}(0)\right\}$. Assuming $f(0)$ and $f'(0)$ are fixed (since it's a second-order ODE), we can reduce ode for non-zero $a$ and $L$:

reduced = Assuming[{a != 0, L != 0},
Refine[Reduce[ode, Array[Derivative[#1][f][0] & , 3, 2]]]];


Here,

In[4]:= Array[Derivative[#1][f][0] &, 3, 2]
Out[4]= {Derivative[2][f][0], Derivative[3][f][0], Derivative[4][f][0]}


is just a compact way of describing the derivatives we want to solve for, Reduce attempts to eliminate the listed variables from the equation, and Refine applies the assumptions (set by Assuming) that $a \ne 0$ and $L \ne 0$.

Which comes out to

$$\left(f'(0)=0\land f(0)=0\land f''(0)=0\land f^{(4)}(0)=-i f^{(3)}(0) (W-12 i)\right)\lor \left(f(0)\neq 0\land W=\frac{4 i f'(0)}{f(0)}\land f''(0)=\frac{1}{4} i (15 W+4 i) f'(0)\land f^{(4)}(0)=-\frac{1}{64} i \left(64 f^{(3)}(0) W-768 i f^{(3)}(0)+675 W^3 f'(0)+1848 i W^2 f'(0)+8688 W f'(0)+1152 i f'(0)\right)\right)$$

• Thanks a lot! But I couldn't quite follow the last part of your code. Can you please elaborate on this.. – Physics Moron Nov 13 '15 at 18:36
• Which last part? Where I define reduced? – Pillsy Nov 13 '15 at 18:41
• Yes, that part only. – Physics Moron Nov 13 '15 at 18:42
• I do not understand why LogicalExpand doesn't work for my code.. – Physics Moron Nov 14 '15 at 0:04
• @pinu: Holy cow! You're right. It also works on my ode definition. I'll think about revising my post, but I have to explore what's going on.... – Pillsy Nov 14 '15 at 20:50