# [Maxima] Maxima: trigsimp() introducing errors ??

Stavros Macrakis macrakis at alum.mit.edu
Wed Dec 19 14:06:33 CST 2007

```Try limit(trigsimp(q),delta3,0) ... this is a removable singularity.

You can confirm that they are equal by comparing the taylor series at 0:

taylor(q, delta3, 0, 5);

taylor(trigsimp(q), delta3, 0, 5);

You can also reorganize the expression using my divthru function:

divthru(a):=block([n,d,div],
if mapatom(a) then a elseif inpart(a,0) = "*" and
numberp(n:inpart(a,1))
then (div:divthru(a/n),if not atom(div) and inpart(div,0) = "+"
then multthru(n*div) else n*div) elseif part(a,0) = "//"
then (n:part(a,1),d:part(a,2),div:divide(n,d),div[2]/d+div[1])
elseif part(a,0) = "-" then -divthru(-a) else a)\$

then subst(0,delta3,divthru(trigsimp(q))) gives -k/2.

-s

On Dec 19, 2007 1:46 PM, Constantine Frangos <cfrangos at telkomsa.net> wrote:

>
>
> I have an expression q consisting of trigonometric terms, and q(delta3=0)
> =
> -k/2.
>
> When I apply trigsimp(q), the resulting expression has a singularity at
> delta3 = 0 (see below). It appears that trigsimp() is introducing errors
> ??
>
> Any assistance would be appreciated.
>
> Regards,
>
> C. Frangos.
>
>
> (%i82) q;
>
> (%o82) -k*Lc/(Lc*(cos(delta3)*sqrt(sin(delta3)^2*Lc^2
>                                    /(2*sin(delta3)*L2+cos(delta3)*Lc)^2
>                                    +1)
>                 +1)
>             +2*sin(delta3)*L2
>               *sqrt(sin(delta3)^2*Lc^2/(2*sin(delta3)*L2+cos(delta3)*Lc)^2
>                      +1))
> (%i83) subst(0,delta3,q);
>
> (%o83) -k/2
> (%i84) subst(0,delta3,trigsimp(q));
>
> Division by 0
>  -- an error.  Quitting.  To debug this try debugmode(true);
> (%i85)
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20071219/f01d21df/attachment-0001.htm
```