Regular Power Series Solution

Solution of
y''+cos(x) y=0
for y(x) with y(0)=1 and y'(0)=0.
An exact solution can be found in this case, and can
be compared with the series solution.

In[1]:=

series_sol_1.gif

Let's find a solution valid out to series_sol_2.gif.  The first step in finding a series solution is to find an expansion for Cos[x]:

In[2]:=

series_sol_3.gif

In[3]:=

series_sol_4.gif

Out[3]=

series_sol_5.gif

In[4]:=

series_sol_6.gif

Out[4]=

series_sol_7.gif

In[5]:=

series_sol_8.gif

Out[5]=

series_sol_9.gif

Here are the unknowns in the expansion of y(x) that we must solve for:

In[6]:=

series_sol_10.gif

Out[6]=

series_sol_11.gif

Here are the algebraic equations for those coefficients:

In[7]:=

series_sol_12.gif

Out[7]=

series_sol_13.gif

We actually don't need the TableForm for the math, it is just nice to look at:

In[8]:=

series_sol_14.gif

Out[8]//TableForm=

a[0]+2 a[2]==0
series_sol_15.gif
series_sol_16.gif
series_sol_17.gif
series_sol_18.gif

In[9]:=

series_sol_19.gif

Out[9]=

series_sol_20.gif

In[10]:=

series_sol_21.gif

Out[10]=

series_sol_22.gif

In[11]:=

series_sol_23.gif

Out[11]=

series_sol_24.gif

So here is the series solution that satisfies the specified initial conditions:

In[12]:=

series_sol_25.gif

Out[12]=

series_sol_26.gif

Now find exact solution:

In[13]:=

series_sol_27.gif

In[14]:=

series_sol_28.gif

Out[14]=

series_sol_29.gif

In[15]:=

series_sol_30.gif

Out[15]=

series_sol_31.gif

Plot approximate (red) and exact (green) solutions:

In[16]:=

series_sol_32.gif

Out[16]=

series_sol_33.gif

Spikey Created with Wolfram Mathematica 8.0