#6956: [with patch, needs work] cannot differentiate cotangent
---------------------------+------------------------------------------------
 Reporter:  burcin         |       Owner:                  
     Type:  defect         |      Status:  new             
 Priority:  major          |   Milestone:  sage-4.1.2      
Component:  symbolics      |    Keywords:                  
 Reviewer:  Burcin Erocal  |      Author:  Tim Joseph Dumol
   Merged:                 |  
---------------------------+------------------------------------------------
Changes (by burcin):

 * cc: jason, kcrisman (added)
  * reviewer:  => Burcin Erocal


Comment:

 Thanks for the quick patch.

 Here is my review:
  * the keyword argument `diff_param` is only useful for multivariate
 functions. In this case since all these functions are univariate, so we
 know the argument is `args[0]`. You can safely drop the first two lines of
 the `_derivative_()` methods and replace the third with `x = args[0]`.
  * continuing the previous item, we should tell these functions they are
 univariate. ATM, they silently drop the second argument:
 {{{
 sage: arccsc(a,b)
 arccsc(a)
 }}}
  You can do this by giving `nargs=1` as a parameter to the base class
 constructor.
  * It is better to give the variable as an argument to `diff` in the
 doctests, for example `diff(asech(x), x)`. I actually prefer
 `asech(x).derivative(x)`, but this is your patch. :)
  * The formula for the derivative of `asech(x)` you use is only true for x
 real. You need `-1/(x * (x+1) * sqrt( (1-x)/(1+x) ))`.
  * Similarly, the derivative of `acsch(x)` is `-1/(x^2 * sqrt(1 + 1/x^2)
 )`

 Can someone else check the derivatives to make sure there is no mistake?

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/6956#comment:2>
Sage <http://sagemath.org/>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to