Taylor Series Expansions

{n1,n2}={4,4};
Thing=u[x+Δx,t+Δt/2];
TableForm[
CoefficientList[
Expand[Normal[ 
Series[
Thing,{Δx,0,n1},{Δt,0,n2}]
]
],
{Δx,Δt}]/.u_[x,t]->u,
TableHeadings->{
Table[((Δx)^i),{i,0,n1}],
Table[((Δt)^i),{i,0,n2}]
}
]

{n1,n2}={4,4};
Thing=u[x+Δx,t-Δt/2];
TableForm[
CoefficientList[
Expand[Normal[ 
Series[
Thing,{Δx,0,n1},{Δt,0,n2}]
]
],
{Δx,Δt}]/.u_[x,t]->u,
TableHeadings->{
Table[((Δx)^i),{i,0,n1}],
Table[((Δt)^i),{i,0,n2}]
}
]

{n1,n2}={4,4};
Thing=u[x-Δx,t-Δt/2];
TableForm[
CoefficientList[
Expand[Normal[ 
Series[
Thing,{Δx,0,n1},{Δt,0,n2}]
]
],
{Δx,Δt}]/.u_[x,t]->u,
TableHeadings->{
Table[((Δx)^i),{i,0,n1}],
Table[((Δt)^i),{i,0,n2}]
}
]

{n1,n2}={4,4};
Thing=u[x-Δx,t+Δt/2];
TableForm[
CoefficientList[
Expand[Normal[ 
Series[
Thing,{Δx,0,n1},{Δt,0,n2}]
]
],
{Δx,Δt}]/.u_[x,t]->u,
TableHeadings->{
Table[((Δx)^i),{i,0,n1}],
Table[((Δt)^i),{i,0,n2}]
}
]

More Taylor Series Expansions

The sym. second diff at t+Δx/2

{n1,n2}={4,4};
Thing=u[x+Δx,t+Δt/2]-2 u[x,t+Δt/2]+u[x-Δx,t+Δt/2];
TableForm[
CoefficientList[
Expand[Normal[ 
Series[
Thing,{Δx,0,n1},{Δt,0,n2}]
]
],
{Δx,Δt}]/.u_[x,t]->u,
TableHeadings->{
Table[((Δx)^i),{i,0,n1}],
Table[((Δt)^i),{i,0,n2}]
}
]

The sym. second diff at t-Δx/2

{n1,n2}={4,4};
Thing=u[x+Δx,t-Δt/2]-2 u[x,t-Δt/2]+u[x-Δx,t-Δt/2];
TableForm[
CoefficientList[
Expand[Normal[ 
Series[
Thing,{Δx,0,n1},{Δt,0,n2}]
]
],
{Δx,Δt}]/.u_[x,t]->u,
TableHeadings->{
Table[((Δx)^i),{i,0,n1}],
Table[((Δt)^i),{i,0,n2}]
}
]

The weighted sym. second diff

{n1,n2}={4,4};
Thing=θ(u[x+Δx,t+Δt/2]-2 u[x,t+Δt/2]+u[x-Δx,t+Δt/2]) + 
(1-θ)(u[x+Δx,t-Δt/2]-2 u[x,t-Δt/2]+u[x-Δx,t-Δt/2]);
TableForm[
Simplify[
CoefficientList[
Expand[Normal[ 
Series[
Thing,{Δx,0,n1},{Δt,0,n2}]
]
],
{Δx,Δt}]/.u_[x,t]->u
],
TableHeadings->{
Table[((Δx)^i),{i,0,n1}],
Table[((Δt)^i),{i,0,n2}]
}
]

The sym diff in t.

{n1,n2}={4,8};
Thing=u[x,t+Δt/2]-u[x,t-Δt/2] 
TableForm[
Simplify[
CoefficientList[
Expand[Normal[ 
Series[
Thing,{Δx,0,n1},{Δt,0,n2}]
]
],
{Δx,Δt}]/.u_[x,t]->u
],
TableHeadings->{
Table[((Δx)^i),{i,0,n1}],
Table[((Δt)^i),{i,0,n2}]
}
]

Useful Trig

We keep using Euler's Identity and some other unfamiliar Trig.

ComplexExpand[(E^(I θ))]

These have some simple consequences.

ComplexExpand[(E^(I θ))+(E^(-I θ))]

ComplexExpand[(E^(I θ))-(E^(-I θ))]

Just about as simple is

ComplexExpand[(((E^(I θ))-2+(E^(-I θ)))/2)]

The text also likes to use the half angle formulas

TrigReduce[((Sin[θ/2])^2)]

TrigReduce[((Cos[θ/2])^2)]

You can work these out from the addition formulas and the Pythagorean theorem or use the complex Euler form.

ComplexExpand[(((E^(2I θ))-4(E^(I θ))+6-4(E^(-I θ))-(E^(2 I θ)))/2)]

Plot[
{1,1+0.01ComplexExpand[(((E^(2I θ))-4(E^(I θ))+6-4(E^(-I θ))-(E^(2 I θ)))/2)]},
{θ,0,2π}]