       Re: O.D.E in Power Series

• To: mathgroup at smc.vnet.net
• Subject: [mg18292] Re: O.D.E in Power Series
• From: "Peltio" <peltio at twilight.zone>
• Date: Fri, 25 Jun 1999 15:05:33 -0400
• Organization: Peltio Inc.
• References: <7ku0dk\$9a1@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```Alan S. Bloom wrote
>I am trying to solve this equation below:
>y''-2(x+3)y'-3y=0 with the DSolve command.>
>DSolve [y''[x]-2(x+3)y'[x]-3y[x]==0,y[x],x]
---------
Alan,
I know that this is not an answer to your question , but it may help
nonetheless.
Why not give it a shot with ordinary power series method?
I wrote a simple tiny package to keep Mathematica from automatically
simplifying the Sums. I can e-mail it to you if you might find it of
interest.

eq=y''[x]-2(x+3)y'[x]-3y[x]==0;
<<Summa.m

In a neighbor of x=0, for simplicity of notation, we can expand y[x]and its
derivatives and substitute into the equation (whose coefficient are already
'expanded')

{ys=Summa[a[n]x^n,{n,0,Infinity}],y1s=DSum[ys,x],y2s=DSum[y1s,x]}
Out=
{Sum[x^n a[n], {n, 0, Infinity}],
Sum[n x^(-1 + n) a[n], {n, 0, Infinity}],
Sum[(-1 + n) n x^(-2 + n) a[n], {n, 0, Infinity}]}

eqs=eq/.{y[x]->ys,y'[x]->y1s,y''[x]->y2s}
Out=
Sum[(-1 + n) n x^(-2 + n) a[n], {n, 0, Infinity}] -
2 (3 + x) Sum[n*x^(-1 + n) a[n], {n, 0, Infinity}] -
3 Sum[x^n a[n], {n, 0, Infinity}] == 0

This brings in the coefficients premultiplying each Sum object

eqs=BringIn[ExpandSum[eqs]]
Out=
Sum[-6 n x^(-1 + n) a[n], {n, 0, Infinity}] +
Sum[-3 x^n a[n], {n, 0, Infinity}] +
Sum[-2 n x^n a[n], {n, 0, Infinity}] +
Sum[-(n x^(-2 + n)a[n]) + n^2 x^(-2 + n) a[n], {n, 0, Infinity}] == 0

Now we can align the powers of x in order to have the same exponent in each
sum

eqs=AlignExponent[eqs,x,n->n]
Out=
Sum[-3 x^n a[n], {n, 0, Infinity}] +
Sum[-2 n x^n a[n], {n, 0, Infinity}] +
Sum[-6 (1 + n) x^n a[1 + n], {n, -1, Infinity}] +
Sum[-((2 + n) x^n a[2 + n]), {n, -2, Infinity}] +
Sum[(2 + n)^2 x^n a[2 + n], {n, -2, Infinity}] == 0

Next we align the indexes, by breaking the sums and expliciting some terms

BreakSum[eqs,1]
Out=
-3 a - 6 a + 2 a +
Sum[-3 x^n a[n], {n, 1, Infinity}] +
Sum[-2 n x^n a[n], {n, 1, Infinity}] +
Sum[-6 (1 + n) x^n a[1 + n], {n, 1, Infinity}] +
Sum[-((2 + n) x^n a[2 + n]), {n, 1, Infinity}] +
Sum[(2 + n)^2 x^n a[2 + n], {n, 1, Infinity}] == 0

A simplifications puts all the sums into a single one

res=SimplifySum[%]
Out=
-3 a - 6 a + 2 a +
Sum[x^n (-((3 + 2 n) a[n]) + (1 + n) (-6 a[1 + n] + (2 + n) a[2 + n])),
{n, 1, Infinity}] == 0

All we have to do now is to apply the principle of identity of polynomials
to get the values of the coefficients (GetElement simply annihilates the Sum
symbol in order to ease the extraction of the coefficents)

eqRicors=GetElement[res]
Out=
-3 a - 6 a + 2 a + x^n (-((3 + 2 n) a[n]) +
(1 + n) (-6 a[1 + n] + (2 + n) a[2 + n])) == 0

Solve[eqRicors /.x^n->0,a]
Out=
{{a -> (3*(a + 2*a))/2}}

Solve[Coefficient[eqRicors[],x^n]==0,a[n+2]]
Out=
{{a[2 + n] -> -((-3 a[n] - 2 n a[n] - 6 a[1 + n] - 6 n a[1 + n])/
(2 + 3 n + n^2))}}

% /.n->n-2
Out=
{{a[n] -> -((-3 a[-2 + n] - 2 (-2 + n) a[-2 + n] -
6 a[-1 + n] - 6 (-2 + n) a[-1 + n])/
(2 + 3 (-2 + n) + (-2 + n)^2))}}

Once you specified a and a according to the initial conditions you can
get the other coefficients by the racursione relation Out.

HTH,
Peltio
peltio AT usa DOT net
(warning: anti spam measures taken)

PS
This is not the actual output from Mathematica: I had to rearrange things at
home with a text editor. The version can provide very nice output in version
3, and can be used for typesetting purposes only. And, of course, it's free.

```

• Prev by Date: TeXForm with long expressions
• Next by Date: Re: Graphic simple?
• Previous by thread: O.D.E in Power Series
• Next by thread: Re: O.D.E in Power Series