title: Arctan Taylor Series in C
body: <p>I need to perform the Taylor Series for arctangent 50 times. Meaning 50 numbers between the domain of the arctan Taylor Series which is [-1,1]. I've tested it out with manual user input and it works fine, but the for loop for the 50 different inputs which I increment in the code by 0.01 and their corresponding results has been unsuccessful. I've tried everything I could think of so far, I'm out of ideas. Any help would be appreciated. Is there an issue with my brackets surrounding the Taylor Series that's conflicting with the other for loop? I've suspected it was the brackets but nothings worked when I attempted to fix it.    </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;math.h&gt;
  #include &lt;stdlib.h&gt;
  
  main (void) {
      double n;
      double x;
      double tSeries=0.0;
      double t2;
      double t1;
  
      for(n=0;n&lt;=50;++n) {
          for(x=-1;x&lt;=1;x=x+0.01) {
  
              t1=(pow(x,2*n+1))*pow(-1,n);
              t2=t1/(2*n+1);
              tSeries+=t2;
  
              printf("arctan(%lf)=%lf\n",x,tSeries);
          }
      }
      return 0;
  }
  </code></pre>