def _derivative_(self, u, m, diff_param): """ EXAMPLES:: sage: x,m = var('x,m') sage: elliptic_eu(x,m).diff(x) sqrt(-m*jacobi_sn(x, m)^2 + 1)*jacobi_dn(x, m) sage: elliptic_eu(x,m).diff(m) 1/2*(elliptic_eu(x, m) - elliptic_f(jacobi_am(x, m), m))/m - 1/2*(m*jacobi_cn(x, m)*jacobi_sn(x, m) - (m - 1)*x - elliptic_eu(x, m)*jacobi_dn(x, m))*sqrt(-m*jacobi_sn(x, m)^2 + 1)/((m - 1)*m) """ from sage.functions.jacobi import jacobi, jacobi_am if diff_param == 0: return (sqrt(-m * jacobi('sn', u, m)**Integer(2) + Integer(1)) * jacobi('dn', u, m)) elif diff_param == 1: return (Integer(1) / Integer(2) * (elliptic_eu(u, m) - elliptic_f(jacobi_am(u, m), m)) / m - Integer(1) / Integer(2) * sqrt(-m * jacobi('sn', u, m)**Integer(2) + Integer(1)) * (m * jacobi('sn', u, m) * jacobi('cn', u, m) - (m - Integer(1)) * u - elliptic_eu(u, m) * jacobi('dn', u, m)) / ((m - Integer(1)) * m))
def _derivative_(self, u, m, diff_param): """ EXAMPLES:: sage: x,m = var('x,m') sage: elliptic_eu(x,m).diff(x) sqrt(-m*jacobi_sn(x, m)^2 + 1)*jacobi_dn(x, m) sage: elliptic_eu(x,m).diff(m) 1/2*(elliptic_eu(x, m) - elliptic_f(jacobi_am(x, m), m))/m - 1/2*(m*jacobi_cn(x, m)*jacobi_sn(x, m) - (m - 1)*x - elliptic_eu(x, m)*jacobi_dn(x, m))*sqrt(-m*jacobi_sn(x, m)^2 + 1)/((m - 1)*m) """ from sage.functions.jacobi import jacobi, jacobi_am if diff_param == 0: return (sqrt(-m * jacobi('sn', u, m) ** Integer(2) + Integer(1)) * jacobi('dn', u, m)) elif diff_param == 1: return (Integer(1) / Integer(2) * (elliptic_eu(u, m) - elliptic_f(jacobi_am(u, m), m)) / m - Integer(1) / Integer(2) * sqrt(-m * jacobi('sn', u, m) ** Integer(2) + Integer(1)) * (m * jacobi('sn', u, m) * jacobi('cn', u, m) - (m - Integer(1)) * u - elliptic_eu(u, m) * jacobi('dn', u, m)) / ((m - Integer(1)) * m))