Maxima can't integrate 1/(cos(x)+sin(x))



Dear Felix,

Many sincere thanks for your clarification below.

Perhaps, you can use the command ldefint for this definite
integration. This uses the conmmand limit on the indefinite
integral (a different approach) before the computation of
the definite integral. My successful attempt and verification
of the result numerically:

(C1) display2d : false$
(C2) int : ldefint(1/(cos(x)+sin(x)),x,0,%pi/4), logcontract;
(D2) LOG(-SQRT(2)/(SQRT(2)-2))/SQRT(2)
(C3) [float(int), romberg(1/(cos(x)+sin(x)),x,0,%pi/4)];
(D3) [0.62322524014023,0.62322575884376]

If you wish to use the  integrate command, then you have
to change the value of the option variable intanalysis in
a separate command (or in the same command with integrate):

(C1) intanalysis : false$
(C2) int1 : integrate(1/(cos(x)+sin(x)),x,0,%pi/4), logcontract;
(D2) -SQRT(2)*LOG((SQRT(2)+1)/(2*SQRT(2)+3))/2
(C3) [float(int1), romberg(1/(cos(x)+sin(x)),x,0,%pi/4)];
(D3) [0.62322524014023,0.62322575884376]

intanalysis : true (the default) makes a complete convergence test
before the actual integration, which sometimes fails as happened
in your case. Now, no convergence test any more, but the result
seems to be correct compared with Romberg's numerical integration
related result (and the previous result of ldefint as well).

Best regards from Patras,

Nikos

> "Felix E. Klee" <felix.klee.maxima@gmx.net> wrote:


> On Sunday 13 April 2003 23:02, richard noel fell wrote:
> >     It does for me, as does commercial Macsyma also.
>
> Oh, yes the indefinite integral works fine (I must have overlooked that
> yesterday). However, the definite integral
>     integrate(1/(cos(x)+sin(x)),x,0,%pi/4);
> doesn't work. It just returns the integral itself, even though the
integrand
> is well behaved on [0,%pi/4].
>
> Felix