I think FourierSeries
and FourierCoefficient
are bugged here. To get the result you want, you could use FourierCosSeries
or FourierCosCoefficient
, or, if you're careful, Integrate
.
We can simplify a little by pulling a/b^2
out and defining c -> b d
, to give
f = Cos[t]/(1 + d Cos[t]^2)^2;
Then we have
series = FourierCosSeries[f, t, 3, Assumptions -> d > 0]
(* Cos[t]/(1 + d)^(3/2) +
((8 (-1 + Sqrt[1 + d]) + d (-12 - 3 d + 8 Sqrt[1 + d])) Cos[3 t])/(d^2 (1 + d)^(3/2)) *)
The result looks pretty good for d = 1
:
Plot[Evaluate[{f, series} /. d -> 1], {t, -Pi, Pi}]
You can also get the correct results for the Fourier coefficients using Integrate
if you assume that d > 0
:
Table[Integrate[f Exp[-k I t], {t, -Pi, Pi}, Assumptions -> d > 0]/(2 Pi), {k, -3, 3, 2}]
(*
{
(8 (-1 + Sqrt[1 + d]) + d (-12 - 3 d + 8 Sqrt[1 + d]))/(2 d^2 (1 + d)^(3/2)),
1/(2 (1 + d)^(3/2)),
1/(2 (1 + d)^(3/2)),
(8 (-1 + Sqrt[1 + d]) + d (-12 - 3 d + 8 Sqrt[1 + d]))/(2 d^2 (1 + d)^(3/2))
}
*)
With no assumptions, however, you won't get useful results:
Table[Integrate[f Exp[-k I t], {t, -Pi, Pi}]/(2 Pi), {k, -3, 3, 2}]
(* {0, 0, 0, 0} *)
Now, what is going on with FourierSeries
?
FourierSeries[f, t, 3]
(* (8 E^(3 I t))/d^2 *)
Not really sure, but note that it is giving the same result as for the function expanded around d -> Infinity
:
Normal@Series[f, {d, Infinity, 0}]
(* Sec[t]^3/d^2 *)
FourierSeries[Sec[t]^3/d^2, t, 3]
(* (8 E^(3 I t))/d^2 *)
This is clearly wrong. It isn't even the correct series for Sec[t]^3
, and adding assumptions on d
doesn't help here. FourierCoefficient
gives the same thing:
Table[FourierCoefficient[Sec[t]^3/d^2, t, k], {k, -3, 3, 2}]
(* {0, 0, 0, 8/d^2} *)
If we pull out the d^2
, we get a slightly more reasonable result:
Table[FourierCoefficient[Sec[t]^3, t, k], {k, -3, 3, 2}]/d^2
(* {4/d^2, 0, 0, 4/d^2} *)
So it seems like there are definitely some problems going on here.
FourierParameters
setting? $\endgroup$FourierCoefficient
would seem to be what you want, however it Yields8 a/c^2
. Also if I specify values for the constants the direct integration and theFourierCoefficient
give completely different results. Maybe someone who gets this should write up an answer. $\endgroup$