# [Maxima] integrate(sin(x)*cos(x),x)

sen1 at math.msu.edu sen1 at math.msu.edu
Wed May 16 05:23:25 CDT 2007

```Agreed that this might be low on the list of things to do, but, isn't
it reasonable to have indefinite integrals return constants to show the non-uniqueness?

Thus,

integrate(cos(x)*sin(x),x) would give

-cos(x)^2/2 + %c

This occurs for ode's, etc. so why not for indefinite integrals?

Thus, as expected,

(%i4) eq: 'diff(y(x),x) = sin(x)*cos(x);
d
(%o4)                      -- (y(x)) = cos(x) sin(x)
dx
(%i5) ode2(eq,y(x),x);
2
cos (x)
(%o5)                         y(x) = %c - -------
2

Also, it is curious that Maple 10 returns
sin(x)^2/2
while Mathematica 3.0 returns
-cos(x)^2/2

Is anyone still working on the symbolic integration stuff in maxima?
If so, how hard would it be to add constants to indefinite integrals?

>From this discussion, it seems that the indefinite integration and ode2
routines in maxima have little to do with each other.  Anyone know if
there are functions f(x) for which maxima can find the indefinite
integral but not solve the ode or vice versa?

-sen

On Tue, 15 May 2007, Doug Stewart wrote:

> Bill Wood wrote:
>> On Tue, 2007-05-15 at 20:23 -0500, Doug Stewart wrote:
>>
>>> I was showing my students how to use Maxima to check their homework.
>>>
>>> When I got to this part of the example I got a surprise.
>>> integrate(sin(x)*cos(x),x)
>>>
>>> maxima said it was  -cos^2(x)/2  and my book said it was sin^2(x)/2 so I
>>> looked it up in shaums formula book
>>> and it said sin^2(x)/2.
>>>
>>> So I then plotted up a graph in Octave and was convinced that Maxima is
>>> wrong.
>>>
>>> I then submitted a bug report and someone replied and told me that I
>>>
>>
>> You don't even need calculus -- sin^2(x) + cos^2(x) = 1 is a trig
>> identity.  That still doesn't justify rudeness.  The fact that this is a
>> well-known identity does not imply that someone will see how to apply it
>> in just the right form in a particular situation.
>> _______________________________________________
>> Maxima mailing list
>> Maxima at math.utexas.edu
>> http://www.math.utexas.edu/mailman/listinfo/maxima
>>
>>
> Yes you are all correct. :-) I see now what happened.
> I have been doing all the definite integrals for different Fourier
> series expansions, and was thinking that in stead of doing the definite
> integral complete, I would show them how to use Maxima to get all the
> parts before it was evaluated at 0 and pi.
> etc.
> So my mind was totally working with definite integrals and I forgot that
> I was now asking for an indefinite integral from Maxima.
> It worked for all the other examples that I had shown them.
>
> It would be nice if this one would return sin^2(x)/2 instead of -cos^(x)/2.
> (yes I know that they only differ by a constant and yes I know
> sin^2+cos^2=1 etc.)
>
> Doug Stewart
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>

--
---------------------------------------------------------------------------
| Sheldon E. Newhouse            |    e-mail: sen1 at math.msu.edu           |
| Mathematics Department         |       				   |
| Michigan State University      | telephone: 517-355-9684                |
| E. Lansing, MI 48824-1027 USA  |       FAX: 517-432-1562                |
---------------------------------------------------------------------------
```