DSolve bug for complicated forcing functions in a 2nd order ODE

*To*: mathgroup at smc.vnet.net*Subject*: [mg122394] DSolve bug for complicated forcing functions in a 2nd order ODE*From*: Dan Dubin <ddubin at ucsd.edu>*Date*: Thu, 27 Oct 2011 06:31:28 -0400 (EDT)*Delivered-to*: l-mathgroup@mail-archive0.wolfram.com

Folks -- reporting a bug in DSolve, I think. The following Module solves a 2nd order differential equation with periodic forcing, written as a Fourier series. The number of Fourier coefficients kept in the series is M. For M less than or equal to 40, the solution is correct, but for M greater than 40 it starts to go wrong. Try M=41, for instance. The resulting solution no longer satisfies the ODE. Any ideas what is happening here? PS[M_] := Module[{}, T = 1/2; =CF=89[n_] = 2 Pi n/T; f[n_] = 1/T Integrate[1 Exp[I =CF=89[n] t], {t, 0, 1/4}]; f[0] = Limit[f[n], n -> 0]; fapprox[t_] = Sum[f[n] Exp[-I =CF=89[n] t], {n, -M, M}]; s = DSolve[{x''[t] + 16 =CF=80^2 x[t] == fapprox[t], x[0] == 0, x'[0] == 0}, x[t], t]; xs[t_] = x[t] /. s[[1]]; xs''[t] + 16 Pi^2 xs[t] - fapprox[t] // Simplify] Prof. Dan Dubin Dept of Physics, UCSD La Jolla CA 92093-0319 858-534-4174 fax: 858-534-0173 ddubin at ucsd.edu