Menu

#3314 Maxima does not calculate taylor series in some cases.

None
open
nobody
taylor (33)
3
2017-07-01
2017-06-30
APRILIO
No

Maxima does not calculate Taylor series in some cases. For instance:
assume(x>0);
define(g(t),(cos(t)-1)/t^2);
define(f(x),integrate(g(t),t,0,x));
ratsimp(taylor(f(x),x,0,12)-(sum(limit(diff(f(x),x,n),x,0)/n!*x^n,n,0,12)));

Here you have more cases like this:
g(t),sin(t)^2/t^2-1
g(t),sin(t)/t
g(t),(sin(t)/t)^2
g(t),(exp(t^2)-1)/t
g(t),(cos(t)-1)/t^2
g(t),(sin(t)^2-t^2)/t^3

It seems that, instead of Taylor series for int_0^x, it calculates Taylor series for int_x^{2x}

I have only found this bug when calculating Taylor series for functions f defined as in the example (by means of an integral).


wxMaxima version: 15.8.2
Maxima version: 5.37.2
Maxima build date: 2015-10-30 02:08:33
Host type: x86_64-unknown-linux-gnu
System type: BSD BSD NIL
Lisp implementation type: GNU Common Lisp (GCL)
Lisp implementation version: GCL 2.6.12
.-----------------------------------------------------------

Discussion

  • Aleksas

    Aleksas - 2017-07-01

    How we got the wrong result. Some details.

    (%i3) assume(x>0);
    define(g(t),h(t)/t^2);
    define(f(x),integrate(g(t),t,0,x));
    (%o1) [x>0]
    (%o2) g(t):=h(t)/t^2
    (%o3) f(x):=integrate(h(t)/t^2,t,0,x);

    (%i4) T:taylor(f(x),x,0,3);
    (T) h(0)/x+(5(at('diff(h(x),x,1),x=0)))/6+((at('diff(h(x),x,2),x=0))x)/2+((at('diff(h(x),x,3),x=0))x^2)/4+
    (7
    (at('diff(h(x),x,4),x=0))*x^3)/72+...

    (%i7) h(t):=cos(t)-1;
    ev(T, nouns);
    expand(%);
    (%o5) h(t):=cos(t)-1
    (%o6)/R/ (7x^3-36x)/72
    (%o7) (7*x^3)/72-x/2

     
  • Aleksas

    Aleksas - 2017-07-01

    How we got the wrong result. Some details.

    (%i3) assume(x>0);
    define(g(t),h(t)/t^2);
    define(f(x),integrate(g(t),t,0,x));
    (%o1) [x>0]
    (%o2) g(t):=h(t)/t^2
    (%o3) f(x):=integrate(h(t)/t^2,t,0,x);

    (%i4) T:taylor(f(x),x,0,3);
    (T)
    h(0)/x+(5(at('diff(h(x),x,1),x=0)))/6+((at('diff(h(x),x,2),x=0))x)/2+((at('diff(h(x),x,3),x=0))x^2)/4+(7(at('diff(h(x),x,4),x=0))*x^3)/72+...

    (%i7) h(t):=cos(t)-1;
    ev(T, nouns);
    expand(%);
    (%o5) h(t):=cos(t)-1
    (%o6)/R/ (7x^3-36x)/72
    (%o7) (7*x^3)/72-x/2

    2017-06-30 16:59 GMT+03:00 APRILIO aprilio@users.sf.net:


    Status: open
    Group: None
    Labels: taylor
    Created: Fri Jun 30, 2017 01:59 PM UTC by APRILIO
    Last Updated: Fri Jun 30, 2017 01:59 PM UTC
    Owner: nobody

    Maxima does not calculate Taylor series in some cases. For instance:
    assume(x>0);
    define(g(t),(cos(t)-1)/t^2);
    define(f(x),integrate(g(t),t,0,x));
    ratsimp(taylor(f(x),x,0,12)-(sum(limit(diff(f(x),x,n),x,0)/
    n!*x^n,n,0,12)));

    Here you have more cases like this:
    g(t),sin(t)^2/t^2-1
    g(t),sin(t)/t
    g(t),(sin(t)/t)^2
    g(t),(exp(t^2)-1)/t
    g(t),(cos(t)-1)/t^2
    g(t),(sin(t)^2-t^2)/t^3

    It seems that, instead of Taylor series for int_0^x, it calculates Taylor
    series for int_x^{2x}

    I have only found this bug when calculating Taylor series for functions f
    defined as in the example (by means of an integral).


    wxMaxima version: 15.8.2
    Maxima version: 5.37.2
    Maxima build date: 2015-10-30 02:08:33
    Host type: x86_64-unknown-linux-gnu
    System type: BSD BSD NIL
    Lisp implementation type: GNU Common Lisp (GCL)
    Lisp implementation version: GCL 2.6.12
    .-----------------------------------------------------------


    Sent from sourceforge.net because you indicated interest in
    https://sourceforge.net/p/maxima/bugs/3314/

    To unsubscribe from further messages, please visit
    https://sourceforge.net/auth/subscriptions/

     

Log in to post a comment.

MongoDB Logo MongoDB