---------- Forwarded message ----------
From: Elliott Brossard <[EMAIL PROTECTED]>
Date: Tue, Jul 8, 2008 at 4:39 PM
Subject: Re: working on Sage
To: William Stein <[EMAIL PROTECTED]>


Here are the tests that currently succeed, some of which I've written
and some of which are from Maxima/Wester. I've also attached some
taylor series tests that pass on Maxima but not Sage. I'll send you
the generalized failing integration cases when I finish with them,
too. The other Wester and Maxima tests files I've looked into aren't
nearly as straightforward to translate as the ones I've done so far,
though I wouldn't mind continuing by simply writing my own set of
tests for trig identities, algebraic simplification, differential
equations, or whatever else you think would be helpful to have.

Elliott

--- On Tue, 7/8/08, William Stein <[EMAIL PROTECTED]> wrote:

From: William Stein <[EMAIL PROTECTED]>
Subject: Re: working on Sage
To: [EMAIL PROTECTED], "sage-devel" <sage-devel@googlegroups.com>
Date: Tuesday, July 8, 2008, 1:52 AM

On Mon, Jul 7, 2008 at 9:12 PM, Elliott Brossard
<[EMAIL PROTECTED]> wrote:
> Hi William,
>
> I am becoming more familiar with both Linux and Sage now, which makes
things
> much easier. I finished porting the Maxima and Wester integration tests to
> Sage, though there are many that currently fail...I've attached them,
if

You attached only the ones that fail?   Where are the ones that succeed?

> you'd like to see. The problem that many of them have results from
ambiguity
> of variables under a radical, in a denominator, or in a function with a
> restricted domain. As an example, inputting

Can you just make a new test that tests each case?

> var('a')
>

 integrate(log(x)/a, x, a, a+1)
>
> will throw an error: 'is a positive or negative?' Two assume
> statements--assume(x+a+1>0) and assume(a-1>0)--render Sage capable
of
> responding, and it outputs
>
> ((a + 1)*log(a + 1) - a*log(a) - 1)/a
>
> My TI-89 calculator, which uses Derive, gets the same result, though
without
> using 'assume' in any form. Trouble is, I can't imagine
there's a quick fix
> for this, and since most of the failing integrals are from Maxima's
own test

It would likely be possible -- though difficult (maybe not too difficult) --
to have Sage automatically give all possible answers to Maxima and
construct a conditional integral expression that gives each possible
answer for given conditions.

> suite, they must already know about it. Some of the other failing
> integration tests are merely identities that the current version
 of
 Maxima
> likely fixes...at least I hope so. I also wrote a series of tests for the
> various rules of differentiation, though all of them check out fine.

You can get the current version of Maxima presumably from the maxima
website.

> What I would like to start on next is the calc101 sort of website that I
> discussed with you before, though I was wondering if we could meet to go
> over the specifics of how I would implement it. I'll be at the UW on
> Thursday for a class from 3-5pm, so I would be happy to meet with you
> beforehand or afterward, though if that doesn't work another day would
be
> fine as well.

I am in San Diego.  I could meet with you next week maybe, but I'm
not sure since I'm going to Europe on the morning of the 16th.

 -- William


-- 
William Stein
Associate Professor of Mathematics
University of Washington
http://wstein.org

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

