This is some code: The first plot (with the f[x,3]) gives me a graph. The second plot (with the 'numerical' form of f[x,3] given) does give me a plot
How can I fix this so that the first line gives me a plot?
f[x_, Nmax_] := Sum[a[n] Cos[24.30538589` n x], {n, 1, Nmax}] + Sum[b[n] Sin[24.30538589` n x], {n, 1, Nmax}] + a[0]/2; f[x, 3] (*-0.000663106 - 0.0216591 Cos[24.3054 x] - 0.00475935 Cos[48.6108 x] - 0.00889405 Cos[72.9162 x] + 0.0129294 Sin[24.3054 x] - 0.0228661 Sin[48.6108 x] + 0.00536402 Sin[72.9162 x]*) Plot[{f[x, 3]}}, {x, 0.30383`, 0.56234`}] Plot[{{-0.0006631064575023214` - 0.02165905118857869` Cos[24.30538589` x] - 0.004759352355590257` Cos[48.61077178` x] - 0.008894049060596227` Cos[72.91615767` x] + 0.012929362498750253` Sin[24.30538589` x] - 0.0228661379875381` Sin[48.61077178` x] + 0.005364020800842659` Sin[72.91615767` x]}}, {x, 0.30383`, 0.56234`}] EDIT
EDIT 2
Below is the entire code that I have written: Note that I have given just the inputs and not the outputs, but everything up until the second plot does actually seem to work and give me something which seems right...
data = {{0.30383`, -0.06683`}, {0.30837`, -0.05289`}, {0.3129`, \ -0.01927`}, {0.31744`, 0.02776`}, {0.32197`, 0.07177`}, {0.32651`, 0.08597`}, {0.33104`, 0.06693`}, {0.33558`, 0.03273`}, {0.34011`, 0.01049`}, {0.34465`, -0.00002`}, {0.34918`, 0.00341`}, {0.35372`, 0.01329`}, {0.35825`, 0.03038`}, {0.36279`, 0.04189`}, {0.36732`, 0.04932`}, {0.37186`, 0.05579`}, {0.37639`, 0.06438`}, {0.38093`, 0.05812`}, {0.38546`, 0.04418`}, {0.39`, 0.03288`}, {0.39454`, 0.01151`}, {0.39907`, -0.00437`}, {0.40361`, -0.02415`}, \ {0.40814`, -0.04318`}, {0.41268`, -0.04488`}, {0.41721`, -0.02499`}, \ {0.42175`, 0.00254`}, {0.42628`, 0.01371`}, {0.43082`, -0.00089`}, {0.43535`, -0.03078`}, \ {0.43989`, -0.06009`}, {0.44442`, -0.06483`}, {0.44896`, -0.04092`}, \ {0.45349`, -0.00142`}, {0.45803`, 0.03525`}, {0.46256`, 0.06063`}, {0.4671`, 0.05745`}, {0.47163`, 0.02872`}, {0.47617`, -0.01207`}, {0.4807`, -0.03938`}, {0.48524`, \ -0.04251`}, {0.48977`, -0.0247`}, {0.49431`, -0.009`}, {0.49884`, \ -0.00429`}, {0.50338`, -0.00654`}, {0.50791`, -0.01283`}, {0.51245`, \ -0.02396`}, {0.51698`, -0.04457`}, {0.52152`, -0.0575`}, {0.52605`, \ -0.06183`}, {0.53059`, -0.04522`}, {0.53512`, -0.01328`}, {0.53966`, 0.01694`}, {0.5442`, 0.0262`}, {0.54873`, 0.00785`}, {0.55327`, -0.03305`}, {0.5578`, -0.07145`}, {0.56234`, \ -0.07393`}} ListPlot[data, Joined -> True, Epilog -> {Black, Point[data]}] ListPlot[data, Joined -> True] nn = Length@data fun = Interpolation[data] {x1, x2} = fun[[1, 1]] Plot[fun[x], {x, x1, x2}, Epilog -> {Black, Point[data]}] NIntegrate[fun[x] Cos[x], {x, x1, x2}] a[n_?NumericQ] := NIntegrate[ 7.7366446172295085*fun[x]*Cos[7.7366446172295085*Pi*n x], {x, x1, x2}] 7.7366446172295085*Integrate[fun[x] Cos[24.30538589 n x], {x, x1, x2}] b[n_?NumericQ] := NIntegrate[ 7.7366446172295085*fun[x]*Sin[7.7366446172295085*Pi*n x], {x, x1, x2}] Sum[a[n] Cos[24.30538589` n x], {n, 1, 3}] + Sum[b[n] Sin[24.30538589` n x], {n, 1, 3}] + a[0]/2 f[x_, Nmax_] := Sum[a[n] Cos[24.30538589` n x], {n, 1, Nmax}] + Sum[b[n] Sin[24.30538589` n x], {n, 1, Nmax}] + a[0]/2 f[x, 3] Plot[{{-0.0006631064575023214` - 0.02165905118857869` Cos[24.30538589` x] - 0.004759352355590257` Cos[48.61077178` x] - 0.008894049060596227` Cos[72.91615767` x] + 0.012929362498750253` Sin[24.30538589` x] - 0.0228661379875381` Sin[48.61077178` x] + 0.005364020800842659` Sin[72.91615767` x]}}, {x, 0.30383`, 0.56234`}] Plot[f[x, 3], {x, 0.3083, 0.56234}] 
aandb? $\endgroup$Plotthat you need to remove. Actually, evenPlot[f[x,3], {x, 0.3083, 0.56234}]should be fine. $\endgroup$