title: Summation series using matlab
body: <p>When i write this in matlab<br/></p>
  <pre><code>syms x;
  f=x^3-cos(x);
  g=diff(f)
  </code></pre>
  <p>it gives out put as</p>
  <blockquote>
  <p>g =</p>
  <p>3*x^2+sin(x)</p>
  </blockquote>
  <p>Now I want to generate summation series as <br/>
  <img src="https://i.stack.imgur.com/PY5gK.png" alt="http://upload.wikimedia.org/math/e/1/c/e1c5e8954e1e68099d77ac15ffa765a7.png" /></p>
  <p>I google and found &quot;symsum&quot; command but it doesn't do my required task, when i write the following commands</p>
  <pre><code>syms k
  symsum(k^2, 0, 10)
  symsum(1/k^2,1,Inf)
  </code></pre>
  <p>it gives the out put as</p>
  <blockquote>
  <p>ans = 385</p>
  <p>ans = pi^2/6</p>
  </blockquote>
  <p>Can you guys guide me how can I genereate the series which produce output as<br/>
  <img src="https://i.stack.imgur.com/PY5gK.png" alt="http://upload.wikimedia.org/math/e/1/c/e1c5e8954e1e68099d77ac15ffa765a7.png" /></p>
  <p>so that when I give command diff(Sk); it should produce result as or something like that
  <img src="https://i.stack.imgur.com/LJc6i.png" alt="enter image description here" /></p>
  <p>For example in Mathematica I can do it as</p>
  <p><img src="https://i.stack.imgur.com/tWBKL.png" alt="SummationSeries with subscript" /></p>
  <p>Your assistance will be surely of great help.</p>