"""
    INTEGRALS:
    # Some tests require that we first init a few variables
    sage: var('a,b,c,a1,b1,s,k1,h,l,r,k,kj,kj1,t,q,p,eps,y,E')
    (a, b, c, a1, b1, s, k1, h, l, r, k, kj, kj1, t, q, p, eps, y, E)
    sage: integrate(1/x/sqrt(x^2 - 1),x)
    -arcsin(1/abs(x))
    sage: integrate(1/x/sqrt(x^2 + 1),x)
    -arcsinh(1/abs(x))
    sage: integrate(1/x/sqrt(-6 + 5*x - x^2),x)
    arcsin(5*x/abs(x) - 12/abs(x))/sqrt(6)
    sage: integrate(1/x/sqrt(-x^2 + x - 1),x)
    I*arcsinh(x/(sqrt(3)*abs(x)) - 2/(sqrt(3)*abs(x)))
    sage: integrate(1/sqrt(c*x^2 + b*x + b^2/4/c),x)
    log(x + b/(2*c))/sqrt(c)
    sage: integrate(1/sqrt(c*x^2 + b*x + b^2/4/c)^3,x)
    -1/(2*c^(3/2)*(x + b/(2*c))^2)
    sage: factor(integrate((x^2 + a1*x + b1)/(x^4 + 10*x^2 + 9),x,-oo,oo))
    pi*(b1 + 3)/12
    sage: factor(integrate((x^2 + a1*x + b1)/(x^4 + 10*x^2 + 9),x,0,oo))
    (pi*b1 + 3*log(3)*a1 + 3*pi)/24
    sage: integrate(1/(x^2 + x + 1),x,0,oo)
    2*pi/(3*sqrt(3))
    sage: integrate((x - I)/((x - 2*I)*(x^2 + 1)),x,-oo,oo)
    2*pi/3
    sage: integrate((x - I)/((x - 2*I)*(x^2 + 1)),x,0,oo)
    (6*I*log(2) + 6*pi)/18
    sage: integrate(1/(x^2 + x + 1)^3,x,0,oo)
    (8*sqrt(3)*pi - 27)/54
    sage: integrate(1/((1 + x)*sqrt(x)),x,0,oo)
    pi
    sage: integrate(x^6/(x^2 + x + 1)^(15/2),x,0,oo)
    2048/6567561
    sage: integrate(cos(x)/(x^2 + 1),x,-oo,oo)
    e^-1*pi
    sage: integrate(x*sin(x)/(x^2 + 1),x,-oo,oo)
    e^-1*pi
    sage: integrate(x*cos(x)/(x^2 + 1),x,-oo,oo)
    0
    sage: integrate(x*cos(x)/(x^2 + x + 1),x,-oo,oo)
    e^(-(sqrt(3)/2))*(3*pi*sin(1/2) - sqrt(3)*pi*cos(1/2))/3
    sage: integrate(1/(e^(I*x)*(x^2 + 1)),x,-oo,oo)
    e^-1*pi
    sage: integrate(sin(x)/(e^(I*x)*(x^2 + 1)),x,-oo,oo)
    -e^-2*(e^2 - 1)*I*pi/2
    sage: integrate(sin(x)/(e^(2*I*x)*(x^2 + 1)),x,-oo,oo)
    -e^-3*(e^2 - 1)*I*pi/2
    sage: integrate(cos(9*x^(7/3)),x,0,oo)
    3*gamma(3/7)*cos(3*pi/14)/(7*9^(3/7))
    sage: integrate(sin(9*x^(7/3)),x,0,oo)
    3*gamma(3/7)*sin(3*pi/14)/(7*9^(3/7))
    sage: integrate(log(x)^2/(x^2 + 1),x,0,oo)
    pi^3/8
    sage: integrate((arctan(x^(1/3))  +  arctan(x^(-1/3)))*log(x)/(x^2 + 
1),x,0,oo)
    0
    sage: factor(integrate(1/(exp(x/3)*(5/exp(x/3) + 7)),x,0,oo))
    3*(log(12) - log(7))/5
    sage: integrate(exp(x/4)/(9*exp(x/2) + 4),x,-oo,oo)
    pi/3
    sage: integrate(x/(sinh(x) - I),x,-oo,oo)
    pi
    sage: integrate(exp(-x^2),x,0,oo)
    sqrt(pi)/2
    sage: (integrate(1/(x^2 - 3),x,0,1)  -  sqrt(3)*log(2 - 
sqrt(3))/6).rational_simplify()
    0
    sage: integrate(cos(x)^2 - sin(x),x,0,2*pi)
    pi
    sage: integrate(exp(2*I*x)/(exp(I*x) + 3),x,0,2*pi)
    0
    sage: integrate(cos(x)^(1/3)*sin(x)^(1/2),x,0,pi/2)
    beta(3/4, 2/3)/2
    sage: integrate(cos(x)^(1/3)*sin(x)^2,x,-pi/2,pi/2)
    beta(2/3, 3/2)
    sage: integrate(cos(x)^3*sin(x)^2,x,3*pi/2,3*pi)
    2/15
    sage: integrate(1/(x*sqrt(x^2 - 9)),x,3,4)
    pi/6 - arcsin(3/4)/3
    sage: integrate(sqrt(log(x))/x^2,x,1,oo)
    sqrt(pi)/2
    sage: factor(integrate(sqrt(1 - sqrt(x))*log(x)/sqrt(x),x,0,1))
    16*(3*log(2) - 4)/9
    sage: integrate(x/sqrt(2*e*x^2 - a^2),x)
    e^-1*sqrt(2*e*x^2 - a^2)/2
    sage: integrate(x/sqrt(2*e*x^2 - a^2 - eps^2),x)
    e^-1*sqrt(2*e*x^2 - eps^2 - a^2)/2
    sage: (integrate(1/(sin(x)^2 + 1),x,0,8)).rational_simplify()
    (sqrt(2)*arctan(sqrt(2)*sin(8)/cos(8)) + 3*sqrt(2)*pi)/2
    sage: (integrate(1/(sin(x)^2 + 1),x,-8,0)).rational_simplify()
    (sqrt(2)*arctan(sqrt(2)*sin(8)/cos(8)) + 3*sqrt(2)*pi)/2
    sage: integrate(1/(2 + cos(x)),x,-pi/2,pi/2)
    2*sqrt(3)*pi/9
    sage: integrate(2*cot(x)^2*cos(2*x)/(csc(2*x) + cot(2*x)), x)
    (2*log(sin(x)^2 + cos(x)^2 + 2*cos(x) + 1)  +  2*log(sin(x)^2 + cos(x)^2 - 
2*cos(x) + 1)  +  cos(2*x))/2
"""
"""
# This file contains tests of various integration rules.
    INTEGRATION RULES:
# Zero
    sage: integrate(0, x)
    0

# Constant
    sage: integrate(5, x)
    5*x

# Factorable constant
    sage: integrate(5*x^x, x)
    5*integrate(x^x, x)

# Reverse power rule
    sage: integrate(5*x^4, x)
    x^5

# Natural log for 1/x
    sage: integrate(1/x, x)
    log(x)

# Trigonometric functions
    sage: integrate(cos(x), x)
    sin(x)
    sage: integrate(sin(x), x)
    -cos(x)
    sage: integrate(sec(x)^2, x)
    tan(x)
    sage: integrate(sec(x)*tan(x), x)
    1/cos(x)
    sage: integrate(csc(x)^2, x)
    -1/tan(x)
    sage: integrate(csc(x)*cot(x), x)
    -1/sin(x)

# Inverse trigonometric functions
    sage: integrate(1/sqrt(2^2 - x^2), x)
    arcsin(x/2)
    sage: integrate(1/(2^2 + x^2), x)
    arctan(x/2)/2
    sage: integrate(1/(x*sqrt(2^2 - x^2)), x) # though I think arcsec(x/2)/2 
would be a much simpler answer...
    -log(4*sqrt(4 - x^2)/abs(x) + 8/abs(x))/2

# Trigonometric simplification
    sage: integrate(sin(x)/cos(x)^2, x)
    1/cos(x)
    sage: integrate(cos(x)/(1 - cos(x)^2), x)
    -1/sin(x)
    sage: integrate(tan(x)^2 + 1, x)
    tan(x)
    sage: integrate(sqrt(1 + tan(x)^2), x, 0, pi/4)
    arcsinh(1)

# Properties of definite integrals
    sage: integrate(x^2/(x - 1), x, 1, 1) # if a and b are equal, integral of f 
from a to be equals 0
    0
    sage: if(integrate(sqrt(1 - x), x, 2, 1) == -integrate(sqrt(1 - x), x, 1, 
2)): print True # integral of f from a to b equals -1 times integral of f from 
b to a 
    True
    sage: var('t, x')
    (t, x)
    sage: derivative(integrate(cos(t), t, pi/2, x^3), x) # second fundamental 
theorem of calculus
    3*x^2*cos(x^3)
    sage: forget()
    

# Exponential functions
    sage: integrate(e^x, x)
    e^x
    sage: integrate(5*x*e^(-x^2), x)
    -5*e^(-x^2)/2
    sage: integrate(sin(x)*e^cos(x), x)
    -e^cos(x)
    sage: integrate(e^x*cos(e^x), x)
    sin(e^x)
    sage: integrate(3^(2*x)/(1 + 3^(2*x)), x)
    log(3^(2*x) + 1)/(2*log(3))

# Linear and quadratic factors
    sage: integrate((5*x^2 + 20*x + 6)/(x^3 + 2*x^2 + x), x)
    -log(x + 1) + 6*log(x) - 9/(x + 1)
    sage: integrate((2*x^3 - 4*x - 8)/((x^2 - x)*(x^2 + 4)), x)
    log(x^2 + 4) + 2*log(x) + 2*arctan(x/2) - 2*log(x - 1)
    sage: integrate((8*x^3 + 13*x)/(x^2 + 2)^2, x)
    4*log(x^2 + 2) + 3/(2*x^2 + 4)
    sage: integrate(x/(16*x^4 - 1), x)
    log(4*x^2 - 1)/16 - log(4*x^2 + 1)/16

# These integrals currently should not return a solution
    sage: integrate(x^x, x)
    integrate(x^x, x)
    sage: integrate(cos(sin(x)), x)
    integrate(cos(sin(x)), x)
    sage: integrate(sin(cos(x)), x)
    integrate(sin(cos(x)), x)
"""
"""
# This file contains tests of various rules for derivatives.
# Compiled by Elliott Brossard
    DERIVATION RULES:
# Zero
    sage: derivative(0, x)
    0

# Constant
    sage: var('a')
    a
    sage: derivative(a, x)
    0
    sage: forget()
    

# Power rule
    sage: derivative(x^5, x)
    5*x^4
    sage: derivative((2*x^3 + x)^3, x)
    3*(6*x^2 + 1)*(2*x^3 + x)^2

# Trigonometric functions
    sage: derivative(cos(x), x)
    -sin(x)
    sage: derivative(sin(x), x)
    cos(x)
    sage: derivative(tan(x), x)
    sec(x)^2
    sage: derivative(sec(x), x)
    sec(x)*tan(x)
    sage: derivative(csc(x), x)
    -cot(x)*csc(x)
    sage: derivative(cot(x), x)
    -csc(x)^2
    sage: derivative(sinh(x), x)
    cosh(x)
    sage: derivative(cosh(x), x)
    sinh(x)
    sage: derivative(tanh(x), x)
    sech(x)^2
    sage: derivative(sech(x), x)
    -sech(x)*tanh(x)
    sage: derivative(csch(x), x)
    -coth(x)*csch(x)

# Inverse trigonometric functions
    sage: derivative(arcsin(x/2), x).rational_simplify()
    1/sqrt(4 - x^2)
    sage: derivative(arccos(x/2), x).rational_simplify()
    -1/sqrt(4 - x^2)
    sage: derivative(arctan(x/2), x).rational_simplify()
    2/(x^2 + 4)
    sage: derivative(arcsec(x/2), x).rational_simplify()
     2*sqrt(x^2)/(x^2*sqrt(x^2 - 4))
    sage: derivative(arccsc(x/2), x).rational_simplify()
    -2*sqrt(x^2)/(x^2*sqrt(x^2 - 4))
    sage: derivative(arccot(x/2), x).rational_simplify()
    -2/(x^2 + 4)
    sage: derivative(arcsinh(x/2), x).rational_simplify()
    1/sqrt(x^2 + 4)
    sage: derivative(arccosh(x/2), x).rational_simplify()
    1/sqrt(x^2 - 4)
    sage: derivative(arctanh(x/2), x).rational_simplify()
    -2/(x^2 - 4)
    sage: derivative(arcsech(x/2), x).rational_simplify()
    -2*sqrt(x^2)/(x^2*sqrt(4 - x^2))
    sage: derivative(arccsch(x/2), x)
    -2/(sqrt(4/x^2 + 1)*x^2)
    sage: derivative(arccoth(x/2), x)
    -1/(2*(x^2/4 - 1))

# Base e and others
    sage: derivative(e^(2*x), x)
    2*e^(2*x)
    sage: derivative(2^x, x)
    log(2)*2^x
    sage: derivative(x^x, x)
    x^x*(log(x) + 1)
    sage: derivative(cos(x)^x, x)
    cos(x)^x*(log(cos(x)) - x*sin(x)/cos(x))
    sage: derivative(sin(x)^x, x)
    sin(x)^x*(log(sin(x)) + x*cos(x)/sin(x))
    sage: derivative(tan(x)^x, x)
    tan(x)^x*(log(tan(x)) + x*sec(x)^2/tan(x))

# Repeated chain/power rule
    sage: derivative(tan(x)^(x^cos(x)), x)
    tan(x)^x^cos(x)*(x^cos(x)*(cos(x)/x - log(x)*sin(x))*log(tan(x)) + 
x^cos(x)*sec(x)^2/tan(x))
    sage: derivative(arcsin(x^2)^arccos(2^x), x)
    arcsin(x^2)^arccos(2^x)*(2*x*arccos(2^x)/(sqrt(1 - x^4)*arcsin(x^2)) - 
log(2)*2^x*log(arcsin(x^2))/sqrt(1 - 2^(2*x)))
"""
"""
    TAYLOR SERIES:
# Constants
    sage: taylor(0,x,1,2)
    0
    sage: taylor(-42,x,1,2)
    -42
    sage: float(taylor(6.023e23,x,1,2))
    6.0230000000000011e+23
    sage: taylor(sqrt(5),x,1,2)
    sqrt(5)
    sage: taylor(sqrt(5) - I,x,1,2).rational_simplify()
    sqrt(5) - I

# Polynomials
    sage: taylor(x,x,1,2).rational_simplify()
    x
    sage: var('y')
    y
    sage: taylor(x+sqrt(y), x, 1, 2).rational_simplify()
    sqrt(y) + x
    sage: taylor(x*(x+1) + sqrt(y),x,1,2).rational_simplify()
    sqrt(y) + x^2 + x
    sage: taylor(1 + sqrt(6) * x + pi*x^2,x,-golden_ratio,9).rational_simplify()
    pi*x^2 + sqrt(6)*x + 1
    sage: taylor((1 + x*y) * (1 - x),x,sqrt(2),3).rational_simplify()
    (x - x^2)*y - x + 1
    sage: expand(taylor(x*y + x^2 * y,x,5,3))
    x^2*y + x*y
    sage: taylor(x*(x-1),x,0,5)
    -x + x^2
    sage: taylor(abs(x),x,-sqrt(2),2).rational_simplify()
    -x
    sage: taylor(sqrt(1 + x),x,0,5)
    1 + x/2 - x^2/8 + x^3/16 - 5*x^4/128 + 7*x^5/256

# Trig and Logs
    sage: taylor(cos(x),x,0,4)
    1 - x^2/2 + x^4/24
    sage: taylor(sin(x),x,0,4)
    x - x^3/6
    sage: taylor(tan(x),x,0,4)
    x + x^3/3
    sage: taylor(cosh(x),x,0,5)
    1 + x^2/2 + x^4/24
    sage: taylor(sinh(x),x,0,5)
     x + x^3/6 + x^5/120
    sage: taylor(tanh(x),x,0,5)
    x - x^3/3 + 2*x^5/15
    sage: taylor(sin(x) / cos(x),x,0,10) - taylor(tan(x),x,0,10)
    0
    sage: taylor(sin(x) / cos(x),x, pi/6,10) - taylor(tan(x),x, pi/6,10)
    0
    sage: (taylor(sin(x + x^2) / cos(x + x^2),x, pi/6,10) - taylor(tan(x + x^2),x, pi/6,10)).trig_simplify()
    0
    sage: (taylor(sinh(x) / cosh(x),x,0,10) - taylor(tanh(x),x,0,10)).trig_simplify()
    0
    sage: (taylor(sinh(x) / cosh(x),x, 1/6,10) - taylor(tanh(x),x, 1/6,10)).trig_simplify()
    0
    sage: (taylor(sinh(x + x^2) / cosh(x + x^2),x, pi/6,10) - taylor(tanh(x + x^2),x, pi/6,10)).trig_simplify()
    0
    sage: taylor(log(x),x,1,3) - (x-1-(x-1)^2/2+(x-1)^3/3)
    0
    sage: taylor(exp(x),x,0,7)
    1 + x + x^2/2 + x^3/6 + x^4/24 + x^5/120 + x^6/720 + x^7/5040
    sage: taylor(exp(-x),x,0,7)
    1 - x + x^2/2 - x^3/6 + x^4/24 - x^5/120 + x^6/720 - x^7/5040
    sage: taylor(cos(x),x,0,5)
    1 - x^2/2 + x^4/24
    sage: taylor(sin(x),x,0,5)
    x - x^3/6 + x^5/120
    sage: taylor(tan(x),x,0,5)
    x + x^3/3 + 2*x^5/15
    sage: taylor(sec(x),x,0,5)
    1 + x^2/2 + 5*x^4/24
    sage: taylor(csc(x),x,0,5)
    1/x + x/6 + 7*x^3/360 + 31*x^5/15120
    sage: taylor(cot(x),x,0,5)
    1/x - x/3 - x^3/45 - 2*x^5/945
    sage: taylor(exp(x),x,0,5)
    1 + x + x^2/2 + x^3/6 + x^4/24 + x^5/120
    
"""
"""
    FAILING TAYLOR SERIES TESTS:
# gets: (x^4 - 12*x^2 + 24)*(5*x^4 + 12*x^2 + 24)/576
    sage: taylor(sec(x),x,pi/3,5) * taylor(cos(x),x,pi/3,5)
    1

# gets: (31*x^5/15120 + 7*x^3/360 + x/6 + 1/x)*(x^5/120 - x^3/6 + x)
    sage: taylor(csc(x),x,0,5) * taylor(sin(x),x,0,5)
    1

# gets: (-361*(x - pi/4)^5/(60*sqrt(2)) + 19*(x - pi/4)^4/(4*sqrt(2)) - 11*(x - pi/4)^3/(3*sqrt(2)) + 3*(x - pi/4)^2/sqrt(2) - sqrt(2)*(x - pi/4) + sqrt(2))*((x - pi/4)^5/(120*sqrt(2)) + (x - pi/4)^4/(24*sqrt(2)) - (x - pi/4)^3/(6*sqrt(2)) - (x - pi/4)^2/(2*sqrt(2)) + (x - pi/4)/sqrt(2) + 1/sqrt(2))
    sage: taylor(csc(x),x,pi/4,5) * taylor(sin(x),x,pi/4,5)
    1

# gets: (-2*x^5/945 - x^3/45 - x/3 + 1/x)*(2*x^5/15 + x^3/3 + x)
    sage: taylor(cot(x),x,0,5) * taylor(tan(x),x,0,5)
    1

# gets: ((-2*tan(12)^6 - 17*tan(12)^4 - 30*tan(12)^2 - 15)*(x - 12)^5/(15*tan(12)^6) + (2*tan(12)^4 + 5*tan(12)^2 + 3)*(x - 12)^4/(3*tan(12)^5) + (-tan(12)^4 - 4*tan(12)^2 - 3)*(x - 12)^3/(3*tan(12)^4) + (tan(12)^2 + 1)*(x - 12)^2/tan(12)^3 + (-tan(12)^2 - 1)*(x - 12)/tan(12)^2 + 1/tan(12))*((15*tan(12)^6 + 30*tan(12)^4 + 17*tan(12)^2 + 2)*(x - 12)^5/15 + (3*tan(12)^5 + 5*tan(12)^3 + 2*tan(12))*(x - 12)^4/3 + (3*tan(12)^4 + 4*tan(12)^2 + 1)*(x - 12)^3/3 + (tan(12)^3 + tan(12))*(x - 12)^2 + (tan(12)^2 + 1)*(x - 12) + tan(12))
    sage: taylor(cot(x),x,12,5) * taylor(tan(x),x,12,5)
    1

# gets: (x^4/24 + x^2/2 + 1)*(5*x^4/24 - x^2/2 + 1)
    sage: taylor(sech(x),x,0,5) * taylor(cosh(x),x,0,5)
    1

# gets: (sinh(pi/3)*(x - pi/3)^5/120 + cosh(pi/3)*(x - pi/3)^4/24 + sinh(pi/3)*(x - pi/3)^3/6 + cosh(pi/3)*(x - pi/3)^2/2 + sinh(pi/3)*(x - pi/3) + cosh(pi/3))*((-120*sinh(pi/3)^5 + 180*cosh(pi/3)^2*sinh(pi/3)^3 - 61*cosh(pi/3)^4*sinh(pi/3))*(x - pi/3)^5/(120*cosh(pi/3)^6) + (24*sinh(pi/3)^4 - 28*cosh(pi/3)^2*sinh(pi/3)^2 + 5*cosh(pi/3)^4)*(x - pi/3)^4/(24*cosh(pi/3)^5) + (5*cosh(pi/3)^2*sinh(pi/3) - 6*sinh(pi/3)^3)*(x - pi/3)^3/(6*cosh(pi/3)^4) + (2*sinh(pi/3)^2 - cosh(pi/3)^2)*(x - pi/3)^2/(2*cosh(pi/3)^3) - sinh(pi/3)*(x - pi/3)/cosh(pi/3)^2 + 1/cosh(pi/3))
    sage: taylor(sech(x),x,pi/3,5) * taylor(cosh(x),x,pi/3,5)
    1

# gets: (-31*x^5/15120 + 7*x^3/360 - x/6 + 1/x)*(x^5/120 + x^3/6 + x)
    sage: taylor(csch(x),x,0,5) * taylor(sinh(x),x,0,5)
    1

# gets: (cosh(pi/4)*(x - pi/4)^5/120 + sinh(pi/4)*(x - pi/4)^4/24 + cosh(pi/4)*(x - pi/4)^3/6 + sinh(pi/4)*(x - pi/4)^2/2 + cosh(pi/4)*(x - pi/4) + sinh(pi/4))*((-61*cosh(pi/4)*sinh(pi/4)^4 + 180*cosh(pi/4)^3*sinh(pi/4)^2 - 120*cosh(pi/4)^5)*(x - pi/4)^5/(120*sinh(pi/4)^6) + (5*sinh(pi/4)^4 - 28*cosh(pi/4)^2*sinh(pi/4)^2 + 24*cosh(pi/4)^4)*(x - pi/4)^4/(24*sinh(pi/4)^5) + (5*cosh(pi/4)*sinh(pi/4)^2 - 6*cosh(pi/4)^3)*(x - pi/4)^3/(6*sinh(pi/4)^4) + (2*cosh(pi/4)^2 - sinh(pi/4)^2)*(x - pi/4)^2/(2*sinh(pi/4)^3) - cosh(pi/4)*(x - pi/4)/sinh(pi/4)^2 + 1/sinh(pi/4))
    sage: taylor(csch(x),x,pi/4,5) * taylor(sinh(x),x,pi/4,5)
    1

# gets: (2*x^5/945 - x^3/45 + x/3 + 1/x)*(2*x^5/15 - x^3/3 + x)
    sage: taylor(coth(x),x,0,5) * taylor(tanh(x),x,0,5)
    1

# gets: ((-15*tanh(12)^6 + 30*tanh(12)^4 - 17*tanh(12)^2 + 2)*(x - 12)^5/15 + (3*tanh(12)^5 - 5*tanh(12)^3 + 2*tanh(12))*(x - 12)^4/3 + (-3*tanh(12)^4 + 4*tanh(12)^2 - 1)*(x - 12)^3/3 + (tanh(12)^3 - tanh(12))*(x - 12)^2 + (1 - tanh(12)^2)*(x - 12) + tanh(12))*((2*tanh(12)^6 - 17*tanh(12)^4 + 30*tanh(12)^2 - 15)*(x - 12)^5/(15*tanh(12)^6) + (2*tanh(12)^4 - 5*tanh(12)^2 + 3)*(x - 12)^4/(3*tanh(12)^5) + (-tanh(12)^4 + 4*tanh(12)^2 - 3)*(x - 12)^3/(3*tanh(12)^4) + (1 - tanh(12)^2)*(x - 12)^2/tanh(12)^3 + (tanh(12)^2 - 1)*(x - 12)/tanh(12)^2 + 1/tanh(12))
    sage: taylor(coth(x),x,12,5) * taylor(tanh(x),x,12,5)
    1

# gets: log(x^10/3628800 + x^9/362880 + x^8/40320 + x^7/5040 + x^6/720 + x^5/120 + x^4/24 + x^3/6 + x^2/2 + x + 1)
    sage: log(taylor(exp(x),x,0,10))
    x

# gets: e^(x - (x - 1)^10/10 + (x - 1)^9/9 - (x - 1)^8/8 + (x - 1)^7/7 - (x - 1)^6/6 + (x - 1)^5/5 - (x - 1)^4/4 + (x - 1)^3/3 - (x - 1)^2/2 - 1)
    sage: exp(taylor(log(x),x,1,10))
    x

# message: Computation failed due to a bug in Maxima -- NOTE: Maxima had to be restarted.
    sage: taylor(exp(x), x, -oo, 1)
    exp(x)

# message: Computation failed due to a bug in Maxima -- NOTE: Maxima had to be restarted.
    sage: taylor(log(cos(x)),x,pi/2,2)
    log((2*x-pi)/2)+log(-1)-(x-pi/2)^2/6
"""

Reply via email to