From: SourceForge.net <no...@so...> - 2008-03-17 13:37:41
|
Bugs item #1913067, was opened at 2008-03-12 17:06 Message generated for change (Comment added) made by rtoy You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=1913067&group_id=4933 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Lisp Core - Integration Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Ximin Luo (infinity0x) Assigned to: Nobody/Anonymous (nobody) Summary: Cannot integrate 1/(1+x^n) Initial Comment: Maxima cannot integrate functions of the form 1/(1+x^n) for n >= 7. Mathematica is capable of this. Maxima attempts the integration via an algorithm which seems to involve taking partial fractions. For example, if you try to integrate 1/(1+x^7) for example, Maxima gives: log(1+x)/7 - integral(x^5-2*x^4+3*x^3-4*x^2+5*x-6)/(x^6-x^5+x^4-x^3+x^2-x+1) / 7 I'm guessing a different algorithm (such as that employed by Mathematica) is required to give a fully symbolic answer. For the record, the integral(1/(1+x^7)) is: Log[1 + x]/7 - (Cos[Pi/7]*Log[1 + x^2 - 2*x*Cos[Pi/7]])/7 - (Cos[(3*Pi)/7]*Log[1 + x^2 - 2*x*Cos[(3*Pi)/7]])/7 - (Cos[(5*Pi)/7]*Log[1 + x^2 - 2*x*Cos[(5*Pi)/7]])/7 + (2*ArcTan[(x - Cos[Pi/7])*Csc[Pi/7]]* Sin[Pi/7])/7 + (2*ArcTan[(x - Cos[(3*Pi)/7])* Csc[(3*Pi)/7]]*Sin[(3*Pi)/7])/7 + (2*ArcTan[(x - Cos[(5*Pi)/7])* Csc[(5*Pi)/7]]*Sin[(5*Pi)/7])/7 ---- Additionally, this also means that we can calculate the integral(that nasty rational function), by calculating 7 * ( log(1+x)/7 - integral(1/(1+x^7)) ) As a side note, Mathematica also cannot give integral(that nasty rational function) fully symbolically. Instead, it gives: RootSum[1 - #1 + #1^2 - #1^3 + #1^4 - #1^5 + #1^6 & , (-6*Log[x - #1] + 5*Log[x - #1]*#1 - 4*Log[x - #1]*#1^2 + 3*Log[x - #1]* #1^3 - 2*Log[x - #1]*#1^4 + Log[x - #1]*#1^5)/(-1 + 2*#1 - 3*#1^2 + 4*#1^3 - 5*#1^4 + 6*#1^5) & ] where RootSum[ f, form ] represents the sum of form[x] for all x that satisfy the polynomial equation f[x] == 0. ---------------------------------------------------------------------- >Comment By: Raymond Toy (rtoy) Date: 2008-03-17 09:37 Message: Logged In: YES user_id=28849 Originator: NO If you can, please describe how to integrate these without knowing the roots of the equation. FWIW, maxima has a special function to integrate functions of the form f(x)/(a*x^n+b). (See enprog and eprog in sinint.lisp.) It only handles the cases of n = 4, 5, 6. And it does this by essentially doing a partial fraction expansion with hand-computed quadratic factors. It seems feasible to extend this to any n. ---------------------------------------------------------------------- Comment By: Raymond Toy (rtoy) Date: 2008-03-12 20:30 Message: Logged In: YES user_id=28849 Originator: NO Actually, the roots are obviously the seven roots of -1, which maxima does know, and it could have done the partial fraction expansion to find the value of the integral. Not sure how or where to teach maxima about this, though. Some thought needed. ---------------------------------------------------------------------- Comment By: Ximin Luo (infinity0x) Date: 2008-03-12 18:32 Message: Logged In: YES user_id=2003896 Originator: YES The point is that Maxima does not NEED to know the roots of that equation. Sorry for making this unclear. By doing the integral using a different algorithm which doesn't involve taking partial fractions, you can avoid the above, and get a purely symbolic integral, like Mathematic does. ---------------------------------------------------------------------- Comment By: Raymond Toy (rtoy) Date: 2008-03-12 18:16 Message: Logged In: YES user_id=28849 Originator: NO Maxima can't give an answer because it doesn't know the roots of (x^7+1)/(x+1). If you set integrate_use_rootsof:true, then maxima can return an answer, but unless you can compute the roots of the above equation, it's probably not very helpful. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=1913067&group_id=4933 |