define integer to simplify trigonometric functions



By the way, Maxima isn't as clever as it should be in some cases:

declare(n,integer)$

tan(x+3*%pi) => tan(x)

but

tan(x+n*%pi) => tan(x+n*%pi)

To get Maxima to simplify that, you need to use trigexpand:

trigexpand(tan(x+n*%pi)) => tan(x)

I hope we'll fix cases like this in later versions.

Enjoy using Maxima!

             -s

On Wed, Oct 19, 2011 at 17:21, Mark H Weaver <mhw at netris.org> wrote:

> anonymous <secretagent007 at web.de> writes:
> > is it possible to tell Maxima that the variable n is an integer, so
> > that Maxima will automatically simplify expressions like
> > sin( n*%pi ) = 0,
> > cos (n*%pi ) = (-1)^n ?
>
> Yes, you want to declare(n,integer):
>
> (%i2) declare(n, integer);
> (%o2) done
> (%i3) sin(n*%pi);
> (%o3) 0
> (%i4) cos(n*%pi);
> (%o4) (-1)^n
>
>     Mark
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>