Yes, you are right S L, a direct brute force summation is surely not the most efficient method of determining the sums of these series. You are the only one so far with a valid solution that met the 50*eps tests. In fact your answers are very much closer than that to mine, within a few eps. However, there is another single analytic function that can be used which is much simpler and would undoubtedly give you a lower "size" than 92 if you or others can find it. R. Stafford
thanks for the hint
Test  Status  Code Input and Output 

1  Pass 
%%
x = 1;
[c,s] = infinite_series(x);
c_correct = 0.3800580037051224; s_correct = 0.3845865774434312;
assert(abs(cc_correct)<50*eps & abs(ss_correct)<50*eps)

2  Pass 
%%
x = exp(1);
[c,s] = infinite_series(x);
c_correct = 0.2832904461013926; s_correct = 0.2693088098978689;
assert(abs(cc_correct)<50*eps & abs(ss_correct)<50*eps)

3  Pass 
%%
x = sqrt(3);
[c,s] = infinite_series(x);
c_correct = 0.3675627321761342; s_correct = 0.2464611942058812;
assert(abs(cc_correct)<50*eps & abs(ss_correct)<50*eps)

4  Pass 
%%
x = 0.001;
[c,s] = infinite_series(x);
c_correct = 0.9984257500575904; s_correct = 0.0079069688545917;
assert(abs(cc_correct)<50*eps & abs(ss_correct)<50*eps)

5  Pass 
%%
x = pi/4;
[c,s] = infinite_series(x);
c_correct = 0.2042534159513846; s_correct = 0.5511304391316155;
assert(abs(cc_correct)<50*eps & abs(ss_correct)<50*eps)

6  Pass 
%%
x = 0.0263;
[c,s] = infinite_series(x);
c_correct = 0.9574346130196565; s_correct = 0.1214323234202421;
assert(abs(cc_correct)<50*eps & abs(ss_correct)<50*eps)

7  Pass 
%%
x = 6.273;
[c,s] = infinite_series(x);
c_correct = 0.9837633160098646; s_correct = 0.0568212139709541;
assert(abs(cc_correct)<50*eps & abs(ss_correct)<50*eps)

8  Pass 
%%
x = 31/7;
[c,s] = infinite_series(x);
c_correct = 0.2961416175321223; s_correct = 0.3148962998550185;
assert(abs(cc_correct)<50*eps & abs(ss_correct)<50*eps)

Find all elements less than 0 or greater than 10 and replace them with NaN
15586 Solvers
2009 Solvers
Sum of first n terms of a harmonic progression
236 Solvers
Rotate input square matrix 90 degrees CCW without rot90
462 Solvers
1887 Solvers