May 6, 2010

a = Series[Sin[x],{x,0,20}]

b = Series[Cos[x],{x,0,20}]

1/b

Series[Sec[x],{x,0,20}]

a/b

Series[Tan[x],{x,0,20}]

a/(1+x^2)

Series[ Sin[x]/(1+x^2),{x,0,20}]

c = Series[E^x,{x,0,20}]

a*c

Series[E^x*Sin[x],{x,0,20}]

______________________________________________________________________________

Find the polynomial approximation f(x) of order 200 to the the function y(x) that satisfies 
   (x^2)y''(x) +x y'(x) +(x^2)y[x] = 0,  y(0) = 1, and y'(0) = 0.       (Bessel's Equation for parameter zero)

y = 1+ Sum[a[i]*x^i,{i,2,200}]+O[x,0]^201;

eqn = x^2*D[y,{x,2}]+x*D[y,x]+x^2*y ==0;

expr = LogicalExpand[eqn];

sol = Solve[ expr];

f[x_] = Normal[y] /. sol[[1]];

J[x_] = 1 + Sum[ (-1)^k*x^(2k)/(2^(2k)*(k!)^2),{k,1,100}];    
                                                       (* i.e.  (Subscript[J, 0])(x) - Bessel function of first kind of order zero  *)

f[x]-J[x]  // Together

Plot[f[x],{x,-25,25}]

________________________________________________________________________

Find the polynomial approximation g(x) of order 200 for the function y(x) that satisfies 
                       y''(x) - x y(x) = 0,  y(0) = 1, and y'(0) = 0.

Quit[]

y = 1 + Sum[b[i]*x^i,{i,2,200}] +O[x,0]^201;

eqn = D[y,{x,2}]- x*y ==0;

expr = LogicalExpand[ eqn ];

sol = Solve[eqn];

g[x_] = Normal[y] /. sol[[1]];

Plot[g[x],{x,-12,2}]

_________________________________________________________________________________________

Quit[]

h[x_] = y[x] /. DSolve[{y''[x]-x*y[x]==0,y[0]==1,y'[0]==0},y[x],x][[1]]

Plot[h[x],{x,-30,3}]

_________________________________________________________________________

P[n_,x_] := Together[(1/(2^n*n!))D[(x^2-1)^n,{x,n}] ]

Table[{n, P[n,x] /.x->1, D[P[n,x],x] /. x->1, Binomial[n+1,2],P[n,x]},{n,0,10}]  // TableForm

Show that (Subscript[P, n])(x)  is a solution of  (1-(x^2))y''(x) -2x y'(x) +n(n+1)y(x) = 0 for 1 ≤ n ≤ 15.

expr[n_] := Expand[(1-x^2)D[P[n,x],{x,2}]-2x*D[P[n,x],x]+n(n+1)P[n,x]]

Table[{n, expr[n]},{n,0,15}]  //  TablelForm

P[10,x] //Expand

P[10,x] /. x->1

D[P[10,x],x] /. x->1

Find the polnomial approximation Q(x) of order 20 to the function y(x) that satisfies 
                  (1-(x^2))y''(x) -2x y'(x) +10(11)y(x) = 0, y(1) = 1, and y'(1) = 55

y = 1 + 55(x-1) + Sum[c[i]*(x-1)^i,{i,2,20}] +O[x,1]^21

eqn = (1-x^2)D[y,{x,2}]-2x*D[y,x]+(10)(11)y ==0

expr=LogicalExpand[eqn]

sol = Solve[expr]

Q[x_] = Normal[y] /. sol[[1]]

Expand[Q[x]]

P[10,x]  // Expand

Integrate[ P[7,x]*P[11,x],{x,-1,1}]

Integrate[P[13,x]*P[23,x],{x,-1,1}]

Integrate[P[2,x]*P[3,x],{x,-1,1}]