title: how do you do symbolic differentiation on function handle?
body: <p>Say if i define the following:</p>
  
  <pre><code>g = @(x) x/sqrt(x^2+1)
  </code></pre>
  
  <p>How do i get the derivative function for g, which i can then use to evaluate at different points?</p>
  
  <p>I tried the symbolic math toolkit, and tried the following:</p>
  
  <pre><code>&gt;&gt; syms x
  
  &gt;&gt; f = x/sqrt(x^2+1)
  
  f =
  
  x/(x^2 + 1)^(1/2)
  
  &gt;&gt; diff(f)
  
  ans =
  
  1/(x^2 + 1)^(1/2) - x^2/(x^2 + 1)^(3/2)
  </code></pre>
  
  <p>However, i cannot figure out how to turn this into a function handle/evaluate at different points. However, i prefer doing differentiation on function_handle.</p>
  
  <p>Thank you very much!</p>
  
  <p>Jason</p>