Thanks. Both variants are helpful!

Carsten

On 02/19/2016 08:23 PM, Aaron Meurer wrote:
> It looks like the meijerg algorithm gives the better form:
> 
> In [33]: integrate(tan(x), x, meijerg=True)
> Out[33]: -log(cos(x))
> 
> Aaron Meurer
> 
> On Fri, Feb 19, 2016 at 2:21 PM, Ondřej Čertík <[email protected]> 
> wrote:
>> On Fri, Feb 19, 2016 at 8:45 AM, Aaron Meurer <[email protected]> wrote:
>>> trigsimp() will convert the sin to cos. To remove the negative and
>>> square, you'll have to use expand_log(force=True), which gives a
>>> complex constant (which can be ignored, since this is an integral).
>>>
>>> It would definitely be better if integrate at least gave log(1 -
>>> sin(x)**2) so that the result is real.
>>
>> Here is a code that does this:
>>
>> In [1]: expand_log(integrate(tan(x), x).trigsimp(), force=True)
>> Out[1]: -log(cos(x)) - I*pi/2
>>
>> Ondrej



-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/56CB103F.3060509%40gmx.de.
For more options, visit https://groups.google.com/d/optout.

Reply via email to