Hey,
I've been trying to write my own program to calculate the Fourier-Coefficients and so far the program works but has an awful output.
I would like to have ai and bi written next to each output and also have the results for a and b in the same line, except a0 has to standalone or b0 has to be 0.
This is my code so far:
Clear[n, t, f, i, ak, bk] f[t_] := \[Pi]^2 - t^2; ak[f_, n_, t_] := (1/\[Pi]) Integrate[f[t] Cos[n t], {t, -\[Pi], \[Pi]}]; bk[f_, n_, t_] := (1/\[Pi]) Integrate[f[t] Sin[n t], {t, -\[Pi], \[Pi]}] n = 5; For[i = -1, i < n, Print[i.ak[f, i, t]], i++] For[i = 0, i < n, Print[i.bk[f, i, t]], i++]
Can someome help me and make the ouput more plesseant to look at. I have not done something like this in MATHEMATICA before.
Thanks for your help in advance and have a nice day.