title: Passing jacobian to scipy.optimize.fsolve, when optimising a univariate function
body: <pre><code>import math  
  from scipy.optimize import fsolve
  
  def sigma(s, Bpu):  
      return  s - math.sin(s) - math.pi * Bpu
  
  def jac_sigma(s):
      return 1 - math.cos(s)
  
  if __name__ == '__main__':
      Bpu = 0.5
      sig_r = fsolve(sigma, x0=[math.pi], args=(Bpu), fprime=jac_sigma)
  </code></pre>
  
  <p>Running the above script throws the following error,</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\Users\RP12808\Desktop\_test_fsolve.py", line 12, in &lt;module&gt;
      sig_r = fsolve(sigma, x0=[math.pi], args=(Bpu), fprime=jac_sigma)
    File "C:\Users\RP12808\AppData\Local\Programs\Python\Python36\lib\site-packages\scipy\optimize\minpack.py", line 146, in fsolve
      res = _root_hybr(func, x0, args, jac=fprime, **options)
    File "C:\Users\RP12808\AppData\Local\Programs\Python\Python36\lib\site-packages\scipy\optimize\minpack.py", line 226, in _root_hybr
      _check_func('fsolve', 'fprime', Dfun, x0, args, n, (n, n))
    File "C:\Users\RP12808\AppData\Local\Programs\Python\Python36\lib\site-packages\scipy\optimize\minpack.py", line 26, in _check_func
      res = atleast_1d(thefunc(*((x0[:numinputs],) + args)))
  TypeError: jac_sigma() takes 1 positional argument but 2 were given
  </code></pre>
  
  <p>I am unsure how to pass jacobian to fsolve function... how do solve this?</p>
  
  <p>Thanks in advance..RP</p>